diff options
author | Ulf Möller <ulf@openssl.org> | 2000-02-22 11:34:01 +0000 |
---|---|---|
committer | Ulf Möller <ulf@openssl.org> | 2000-02-22 11:34:01 +0000 |
commit | 17ef2916614ff3f1dfbab15c3250278528a31275 (patch) | |
tree | e5f81c22d5f4d5f64da29b438dfc3e8a8b1d32e1 /crypto/rsa/rsa_ssl.c | |
parent | 261b5d96ad8adaa08bbc2461e89bc59713fbfefe (diff) |
Check tlen size in all padding_check functions. As called within the rsa
library, the output buffer always is large enough, but if the tlen
parameter is there, it should be checked in the interest of clarity,
as proposed by David Sacerdote <das33@cornell.edu>.
Diffstat (limited to 'crypto/rsa/rsa_ssl.c')
-rw-r--r-- | crypto/rsa/rsa_ssl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/rsa/rsa_ssl.c b/crypto/rsa/rsa_ssl.c index 83dfc80c1d..81a857c813 100644 --- a/crypto/rsa/rsa_ssl.c +++ b/crypto/rsa/rsa_ssl.c @@ -142,6 +142,11 @@ int RSA_padding_check_SSLv23(unsigned char *to, int tlen, unsigned char *from, i++; /* Skip over the '\0' */ j-=i; + if (j > tlen) + { + RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23,RSA_R_DATA_TOO_LARGE); + return(-1); + } memcpy(to,p,(unsigned int)j); return(j); |