From 2cf5ad63acd2ded3333558234ab7d107a0a219b9 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 5 Oct 2016 10:55:30 -0700 Subject: [PATCH] wolfCrypt 1. Add call to wolfCrypt_Init() to wolfSSH_Init(). 2. Modify have_wolfssl.m4 to check for wolfCrypt, not wolfSSL. --- m4/have_wolfssl.m4 | 4 ++-- src/ssh.c | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/m4/have_wolfssl.m4 b/m4/have_wolfssl.m4 index fbd398d7..d9c5ae42 100644 --- a/m4/have_wolfssl.m4 +++ b/m4/have_wolfssl.m4 @@ -12,9 +12,9 @@ AC_DEFUN([_TAO_SEARCH_LIBWOLFSSL],[ AC_LIB_HAVE_LINKFLAGS(wolfssl,, [ - #include + #include ],[ - wolfSSL_Init(); + wolfCrypt_Init(); ]) AM_CONDITIONAL(HAVE_LIBWOLFSSL, [test "x${ac_cv_libwolfssl}" = "xyes"]) diff --git a/src/ssh.c b/src/ssh.c index 035d1b9a..6771f552 100644 --- a/src/ssh.c +++ b/src/ssh.c @@ -33,6 +33,7 @@ #include #include #include +#include #ifdef NO_INLINE #include @@ -44,9 +45,14 @@ int wolfSSH_Init(void) { + int ret = WS_SUCCESS; + WLOG(WS_LOG_DEBUG, "Entering wolfSSH_Init()"); - WLOG(WS_LOG_DEBUG, "Leaving wolfSSH_Init(), returning %d", WS_SUCCESS); - return WS_SUCCESS; + if (wolfCrypt_Init() != 0) + ret = WS_CRYPTO_FAILED; + + WLOG(WS_LOG_DEBUG, "Leaving wolfSSH_Init(), returning %d", ret); + return ret; }