RSA PSS check input length is hash length

Input is the hash of the message and the hash type is the hash used to
generate the hash/input.
This commit is contained in:
Sean Parkinson
2020-08-03 12:17:03 +10:00
parent ff08a01f94
commit 3ffa4350e8

View File

@ -1121,6 +1121,9 @@ static int RsaPad_PSS(const byte* input, word32 inputLen, byte* pkcsBlock,
hLen = wc_HashGetDigestSize(hType); hLen = wc_HashGetDigestSize(hType);
if (hLen < 0) if (hLen < 0)
return hLen; return hLen;
if ((int)inputLen != hLen) {
return BAD_FUNC_ARG;
}
hiBits = (bits - 1) & 0x7; hiBits = (bits - 1) & 0x7;
if (hiBits == 0) { if (hiBits == 0) {