We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4a88b3 commit 034fb37Copy full SHA for 034fb37
src/we_random.c
@@ -362,6 +362,7 @@ static int we_rand_bytes(unsigned char *buf, int num)
362
rc = wc_LockMutex(we_rng_mutex);
363
if (rc != 0) {
364
WOLFENGINE_ERROR_FUNC(WE_LOG_RNG, "wc_LockMutex", rc);
365
+ ret = 0;
366
}
367
else
368
#endif
@@ -374,7 +375,7 @@ static int we_rand_bytes(unsigned char *buf, int num)
374
375
376
#ifndef WE_STATIC_WOLFSSL
377
/* Mix global seed if RAND_add() or RAND_seed() has been called. */
- if (haveSeed) {
378
+ if (ret == 1 && haveSeed) {
379
ret = we_rand_mix_seed(buf, num, we_seed, sizeof(we_seed));
380
if (ret != 1) {
381
WOLFENGINE_ERROR_MSG(WE_LOG_RNG, "we_rand_mix_seed with global "
0 commit comments