mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 20:24:39 +02:00
linuxkm/module_hooks.c: wc_SetSeed_Cb(wc_GenerateSeed) in wolfssl_init() #ifdef WC_RNG_SEED, regardless of whether wolfcrypt_test() will be called.
This commit is contained in:
@@ -234,6 +234,16 @@ static int wolfssl_init(void)
|
|||||||
"] POST succeeded.\n");
|
"] POST succeeded.\n");
|
||||||
#endif /* HAVE_FIPS */
|
#endif /* HAVE_FIPS */
|
||||||
|
|
||||||
|
#ifdef WC_RNG_SEED_CB
|
||||||
|
ret = wc_SetSeed_Cb(wc_GenerateSeed);
|
||||||
|
if (ret < 0) {
|
||||||
|
pr_err("wc_SetSeed_Cb() failed with return code %d.\n", ret);
|
||||||
|
(void)libwolfssl_cleanup();
|
||||||
|
msleep(10);
|
||||||
|
return -ECANCELED;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WOLFCRYPT_ONLY
|
#ifdef WOLFCRYPT_ONLY
|
||||||
ret = wolfCrypt_Init();
|
ret = wolfCrypt_Init();
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
@@ -249,14 +259,7 @@ static int wolfssl_init(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NO_CRYPT_TEST
|
#ifndef NO_CRYPT_TEST
|
||||||
|
ret = wolfcrypt_test(NULL);
|
||||||
#ifdef WC_RNG_SEED_CB
|
|
||||||
ret = wc_SetSeed_Cb(wc_GenerateSeed);
|
|
||||||
if (ret == 0)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
ret = wolfcrypt_test(NULL);
|
|
||||||
}
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
pr_err("wolfcrypt self-test failed with return code %d.\n", ret);
|
pr_err("wolfcrypt self-test failed with return code %d.\n", ret);
|
||||||
(void)libwolfssl_cleanup();
|
(void)libwolfssl_cleanup();
|
||||||
|
Reference in New Issue
Block a user