make sure we don't write to seed[-1]
This commit is contained in:
parent
2b49dd1e8f
commit
ee8aa8217a
1 changed files with 5 additions and 0 deletions
|
@ -111,6 +111,11 @@ int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
|
|||
}
|
||||
|
||||
lzero = num - flen;
|
||||
if (lzero < 0)
|
||||
{
|
||||
RSAerr(RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP, RSA_R_OAEP_DECODING_ERROR);
|
||||
return (-1);
|
||||
}
|
||||
maskeddb = from - lzero + SHA_DIGEST_LENGTH;
|
||||
|
||||
MGF1(seed, SHA_DIGEST_LENGTH, maskeddb, dblen);
|
||||
|
|
Loading…
Reference in a new issue