Skip to content

Commit

Permalink
Added const-time flag to DSA key decoding to avoid potential leak of …
Browse files Browse the repository at this point in the history
…privkey

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from #4440)
  • Loading branch information
Samuel Weiser authored and Rich Salz committed Sep 29, 2017
1 parent 681acb3 commit 6364475
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crypto/dsa/dsa_ameth.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ static int dsa_priv_decode(EVP_PKEY *pkey, const 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;
Expand Down

0 comments on commit 6364475

Please sign in to comment.