diff options
author | Simon L. B. Nielsen <simon@FreeBSD.org> | 2006-09-10 20:16:43 +0000 |
---|---|---|
committer | Simon L. B. Nielsen <simon@FreeBSD.org> | 2006-09-10 20:16:43 +0000 |
commit | c800238ebb20445e752d61989a1317a79e1f7ee6 (patch) | |
tree | 6558541b18cbe9a3390f8f16afaf4fd1f6196993 /crypto | |
parent | 66387cee8fe93c97b4b5f66bc5270471e1c97120 (diff) | |
download | src-c800238ebb20445e752d61989a1317a79e1f7ee6.tar.gz src-c800238ebb20445e752d61989a1317a79e1f7ee6.zip |
Notes
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/openssl/crypto/rsa/rsa_sign.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crypto/openssl/crypto/rsa/rsa_sign.c b/crypto/openssl/crypto/rsa/rsa_sign.c index 230ec6d7ea2a..aa757acdec27 100644 --- a/crypto/openssl/crypto/rsa/rsa_sign.c +++ b/crypto/openssl/crypto/rsa/rsa_sign.c @@ -185,6 +185,23 @@ int RSA_verify(int dtype, const unsigned char *m, unsigned int m_len, sig=d2i_X509_SIG(NULL,&p,(long)i); if (sig == NULL) goto err; + + /* Excess data can be used to create forgeries */ + if(p != s+i) + { + RSAerr(RSA_F_RSA_VERIFY,RSA_R_BAD_SIGNATURE); + goto err; + } + + /* Parameters to the signature algorithm can also be used to + create forgeries */ + if(sig->algor->parameter + && sig->algor->parameter->type != V_ASN1_NULL) + { + RSAerr(RSA_F_RSA_VERIFY,RSA_R_BAD_SIGNATURE); + goto err; + } + sigtype=OBJ_obj2nid(sig->algor->algorithm); |