summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_recp.c
diff options
context:
space:
mode:
authorFdaSilvaYY <fdasilvayy@gmail.com>2016-11-08 19:22:09 +0100
committerRich Salz <rsalz@openssl.org>2016-11-08 17:44:32 -0500
commit318447bceb3aa2c50ac0081bdb4e917f8704e7da (patch)
tree01e99dd252a912868ad6efa4d563c00d84b44883 /crypto/bn/bn_recp.c
parente5e71f2857275189577ab7b227608ab4ec985471 (diff)
Missing BN_RECP_CTX field init.
BN_RECP_CTX_new direclty use bn_init to avoid twice memset calls Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1879)
Diffstat (limited to 'crypto/bn/bn_recp.c')
-rw-r--r--crypto/bn/bn_recp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/bn/bn_recp.c b/crypto/bn/bn_recp.c
index e532b6e668..20585b9d4b 100644
--- a/crypto/bn/bn_recp.c
+++ b/crypto/bn/bn_recp.c
@@ -12,10 +12,9 @@
void BN_RECP_CTX_init(BN_RECP_CTX *recp)
{
+ memset(recp, 0, sizeof(*recp));
bn_init(&(recp->N));
bn_init(&(recp->Nr));
- recp->num_bits = 0;
- recp->flags = 0;
}
BN_RECP_CTX *BN_RECP_CTX_new(void)
@@ -25,7 +24,8 @@ BN_RECP_CTX *BN_RECP_CTX_new(void)
if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
return (NULL);
- BN_RECP_CTX_init(ret);
+ bn_init(&(ret->N));
+ bn_init(&(ret->Nr));
ret->flags = BN_FLG_MALLOCED;
return (ret);
}