mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 02:37:28 +02:00
Change void return from RAND_seed back to int.
This commit is contained in:
14
src/ssl.c
14
src/ssl.c
@ -4981,7 +4981,10 @@ int wolfSSL_Init(void)
|
||||
return BAD_MUTEX_E;
|
||||
}
|
||||
#endif
|
||||
wolfSSL_RAND_seed(NULL, 0);
|
||||
if (wolfSSL_RAND_seed(NULL, 0) != WOLFSSL_SUCCESS) {
|
||||
WOLFSSL_MSG("wolfSSL_RAND_Seed failed");
|
||||
return WC_INIT_E;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef NO_SESSION_CACHE
|
||||
@ -31572,13 +31575,14 @@ static int wolfSSL_RAND_Init(void)
|
||||
|
||||
|
||||
/* WOLFSSL_SUCCESS on ok */
|
||||
void wolfSSL_RAND_seed(const void* seed, int len)
|
||||
int wolfSSL_RAND_seed(const void* seed, int len)
|
||||
{
|
||||
#ifndef WOLFSSL_NO_OPENSSL_RAND_CB
|
||||
if (wolfSSL_RAND_InitMutex() == 0 && wc_LockMutex(&gRandMethodMutex) == 0) {
|
||||
if (gRandMethods && gRandMethods->seed) {
|
||||
/* seed callback has return code, but function RAND_seed does not */
|
||||
(void)gRandMethods->seed(seed, len);
|
||||
int ret = gRandMethods->seed(seed, len);
|
||||
wc_UnLockMutex(&gRandMethodMutex);
|
||||
return ret;
|
||||
}
|
||||
wc_UnLockMutex(&gRandMethodMutex);
|
||||
}
|
||||
@ -31588,7 +31592,7 @@ void wolfSSL_RAND_seed(const void* seed, int len)
|
||||
#endif
|
||||
|
||||
/* Make sure global shared RNG (globalRNG) is initialized */
|
||||
(void)wolfSSL_RAND_Init();
|
||||
return wolfSSL_RAND_Init();
|
||||
}
|
||||
|
||||
|
||||
|
@ -30474,7 +30474,7 @@ static void test_wolfSSL_RAND_set_rand_method(void)
|
||||
rand_methods.status = &stub_rand_status;
|
||||
|
||||
AssertIntEQ(wolfSSL_RAND_set_rand_method(&rand_methods), WOLFSSL_SUCCESS);
|
||||
wolfSSL_RAND_seed(buf, num);
|
||||
AssertIntEQ(wolfSSL_RAND_seed(buf, num), 123);
|
||||
AssertIntEQ(wolfSSL_RAND_bytes(buf, num), 456);
|
||||
AssertIntEQ(wolfSSL_RAND_pseudo_bytes(buf, num), 9876);
|
||||
AssertIntEQ(wolfSSL_RAND_status(), 5432);
|
||||
|
@ -1408,7 +1408,7 @@ WOLFSSL_API const char* wolfSSL_RAND_file_name(char*, unsigned long);
|
||||
WOLFSSL_API int wolfSSL_RAND_write_file(const char*);
|
||||
WOLFSSL_API int wolfSSL_RAND_load_file(const char*, long);
|
||||
WOLFSSL_API int wolfSSL_RAND_egd(const char*);
|
||||
WOLFSSL_API void wolfSSL_RAND_seed(const void*, int);
|
||||
WOLFSSL_API int wolfSSL_RAND_seed(const void*, int);
|
||||
WOLFSSL_API void wolfSSL_RAND_Cleanup(void);
|
||||
WOLFSSL_API void wolfSSL_RAND_add(const void*, int, double);
|
||||
WOLFSSL_API int wolfSSL_RAND_poll(void);
|
||||
|
Reference in New Issue
Block a user