From 2cf5ad63acd2ded3333558234ab7d107a0a219b9 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 5 Oct 2016 10:55:30 -0700 Subject: [PATCH 1/2] 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; } From b0d318fce02057a8385a40fdb541f97ffbed50b1 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 5 Oct 2016 12:14:05 -0700 Subject: [PATCH 2/2] wolfCrypt Update Include wolfSSL's options.h to echoserver.c. When building wolfSSL with AES-NI and wolfSSH in debug, the ALIGN16 on the SHA-256 structure is lost in wolfSSH, where the wolfCrypt code is expecting the parameters to be ALIGN16. --- examples/echoserver/echoserver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/echoserver/echoserver.c b/examples/echoserver/echoserver.c index e9ea78eb..1b0aba8d 100644 --- a/examples/echoserver/echoserver.c +++ b/examples/echoserver/echoserver.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include