Fix for new random seed crypto callback to properly reset error code in NOT_COMPILED_IN case.

This commit is contained in:
David Garske
2019-02-01 17:03:29 -08:00
parent 88d3abb1e6
commit 40a7bcfc20

View File

@ -2176,11 +2176,13 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
int ret = 0;
#ifdef WOLF_CRYPTO_CB
if (os != NULL && os->devId != INVALID_DEVID) {
ret = wc_CryptoCb_RandomSeed(os, output, sz);
if (ret != NOT_COMPILED_IN)
return ret;
}
if (os != NULL && os->devId != INVALID_DEVID) {
ret = wc_CryptoCb_RandomSeed(os, output, sz);
if (ret != NOT_COMPILED_IN)
return ret;
/* fall-through on not compiled in */
ret = 0; /* reset error code */
}
#endif
#ifdef HAVE_INTEL_RDSEED