diff options
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; |
