diff options
author | Sebastian Andrzej Siewior <sebastian@breakpoint.cc> | 2016-10-03 17:54:06 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-11-14 08:56:09 -0500 |
commit | af5474126546b558b0e6f8be4bec4b70977e24b7 (patch) | |
tree | 8d042d5a56089fe5d7d1ec33ee44c1c991889e4d /crypto/dsa/dsa_gen.c | |
parent | 1fda5bc435ada1c70f2d3342bb9db98ac5840dc9 (diff) |
dsa/dsa_gen: add error message for seed_len < 0
prio openssl 1.1.0 seed_len < q was accepted and the seed argument was
then ignored. Now DSA_generate_parameters_ex() returns an error in such
a case but no error string.
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1657)
Diffstat (limited to 'crypto/dsa/dsa_gen.c')
-rw-r--r-- | crypto/dsa/dsa_gen.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c index 11f422e4b4..3efeab84fa 100644 --- a/crypto/dsa/dsa_gen.c +++ b/crypto/dsa/dsa_gen.c @@ -74,8 +74,10 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, bits = (bits + 63) / 64 * 64; if (seed_in != NULL) { - if (seed_len < (size_t)qsize) + if (seed_len < (size_t)qsize) { + DSAerr(DSA_F_DSA_BUILTIN_PARAMGEN, DSA_R_SEED_LEN_SMALL); return 0; + } if (seed_len > (size_t)qsize) { /* Only consume as much seed as is expected. */ seed_len = qsize; |