summaryrefslogtreecommitdiffstats
path: root/crypto/rsa/rsa_sign.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2002-11-26 11:14:32 +0000
committerRichard Levitte <levitte@openssl.org>2002-11-26 11:14:32 +0000
commitba8ad074905ac260117a983237bc61a488e9fb1e (patch)
treef244f6f587a13bf67d44658c4a2438090866b199 /crypto/rsa/rsa_sign.c
parent17582ccf21912342b1aeaa60f44c55abc7779a00 (diff)
The logic in the main signing and verifying functions to check lengths was
incorrect. Fortunately, there is a second check that's correct, when adding the pads. PR: 355
Diffstat (limited to 'crypto/rsa/rsa_sign.c')
-rw-r--r--crypto/rsa/rsa_sign.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/rsa/rsa_sign.c b/crypto/rsa/rsa_sign.c
index 2a440901de..c53ca73914 100644
--- a/crypto/rsa/rsa_sign.c
+++ b/crypto/rsa/rsa_sign.c
@@ -113,7 +113,7 @@ int RSA_sign(int type, const unsigned char *m, unsigned int m_len,
i=i2d_X509_SIG(&sig,NULL);
}
j=RSA_size(rsa);
- if ((i-RSA_PKCS1_PADDING) > j)
+ if (i > (j-RSA_PKCS1_PADDING_SIZE))
{
RSAerr(RSA_F_RSA_SIGN,RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY);
return(0);