X-Git-Url: https://git.openssl.org/?a=blobdiff_plain;f=crypto%2Fdsa%2Fdsa_gen.c;h=9e3e57a828599e24c4d088319672c9575292bb41;hb=ff49a944392985510c15f06a342af9d991b8f11f;hp=c013a7e660ea0d95a49af481118823c65a1707fb;hpb=03e389cf049e4bbc2f6d0028dc320fb0583aad2c;p=openssl.git diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c index c013a7e660..9e3e57a828 100644 --- a/crypto/dsa/dsa_gen.c +++ b/crypto/dsa/dsa_gen.c @@ -405,7 +405,7 @@ static int dsa2_valid_parameters(size_t L, size_t N) if (L == 2048 && N == 256) return 112; if (L == 3072 && N == 256) - return 112; + return 128; return 0; } @@ -666,7 +666,13 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N, /* "offset = offset + n + 1" */ /* step 14 */ - if (counter >= 4096) break; + if (counter >= (int)(4 * L)) break; + } + if (seed_in) + { + ok = 0; + DSAerr(DSA_F_DSA_BUILTIN_PARAMGEN2, DSA_R_INVALID_PARAMETERS); + goto err; } } end: