diff options
author | djm <> | 2005-04-29 05:37:34 +0000 |
---|---|---|
committer | djm <> | 2005-04-29 05:37:34 +0000 |
commit | a95585a25ab25668b931a78b7543f707a3354db8 (patch) | |
tree | f9e9febf7ac0c8f5d6df761fe70fd613aac06203 /src/lib/libcrypto/rsa/rsa_sign.c | |
parent | 58c08aa241f168c84ce7cc3052454ea59a44eada (diff) | |
download | openbsd-a95585a25ab25668b931a78b7543f707a3354db8.tar.gz openbsd-a95585a25ab25668b931a78b7543f707a3354db8.tar.bz2 openbsd-a95585a25ab25668b931a78b7543f707a3354db8.zip |
import of openssl-0.9.7g; tested on platforms from alpha to zaurus, ok deraadt@
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_sign.c')
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_sign.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_sign.c b/src/lib/libcrypto/rsa/rsa_sign.c index 8a1e642183..cee09eccb1 100644 --- a/src/lib/libcrypto/rsa/rsa_sign.c +++ b/src/lib/libcrypto/rsa/rsa_sign.c | |||
@@ -169,7 +169,7 @@ int RSA_verify(int dtype, const unsigned char *m, unsigned int m_len, | |||
169 | } | 169 | } |
170 | if((dtype == NID_md5_sha1) && (m_len != SSL_SIG_LENGTH) ) { | 170 | if((dtype == NID_md5_sha1) && (m_len != SSL_SIG_LENGTH) ) { |
171 | RSAerr(RSA_F_RSA_VERIFY,RSA_R_INVALID_MESSAGE_LENGTH); | 171 | RSAerr(RSA_F_RSA_VERIFY,RSA_R_INVALID_MESSAGE_LENGTH); |
172 | return(0); | 172 | goto err; |
173 | } | 173 | } |
174 | i=RSA_public_decrypt((int)siglen,sigbuf,s,rsa,RSA_PKCS1_PADDING); | 174 | i=RSA_public_decrypt((int)siglen,sigbuf,s,rsa,RSA_PKCS1_PADDING); |
175 | 175 | ||
@@ -222,8 +222,11 @@ int RSA_verify(int dtype, const unsigned char *m, unsigned int m_len, | |||
222 | } | 222 | } |
223 | err: | 223 | err: |
224 | if (sig != NULL) X509_SIG_free(sig); | 224 | if (sig != NULL) X509_SIG_free(sig); |
225 | OPENSSL_cleanse(s,(unsigned int)siglen); | 225 | if (s != NULL) |
226 | OPENSSL_free(s); | 226 | { |
227 | OPENSSL_cleanse(s,(unsigned int)siglen); | ||
228 | OPENSSL_free(s); | ||
229 | } | ||
227 | return(ret); | 230 | return(ret); |
228 | } | 231 | } |
229 | 232 | ||