From 72ac982306be9c9ad5f355dba725ab3d0716879e Mon Sep 17 00:00:00 2001 From: Ismo Puustinen Date: Fri, 18 Sep 2015 16:07:23 -0400 Subject: [PATCH] GH367: use random data if seed too short. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Rich Salz Reviewed-by: Emilia Käsper (cherry picked from commit 6f997dc36504d67d1339ceb6bce4ecba673d8568) --- crypto/dsa/dsa_gen.c | 2 +- doc/crypto/DSA_generate_parameters.pod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c index d686ab0af7..defa4994b6 100644 --- a/crypto/dsa/dsa_gen.c +++ b/crypto/dsa/dsa_gen.c @@ -201,7 +201,7 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, if (!BN_GENCB_call(cb, 0, m++)) goto err; - if (!seed_len) { + if (!seed_len || !seed_in) { if (RAND_pseudo_bytes(seed, qsize) < 0) goto err; seed_is_random = 1; diff --git a/doc/crypto/DSA_generate_parameters.pod b/doc/crypto/DSA_generate_parameters.pod index be7c924ff8..f24c9c7d44 100644 --- a/doc/crypto/DSA_generate_parameters.pod +++ b/doc/crypto/DSA_generate_parameters.pod @@ -23,7 +23,7 @@ maximum of 1024 bits. If B is B or B E 20, the primes will be generated at random. Otherwise, the seed is used to generate them. If the given seed does not yield a prime q, a new random -seed is chosen and placed at B. +seed is chosen. DSA_generate_parameters() places the iteration count in *B and a counter used for finding a generator in -- 2.25.1