diff options
| author | bcook <> | 2016-06-30 02:02:06 +0000 |
|---|---|---|
| committer | bcook <> | 2016-06-30 02:02:06 +0000 |
| commit | 3ce2fddbbb0fbded19721d5da476dfdfecb1e48b (patch) | |
| tree | 0ceecace65c38593a01c1d41cce469bd98529f43 /src/lib/libcrypto/dsa/dsa_key.c | |
| parent | eac403b2ae70a8e948d7db823d992cc131392d78 (diff) | |
| download | openbsd-3ce2fddbbb0fbded19721d5da476dfdfecb1e48b.tar.gz openbsd-3ce2fddbbb0fbded19721d5da476dfdfecb1e48b.tar.bz2 openbsd-3ce2fddbbb0fbded19721d5da476dfdfecb1e48b.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 'src/lib/libcrypto/dsa/dsa_key.c')
| -rw-r--r-- | src/lib/libcrypto/dsa/dsa_key.c | 14 |
1 files changed, 4 insertions, 10 deletions
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 @@ | |||
| 1 | /* $OpenBSD: dsa_key.c,v 1.21 2016/06/21 04:16:53 bcook Exp $ */ | 1 | /* $OpenBSD: dsa_key.c,v 1.22 2016/06/30 02:02:06 bcook Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -104,18 +104,12 @@ dsa_builtin_keygen(DSA *dsa) | |||
| 104 | pub_key=dsa->pub_key; | 104 | pub_key=dsa->pub_key; |
| 105 | 105 | ||
| 106 | { | 106 | { |
| 107 | BIGNUM *prk = BN_new(); | 107 | BIGNUM prk; |
| 108 | 108 | ||
| 109 | if (prk == NULL) | 109 | BN_with_flags(&prk, priv_key, BN_FLG_CONSTTIME); |
| 110 | goto err; | ||
| 111 | |||
| 112 | BN_with_flags(prk, priv_key, BN_FLG_CONSTTIME); | ||
| 113 | 110 | ||
| 114 | if (!BN_mod_exp(pub_key, dsa->g, prk, dsa->p, ctx)) { | 111 | if (!BN_mod_exp(pub_key, dsa->g, &prk, dsa->p, ctx)) |
| 115 | BN_free(prk); | ||
| 116 | goto err; | 112 | goto err; |
| 117 | } | ||
| 118 | BN_free(prk); | ||
| 119 | } | 113 | } |
| 120 | 114 | ||
| 121 | dsa->priv_key = priv_key; | 115 | dsa->priv_key = priv_key; |
