Change to mitigate branch prediction attacks
Submitted by: Matthew D Wood Reviewed by: Bodo Moeller
This commit is contained in:
@@ -107,7 +107,7 @@ static int dsa_builtin_keygen(DSA *dsa)
|
||||
{
|
||||
BN_init(&local_prk);
|
||||
prk = &local_prk;
|
||||
BN_with_flags(prk, priv_key, BN_FLG_EXP_CONSTTIME);
|
||||
BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME);
|
||||
}
|
||||
else
|
||||
prk = priv_key;
|
||||
|
||||
@@ -238,7 +238,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
|
||||
while (BN_is_zero(&k));
|
||||
if ((dsa->flags & DSA_FLAG_NO_EXP_CONSTTIME) == 0)
|
||||
{
|
||||
BN_set_flags(&k, BN_FLG_EXP_CONSTTIME);
|
||||
BN_set_flags(&k, BN_FLG_CONSTTIME);
|
||||
}
|
||||
|
||||
if (dsa->flags & DSA_FLAG_CACHE_MONT_P)
|
||||
|
||||
Reference in New Issue
Block a user