summaryrefslogtreecommitdiff
path: root/crypto/rsa/rsa_sign.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-04-30 17:57:32 -0400
committerRich Salz <rsalz@openssl.org>2015-04-30 17:57:32 -0400
commit4b45c6e52b208deff7da333d1c7f84bcd3986609 (patch)
treedb26f7a51ad582f203dce2145a43c3e0d4376f69 /crypto/rsa/rsa_sign.c
parent68dc682499ea3fe27d909c946d7abd39062d6efd (diff)
downloadopenssl-new-4b45c6e52b208deff7da333d1c7f84bcd3986609.tar.gz
free cleanup almost the finale
Add OPENSSL_clear_free which merges cleanse and free. (Names was picked to be similar to BN_clear_free, etc.) Removed OPENSSL_freeFunc macro. Fixed the small simple ones that are left: CRYPTO_free CRYPTO_free_locked OPENSSL_free_locked Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/rsa/rsa_sign.c')
-rw-r--r--crypto/rsa/rsa_sign.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/crypto/rsa/rsa_sign.c b/crypto/rsa/rsa_sign.c
index 3b2ba569a6..69657978eb 100644
--- a/crypto/rsa/rsa_sign.c
+++ b/crypto/rsa/rsa_sign.c
@@ -131,10 +131,8 @@ int RSA_sign(int type, const unsigned char *m, unsigned int m_len,
else
*siglen = i;
- if (type != NID_md5_sha1) {
- OPENSSL_cleanse(tmps, (unsigned int)j + 1);
- OPENSSL_free(tmps);
- }
+ if (type != NID_md5_sha1)
+ OPENSSL_clear_free(tmps, (unsigned int)j + 1);
return (ret);
}
@@ -153,8 +151,7 @@ static int rsa_check_digestinfo(X509_SIG *sig, const unsigned char *dinfo,
return 0;
if (derlen == dinfolen && !memcmp(dinfo, der, derlen))
ret = 1;
- OPENSSL_cleanse(der, derlen);
- OPENSSL_free(der);
+ OPENSSL_clear_free(der, derlen);
return ret;
}
@@ -267,10 +264,7 @@ int int_rsa_verify(int dtype, const unsigned char *m,
}
err:
X509_SIG_free(sig);
- if (s != NULL) {
- OPENSSL_cleanse(s, (unsigned int)siglen);
- OPENSSL_free(s);
- }
+ OPENSSL_clear_free(s, (unsigned int)siglen);
return (ret);
}