peer review -- add !WC_NO_RNG gates around WC_RNG changes in wolfcrypt/src/rsa.c and wolfssl/wolfcrypt/rsa.h.

This commit is contained in:
Daniel Pouzzner
2025-12-23 11:41:59 -06:00
parent b087533fdf
commit cd88a8ae88
2 changed files with 6 additions and 1 deletions

View File

@@ -5254,7 +5254,7 @@ int wc_MakeRsaKey(RsaKey* key, int size, long e, WC_RNG* rng)
#endif /* !FIPS || FIPS_VER >= 2 */ #endif /* !FIPS || FIPS_VER >= 2 */
#endif /* WOLFSSL_KEY_GEN */ #endif /* WOLFSSL_KEY_GEN */
#ifndef WC_NO_RNG
int wc_RsaSetRNG(RsaKey* key, WC_RNG* rng) int wc_RsaSetRNG(RsaKey* key, WC_RNG* rng)
{ {
if (key == NULL || rng == NULL) if (key == NULL || rng == NULL)
@@ -5264,6 +5264,7 @@ int wc_RsaSetRNG(RsaKey* key, WC_RNG* rng)
return 0; return 0;
} }
#endif /* !WC_NO_RNG */
#ifdef WC_RSA_NONBLOCK #ifdef WC_RSA_NONBLOCK
int wc_RsaSetNonBlock(RsaKey* key, RsaNb* nb) int wc_RsaSetNonBlock(RsaKey* key, RsaNb* nb)

View File

@@ -214,9 +214,11 @@ struct RsaKey {
int type; /* public or private */ int type; /* public or private */
int state; int state;
word32 dataLen; word32 dataLen;
#ifndef WC_NO_RNG
WC_RNG* rng; /* for PrivateDecrypt blinding and WC_RNG* rng; /* for PrivateDecrypt blinding and
* _ifc_pairwise_consistency_test() * _ifc_pairwise_consistency_test()
*/ */
#endif
#ifdef WOLFSSL_SE050 #ifdef WOLFSSL_SE050
word32 keyId; word32 keyId;
byte keyIdSet; byte keyIdSet;
@@ -403,7 +405,9 @@ WOLFSSL_API int wc_RsaPublicKeyDecodeRaw(const byte* n, word32 nSz,
WOLFSSL_API int wc_RsaKeyToDer(RsaKey* key, byte* output, word32 inLen); WOLFSSL_API int wc_RsaKeyToDer(RsaKey* key, byte* output, word32 inLen);
#endif #endif
#ifndef WC_NO_RNG
WOLFSSL_API int wc_RsaSetRNG(RsaKey* key, WC_RNG* rng); WOLFSSL_API int wc_RsaSetRNG(RsaKey* key, WC_RNG* rng);
#endif
#ifdef WC_RSA_NONBLOCK #ifdef WC_RSA_NONBLOCK
WOLFSSL_API int wc_RsaSetNonBlock(RsaKey* key, RsaNb* nb); WOLFSSL_API int wc_RsaSetNonBlock(RsaKey* key, RsaNb* nb);
#ifdef WC_RSA_NONBLOCK_TIME #ifdef WC_RSA_NONBLOCK_TIME