diff options
author | 2016-06-30 02:02:06 +0000 | |
---|---|---|
committer | 2016-06-30 02:02:06 +0000 | |
commit | 1b2bbd6a2be0d8567d09a347b008777f6f415bc7 (patch) | |
tree | f898e27b29c52ec722c83757f2cab72f231455d8 /lib/libcrypto/dsa/dsa_key.c | |
parent | If /tmp/vi.recover doesn't exist, don't create it. Warn once (diff) | |
download | wireguard-openbsd-1b2bbd6a2be0d8567d09a347b008777f6f415bc7.tar.xz wireguard-openbsd-1b2bbd6a2be0d8567d09a347b008777f6f415bc7.zip |
Remove flags for disabling constant-time operations.
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@
Diffstat (limited to 'lib/libcrypto/dsa/dsa_key.c')
-rw-r--r-- | lib/libcrypto/dsa/dsa_key.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/libcrypto/dsa/dsa_key.c b/lib/libcrypto/dsa/dsa_key.c index 4732c471eda..fc4eb9c4331 100644 --- a/lib/libcrypto/dsa/dsa_key.c +++ b/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; |