mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-03 12:44:45 +02:00
14
src/ssl.c
14
src/ssl.c
@@ -4498,6 +4498,14 @@ int wolfSSL_Init(void)
|
||||
WOLFSSL_MSG("Bad wolfCrypt Init");
|
||||
return WC_INIT_E;
|
||||
}
|
||||
|
||||
#ifdef OPENSSL_EXTRA
|
||||
if (wolfSSL_RAND_seed(NULL, 0) != WOLFSSL_SUCCESS) {
|
||||
WOLFSSL_MSG("wolfSSL_RAND_Seed failed");
|
||||
return WC_INIT_E;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef NO_SESSION_CACHE
|
||||
if (wc_InitMutex(&session_mutex) != 0) {
|
||||
WOLFSSL_MSG("Bad Init Mutex session");
|
||||
@@ -22922,12 +22930,12 @@ int wolfSSL_RAND_bytes(unsigned char* buf, int num)
|
||||
return ret;
|
||||
#endif
|
||||
|
||||
if (wc_InitRng(tmpRNG) == 0) {
|
||||
if (initGlobalRNG)
|
||||
rng = &globalRNG;
|
||||
else if(wc_InitRng(tmpRNG) == 0) {
|
||||
rng = tmpRNG;
|
||||
initTmpRng = 1;
|
||||
}
|
||||
else if (initGlobalRNG)
|
||||
rng = &globalRNG;
|
||||
|
||||
if (rng) {
|
||||
if (wc_RNG_GenerateBlock(rng, buf, num) != 0)
|
||||
|
Reference in New Issue
Block a user