From: Samuel Weiser Date: Fri, 29 Sep 2017 11:29:25 +0000 (+0200) Subject: Added const-time flag to DSA key decoding to avoid potential leak of privkey X-Git-Tag: OpenSSL_1_0_2m~21 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f9cbf470180841966338db1f4c28d99ec4debec4;p=oweals%2Fopenssl.git Added const-time flag to DSA key decoding to avoid potential leak of privkey Reviewed-by: Richard Levitte Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/4440) (cherry picked from commit 6364475a990449ef33fc270ac00472f7210220f2) --- diff --git a/crypto/dsa/dsa_ameth.c b/crypto/dsa/dsa_ameth.c index c4fa105747..aac2530951 100644 --- a/crypto/dsa/dsa_ameth.c +++ b/crypto/dsa/dsa_ameth.c @@ -258,6 +258,7 @@ static int dsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8) goto dsaerr; } + BN_set_flags(dsa->priv_key, BN_FLG_CONSTTIME); if (!BN_mod_exp(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, ctx)) { DSAerr(DSA_F_DSA_PRIV_DECODE, DSA_R_BN_ERROR); goto dsaerr;