aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/rsa/rsa_eay.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_eay.c
parent68dc682499ea3fe27d909c946d7abd39062d6efd (diff)
downloadopenssl-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_eay.c')
-rw-r--r--crypto/rsa/rsa_eay.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/crypto/rsa/rsa_eay.c b/crypto/rsa/rsa_eay.c
index 73a8e07d35..49c157a842 100644
--- a/crypto/rsa/rsa_eay.c
+++ b/crypto/rsa/rsa_eay.c
@@ -243,10 +243,7 @@ static int RSA_eay_public_encrypt(int flen, const unsigned char *from,
BN_CTX_end(ctx);
BN_CTX_free(ctx);
}
- if (buf != NULL) {
- OPENSSL_cleanse(buf, num);
- OPENSSL_free(buf);
- }
+ OPENSSL_clear_free(buf, num);
return (r);
}
@@ -480,10 +477,7 @@ static int RSA_eay_private_encrypt(int flen, const unsigned char *from,
BN_CTX_end(ctx);
BN_CTX_free(ctx);
}
- if (buf != NULL) {
- OPENSSL_cleanse(buf, num);
- OPENSSL_free(buf);
- }
+ OPENSSL_clear_free(buf, num);
return (r);
}
@@ -622,10 +616,7 @@ static int RSA_eay_private_decrypt(int flen, const unsigned char *from,
BN_CTX_end(ctx);
BN_CTX_free(ctx);
}
- if (buf != NULL) {
- OPENSSL_cleanse(buf, num);
- OPENSSL_free(buf);
- }
+ OPENSSL_clear_free(buf, num);
return (r);
}
@@ -725,10 +716,7 @@ static int RSA_eay_public_decrypt(int flen, const unsigned char *from,
BN_CTX_end(ctx);
BN_CTX_free(ctx);
}
- if (buf != NULL) {
- OPENSSL_cleanse(buf, num);
- OPENSSL_free(buf);
- }
+ OPENSSL_clear_free(buf, num);
return (r);
}