Fix for RSA with SHA3 only (resolves warning with unsed RsaMGF1.

This commit is contained in:
David Garske
2020-02-23 13:54:48 -08:00
parent 0f188be892
commit e80c696d5f

View File

@ -768,6 +768,7 @@ int wc_CheckRsaKey(RsaKey* key)
out: mask output after generation out: mask output after generation
outSz: size of output buffer outSz: size of output buffer
*/ */
#if !defined(NO_SHA) || !defined(NO_SHA256) || defined(WOLFSSL_SHA384) || defined(WOLFSSL_SHA512)
static int RsaMGF1(enum wc_HashType hType, byte* seed, word32 seedSz, static int RsaMGF1(enum wc_HashType hType, byte* seed, word32 seedSz,
byte* out, word32 outSz, void* heap) byte* out, word32 outSz, void* heap)
{ {
@ -841,9 +842,10 @@ static int RsaMGF1(enum wc_HashType hType, byte* seed, word32 seedSz,
return 0; return 0;
} }
#endif /* SHA2 Hashes */
/* helper function to direct which mask generation function is used /* helper function to direct which mask generation function is used
switeched on type input switched on type input
*/ */
static int RsaMGF(int type, byte* seed, word32 seedSz, byte* out, static int RsaMGF(int type, byte* seed, word32 seedSz, byte* out,
word32 outSz, void* heap) word32 outSz, void* heap)
@ -890,7 +892,7 @@ static int RsaMGF(int type, byte* seed, word32 seedSz, byte* out,
return ret; return ret;
} }
#endif /* !WC_NO_RSA_OAEP */ #endif /* !WC_NO_RSA_OAEP || WC_RSA_PSS */
/* Padding */ /* Padding */