提交 47ae05ba 编写于 作者: C Cesar Pereida 提交者: Matt Caswell

Set flag BN_FLG_CONSTTIME earlier

Reviewed-by: NRich Salz <rsalz@openssl.org>
Reviewed-by: NMatt Caswell <matt@openssl.org>
上级 033dc8fa
......@@ -167,6 +167,8 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in,
goto err;
} while (BN_is_zero(k));
BN_set_flags(k, BN_FLG_CONSTTIME);
if (dsa->flags & DSA_FLAG_CACHE_MONT_P) {
if (!BN_MONT_CTX_set_locked(&dsa->method_mont_p,
dsa->lock, dsa->p, ctx))
......@@ -189,8 +191,6 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in,
goto err;
}
BN_set_flags(k, BN_FLG_CONSTTIME);
if ((dsa)->meth->bn_mod_exp != NULL) {
if (!dsa->meth->bn_mod_exp(dsa, r, dsa->g, k, dsa->p, ctx,
dsa->method_mont_p))
......@@ -200,7 +200,6 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in,
goto err;
}
if (!BN_mod(r, r, dsa->q, ctx))
goto err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册