aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/rsa
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2015-09-03 09:15:26 -0400
committerRich Salz <rsalz@openssl.org>2015-09-03 16:26:34 -0400
commit64b25758edca688a30f02c260262150f7ad0bc7d (patch)
tree15ad5a8c7985e2b27aaf7a14737fd980a36349dd /crypto/rsa
parentfb4844bbc62fb014c115cd8fd2fc4304cba6eb89 (diff)
downloadopenssl-64b25758edca688a30f02c260262150f7ad0bc7d.tar.gz
remove 0 assignments.
After openssl_zalloc, cleanup more "set to 0/NULL" assignments. Many are from github feedback. Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/rsa')
-rw-r--r--crypto/rsa/rsa_lib.c18
-rw-r--r--crypto/rsa/rsa_pmeth.c11
2 files changed, 2 insertions, 27 deletions
diff --git a/crypto/rsa/rsa_lib.c b/crypto/rsa/rsa_lib.c
index f62fd73147..c64dad45db 100644
--- a/crypto/rsa/rsa_lib.c
+++ b/crypto/rsa/rsa_lib.c
@@ -125,7 +125,7 @@ RSA *RSA_new_method(ENGINE *engine)
{
RSA *ret;
- ret = OPENSSL_malloc(sizeof(*ret));
+ ret = OPENSSL_zalloc(sizeof(*ret));
if (ret == NULL) {
RSAerr(RSA_F_RSA_NEW_METHOD, ERR_R_MALLOC_FAILURE);
return NULL;
@@ -153,23 +153,7 @@ RSA *RSA_new_method(ENGINE *engine)
}
#endif
- ret->pad = 0;
- ret->version = 0;
- ret->n = NULL;
- ret->e = NULL;
- ret->d = NULL;
- ret->p = NULL;
- ret->q = NULL;
- ret->dmp1 = NULL;
- ret->dmq1 = NULL;
- ret->iqmp = NULL;
ret->references = 1;
- ret->_method_mod_n = NULL;
- ret->_method_mod_p = NULL;
- ret->_method_mod_q = NULL;
- ret->blinding = NULL;
- ret->mt_blinding = NULL;
- ret->bignum_data = NULL;
ret->flags = ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW;
if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data)) {
#ifndef OPENSSL_NO_ENGINE
diff --git a/crypto/rsa/rsa_pmeth.c b/crypto/rsa/rsa_pmeth.c
index ac83de3683..dd7b7dd557 100644
--- a/crypto/rsa/rsa_pmeth.c
+++ b/crypto/rsa/rsa_pmeth.c
@@ -97,21 +97,12 @@ typedef struct {
static int pkey_rsa_init(EVP_PKEY_CTX *ctx)
{
RSA_PKEY_CTX *rctx;
- rctx = OPENSSL_malloc(sizeof(*rctx));
+ rctx = OPENSSL_zalloc(sizeof(*rctx));
if (!rctx)
return 0;
rctx->nbits = 1024;
- rctx->pub_exp = NULL;
rctx->pad_mode = RSA_PKCS1_PADDING;
- rctx->md = NULL;
- rctx->mgf1md = NULL;
- rctx->tbuf = NULL;
-
rctx->saltlen = -2;
-
- rctx->oaep_label = NULL;
- rctx->oaep_labellen = 0;
-
ctx->data = rctx;
ctx->keygen_info = rctx->gentmp;
ctx->keygen_info_count = 2;