Add functions returning security bits.
[openssl.git] / crypto / dsa / dsa_gen.c
index c013a7e..9e3e57a 100644 (file)
@@ -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: