From f38e0f193e7bb5faea955cd4afea248b830afa18 Mon Sep 17 00:00:00 2001 From: bcook <> Date: Thu, 30 Jun 2016 02:02:06 +0000 Subject: Remove flags for disabling constant-time operations. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This removes support for DSA_FLAG_NO_EXP_CONSTTIME, DH_FLAG_NO_EXP_CONSTTIME, and RSA_FLAG_NO_CONSTTIME flags, making all of these operations unconditionally constant-time. Based on the original patch by César Pereid. ok beck@ --- src/lib/libcrypto/dsa/dsa_key.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/lib/libcrypto/dsa/dsa_key.c') diff --git a/src/lib/libcrypto/dsa/dsa_key.c b/src/lib/libcrypto/dsa/dsa_key.c index 4732c471ed..fc4eb9c433 100644 --- a/src/lib/libcrypto/dsa/dsa_key.c +++ b/src/lib/libcrypto/dsa/dsa_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsa_key.c,v 1.21 2016/06/21 04:16:53 bcook Exp $ */ +/* $OpenBSD: dsa_key.c,v 1.22 2016/06/30 02:02:06 bcook Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -104,18 +104,12 @@ dsa_builtin_keygen(DSA *dsa) pub_key=dsa->pub_key; { - BIGNUM *prk = BN_new(); + BIGNUM prk; - if (prk == NULL) - goto err; - - BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME); + BN_with_flags(&prk, priv_key, BN_FLG_CONSTTIME); - if (!BN_mod_exp(pub_key, dsa->g, prk, dsa->p, ctx)) { - BN_free(prk); + if (!BN_mod_exp(pub_key, dsa->g, &prk, dsa->p, ctx)) goto err; - } - BN_free(prk); } dsa->priv_key = priv_key; -- cgit v1.2.3-55-g6feb