diff options
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_saos.c')
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_saos.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_saos.c b/src/lib/libcrypto/rsa/rsa_saos.c index 85adacc08f..f462716a57 100644 --- a/src/lib/libcrypto/rsa/rsa_saos.c +++ b/src/lib/libcrypto/rsa/rsa_saos.c | |||
@@ -77,7 +77,7 @@ int RSA_sign_ASN1_OCTET_STRING(int type, | |||
77 | 77 | ||
78 | i=i2d_ASN1_OCTET_STRING(&sig,NULL); | 78 | i=i2d_ASN1_OCTET_STRING(&sig,NULL); |
79 | j=RSA_size(rsa); | 79 | j=RSA_size(rsa); |
80 | if ((i-RSA_PKCS1_PADDING) > j) | 80 | if (i > (j-RSA_PKCS1_PADDING_SIZE)) |
81 | { | 81 | { |
82 | RSAerr(RSA_F_RSA_SIGN_ASN1_OCTET_STRING,RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY); | 82 | RSAerr(RSA_F_RSA_SIGN_ASN1_OCTET_STRING,RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY); |
83 | return(0); | 83 | return(0); |
@@ -96,7 +96,7 @@ int RSA_sign_ASN1_OCTET_STRING(int type, | |||
96 | else | 96 | else |
97 | *siglen=i; | 97 | *siglen=i; |
98 | 98 | ||
99 | memset(s,0,(unsigned int)j+1); | 99 | OPENSSL_cleanse(s,(unsigned int)j+1); |
100 | OPENSSL_free(s); | 100 | OPENSSL_free(s); |
101 | return(ret); | 101 | return(ret); |
102 | } | 102 | } |
@@ -139,7 +139,7 @@ int RSA_verify_ASN1_OCTET_STRING(int dtype, | |||
139 | ret=1; | 139 | ret=1; |
140 | err: | 140 | err: |
141 | if (sig != NULL) M_ASN1_OCTET_STRING_free(sig); | 141 | if (sig != NULL) M_ASN1_OCTET_STRING_free(sig); |
142 | memset(s,0,(unsigned int)siglen); | 142 | OPENSSL_cleanse(s,(unsigned int)siglen); |
143 | OPENSSL_free(s); | 143 | OPENSSL_free(s); |
144 | return(ret); | 144 | return(ret); |
145 | } | 145 | } |