wolfSSL_RAND_set_rand_method: Cleanup

This commit is contained in:
Kareem Abuobeid
2021-03-18 10:27:31 -07:00
parent 832c99597c
commit 5aa23424a4

View File

@ -13244,11 +13244,6 @@ int wolfSSL_Cleanup(void)
#ifdef OPENSSL_EXTRA
wolfSSL_RAND_Cleanup();
if (wc_FreeMutex(&gRandMethodMutex) != 0)
ret = BAD_MUTEX_E;
else
gRandMethodsInit = 0;
#endif
if (wolfCrypt_Cleanup() != 0) {
@ -31902,6 +31897,9 @@ void wolfSSL_RAND_Cleanup(void)
gRandMethods->cleanup();
wc_UnLockMutex(&gRandMethodMutex);
}
if (wc_FreeMutex(&gRandMethodMutex) == 0)
gRandMethodsInit = 0;
#endif
#ifdef HAVE_GLOBAL_RNG
if (wc_LockMutex(&globalRNGMutex) == 0) {