Skip to content

Commit cd88a8a

Browse files
committed
peer review -- add !WC_NO_RNG gates around WC_RNG changes in wolfcrypt/src/rsa.c and wolfssl/wolfcrypt/rsa.h.
1 parent b087533 commit cd88a8a

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

wolfcrypt/src/rsa.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5254,7 +5254,7 @@ int wc_MakeRsaKey(RsaKey* key, int size, long e, WC_RNG* rng)
52545254
#endif /* !FIPS || FIPS_VER >= 2 */
52555255
#endif /* WOLFSSL_KEY_GEN */
52565256

5257-
5257+
#ifndef WC_NO_RNG
52585258
int wc_RsaSetRNG(RsaKey* key, WC_RNG* rng)
52595259
{
52605260
if (key == NULL || rng == NULL)
@@ -5264,6 +5264,7 @@ int wc_RsaSetRNG(RsaKey* key, WC_RNG* rng)
52645264

52655265
return 0;
52665266
}
5267+
#endif /* !WC_NO_RNG */
52675268

52685269
#ifdef WC_RSA_NONBLOCK
52695270
int wc_RsaSetNonBlock(RsaKey* key, RsaNb* nb)

wolfssl/wolfcrypt/rsa.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,11 @@ struct RsaKey {
214214
int type; /* public or private */
215215
int state;
216216
word32 dataLen;
217+
#ifndef WC_NO_RNG
217218
WC_RNG* rng; /* for PrivateDecrypt blinding and
218219
* _ifc_pairwise_consistency_test()
219220
*/
221+
#endif
220222
#ifdef WOLFSSL_SE050
221223
word32 keyId;
222224
byte keyIdSet;
@@ -403,7 +405,9 @@ WOLFSSL_API int wc_RsaPublicKeyDecodeRaw(const byte* n, word32 nSz,
403405
WOLFSSL_API int wc_RsaKeyToDer(RsaKey* key, byte* output, word32 inLen);
404406
#endif
405407

408+
#ifndef WC_NO_RNG
406409
WOLFSSL_API int wc_RsaSetRNG(RsaKey* key, WC_RNG* rng);
410+
#endif
407411
#ifdef WC_RSA_NONBLOCK
408412
WOLFSSL_API int wc_RsaSetNonBlock(RsaKey* key, RsaNb* nb);
409413
#ifdef WC_RSA_NONBLOCK_TIME

0 commit comments

Comments
 (0)