From: Dr. Stephen Henson Date: Mon, 7 Mar 2016 17:31:00 +0000 (+0000) Subject: Remove kinv/r fields from DSA structure. X-Git-Tag: OpenSSL_1_1_0-pre4~266 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e1d9f1ab39eeab0c3c2b9415e0aaaa8c05858f77;p=oweals%2Fopenssl.git Remove kinv/r fields from DSA structure. The kinv/r fields in the DSA structure are not used by OpenSSL internally and should not be used in general. Reviewed-by: Rich Salz --- diff --git a/crypto/dsa/dsa_lib.c b/crypto/dsa/dsa_lib.c index f89297313a..f7795b27bd 100644 --- a/crypto/dsa/dsa_lib.c +++ b/crypto/dsa/dsa_lib.c @@ -180,8 +180,6 @@ void DSA_free(DSA *r) BN_clear_free(r->g); BN_clear_free(r->pub_key); BN_clear_free(r->priv_key); - BN_clear_free(r->kinv); - BN_clear_free(r->r); OPENSSL_free(r); } diff --git a/crypto/dsa/dsa_ossl.c b/crypto/dsa/dsa_ossl.c index cbc1e41bb9..0874e89141 100644 --- a/crypto/dsa/dsa_ossl.c +++ b/crypto/dsa/dsa_ossl.c @@ -158,16 +158,8 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) if (ctx == NULL) goto err; redo: - if ((dsa->kinv == NULL) || (dsa->r == NULL)) { - if (!dsa_sign_setup(dsa, ctx, &kinv, &r, dgst, dlen)) - goto err; - } else { - kinv = dsa->kinv; - dsa->kinv = NULL; - r = dsa->r; - dsa->r = NULL; - noredo = 1; - } + if (!dsa_sign_setup(dsa, ctx, &kinv, &r, dgst, dlen)) + goto err; if (dlen > BN_num_bytes(dsa->q)) /* diff --git a/include/openssl/dsa.h b/include/openssl/dsa.h index 643fee4731..a338eaedca 100644 --- a/include/openssl/dsa.h +++ b/include/openssl/dsa.h @@ -164,8 +164,6 @@ struct dsa_st { BIGNUM *g; BIGNUM *pub_key; /* y public key */ BIGNUM *priv_key; /* x private key */ - BIGNUM *kinv; /* Signing pre-calc */ - BIGNUM *r; /* Signing pre-calc */ int flags; /* Normally used to cache montgomery values */ BN_MONT_CTX *method_mont_p;