summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src/crypto/dsa/dsa_gen.c
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2015-07-15 16:32:29 +0000
committermiod <miod@openbsd.org>2015-07-15 16:32:29 +0000
commitd381a137462bc2e5fbc8bb09d7c87d01479df9c3 (patch)
tree0e8c4c8ec7f1d9fba8b71bd46e20e0a1cebf4595 /lib/libssl/src/crypto/dsa/dsa_gen.c
parentDescribe the behavior when no user is specified. OK jca@ deraadt@ (diff)
downloadwireguard-openbsd-d381a137462bc2e5fbc8bb09d7c87d01479df9c3.tar.xz
wireguard-openbsd-d381a137462bc2e5fbc8bb09d7c87d01479df9c3.zip
Previous fix for Coverity CID 21785 did not cope correctly with seed_len != 0,
seed_in == NULL case. Since this situation is an error anyway, bail out early. with and ok beck@
Diffstat (limited to 'lib/libssl/src/crypto/dsa/dsa_gen.c')
-rw-r--r--lib/libssl/src/crypto/dsa/dsa_gen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libssl/src/crypto/dsa/dsa_gen.c b/lib/libssl/src/crypto/dsa/dsa_gen.c
index 73ae4853493..342764397c7 100644
--- a/lib/libssl/src/crypto/dsa/dsa_gen.c
+++ b/lib/libssl/src/crypto/dsa/dsa_gen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsa_gen.c,v 1.20 2015/02/15 22:29:02 doug Exp $ */
+/* $OpenBSD: dsa_gen.c,v 1.21 2015/07/15 16:32:29 miod Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -138,6 +138,8 @@ dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, const EVP_MD *evpmd,
seed_len = qsize;
if (seed_in != NULL)
memcpy(seed, seed_in, seed_len);
+ else if (seed_len == 0)
+ goto err;
if ((mont=BN_MONT_CTX_new()) == NULL)
goto err;