diff options
author | 2018-11-09 23:45:19 +0000 | |
---|---|---|
committer | 2018-11-09 23:45:19 +0000 | |
commit | c541982e7d1e46f9bbb862ce74a1970baa585f87 (patch) | |
tree | 06aaf3e42506ba4bfd4444699b0a07ebce664a7d /lib/libcrypto/dsa/dsa_key.c | |
parent | The Botan library from ports an be configured to use OpenSSL or (diff) | |
download | wireguard-openbsd-c541982e7d1e46f9bbb862ce74a1970baa585f87.tar.xz wireguard-openbsd-c541982e7d1e46f9bbb862ce74a1970baa585f87.zip |
Initialize priv_key and pub_key on first use instead of at the top.
ok beck jsing mestre
Diffstat (limited to 'lib/libcrypto/dsa/dsa_key.c')
-rw-r--r-- | lib/libcrypto/dsa/dsa_key.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libcrypto/dsa/dsa_key.c b/lib/libcrypto/dsa/dsa_key.c index 54c6550feff..a0487e98b8c 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.28 2018/11/06 07:02:33 tb Exp $ */ +/* $OpenBSD: dsa_key.c,v 1.29 2018/11/09 23:45:19 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -82,12 +82,12 @@ dsa_builtin_keygen(DSA *dsa) { int ok = 0; BN_CTX *ctx = NULL; - BIGNUM *pub_key = dsa->pub_key, *priv_key = dsa->priv_key; + BIGNUM *pub_key = NULL, *priv_key = NULL; if ((ctx = BN_CTX_new()) == NULL) goto err; - if (priv_key == NULL) { + if ((priv_key = dsa->priv_key) == NULL) { if ((priv_key = BN_new()) == NULL) goto err; } @@ -95,7 +95,7 @@ dsa_builtin_keygen(DSA *dsa) if (!bn_rand_interval(priv_key, BN_value_one(), dsa->q)) goto err; - if (pub_key == NULL) { + if ((pub_key = dsa->pub_key) == NULL) { if ((pub_key = BN_new()) == NULL) goto err; } |