This commit is contained in:
Juliusz Sosinowicz
2021-10-19 16:41:45 +02:00
parent a4a093ebed
commit f512514fd6

View File

@@ -33351,19 +33351,22 @@ WOLFSSL_RSA* wolfSSL_RSA_generate_key(int len, unsigned long e,
WOLFSSL_MSG("memory error"); WOLFSSL_MSG("memory error");
} }
else { else {
for (;;) {
int gen_ret = wolfSSL_RSA_generate_key_native(rsa, len, bn, NULL);
if (gen_ret == WOLFSSL_ERROR_NONE)
break;
#ifdef HAVE_FIPS #ifdef HAVE_FIPS
else if (gen_ret == PRIME_GEN_E) for (;;)
continue; #endif
{
int gen_ret = wolfSSL_RSA_generate_key_native(rsa, len, bn, NULL);
if (gen_ret != WOLFSSL_ERROR_NONE) {
#ifdef HAVE_FIPS
if (gen_ret == PRIME_GEN_E)
continue;
#endif #endif
else {
wolfSSL_RSA_free(rsa); wolfSSL_RSA_free(rsa);
rsa = NULL; rsa = NULL;
break;
} }
#ifdef HAVE_FIPS
break;
#endif
} }
} }
wolfSSL_BN_free(bn); wolfSSL_BN_free(bn);