From d31cec0df01cecdda8ddb059bf05fbcecfae0177 Mon Sep 17 00:00:00 2001 From: David Garske Date: Wed, 28 Oct 2015 23:07:52 -0700 Subject: [PATCH] Fixes initialization of the Crypto HW protection, which could leak a mutex if two calls to "wolfSSL_CryptHwMutexLock()" occurred at the same time prior to calling "wolfSSL_CryptHwMutexInit()". Fixes #164. --- wolfcrypt/src/wc_port.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wolfcrypt/src/wc_port.c b/wolfcrypt/src/wc_port.c index 9956da3c4..c769e2dcf 100644 --- a/wolfcrypt/src/wc_port.c +++ b/wolfcrypt/src/wc_port.c @@ -45,6 +45,11 @@ */ int wolfcrypt_Init() { + #if WOLFSSL_CRYPT_HW_MUTEX + /* If crypto hardware mutex protection is enabled, then initialize it */ + wolfSSL_CryptHwMutexInit(); + #endif + /* if defined have fast RSA then initialize Intel IPP */ #ifdef HAVE_FAST_RSA WOLFSSL_MSG("Setting up IPP Library");