diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2016-11-08 19:22:09 +0100 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-11-08 17:48:38 -0500 |
commit | daa67522e0d33deadf6ac130ebe08805bb78c3a3 (patch) | |
tree | 26915b39e64931f53402c258621abbff11fe1e16 | |
parent | 1bb02559e39cf53ef74656b1965771befcece36a (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)
(cherry picked from commit 318447bceb3aa2c50ac0081bdb4e917f8704e7da)
-rw-r--r-- | crypto/bn/bn_recp.c | 6 |
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); } |