From e40939b2141306238cc30a340b867b60fa4dc2a3 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 18 Mar 2016 15:11:31 +0100 Subject: dsa: Make regression tests work. * cipher/dsa.c (sample_secret_key_1024): Comment out unused constant. (ogenerate_fips186): Make it work with use-fips183-2 flag. * cipher/primegen.c (_gcry_generate_fips186_3_prime): Use Emacs standard comment out format. * tests/fips186-dsa.c (check_dsa_gen_186_3): New dummy fucntion. (main): Call it. (main): Compare against current version. * tests/pubkey.c (get_dsa_key_fips186_new): Create 2048 bit key. (get_dsa_key_fips186_with_seed_new): Ditto. (get_dsa_key_fips186_with_domain_new): Comment out. (check_run): Do not call that function. -- Signed-off-by: Werner Koch --- tests/pubkey.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'tests/pubkey.c') diff --git a/tests/pubkey.c b/tests/pubkey.c index ae5eea2d..26bd9e3a 100644 --- a/tests/pubkey.c +++ b/tests/pubkey.c @@ -490,7 +490,7 @@ get_dsa_key_fips186_new (gcry_sexp_t *pkey, gcry_sexp_t *skey) int rc; rc = gcry_sexp_new - (&key_spec, "(genkey (dsa (nbits 4:1024)(use-fips186)))", 0, 1); + (&key_spec, "(genkey (dsa (nbits 4:2048)(use-fips186)))", 0, 1); if (rc) die ("error creating S-expression: %s\n", gcry_strerror (rc)); rc = gcry_pk_genkey (&key, key_spec); @@ -557,6 +557,7 @@ get_dsa_key_with_domain_new (gcry_sexp_t *pkey, gcry_sexp_t *skey) *skey = sec_key; } +#if 0 static void get_dsa_key_fips186_with_domain_new (gcry_sexp_t *pkey, gcry_sexp_t *skey) { @@ -598,7 +599,7 @@ get_dsa_key_fips186_with_domain_new (gcry_sexp_t *pkey, gcry_sexp_t *skey) *pkey = pub_key; *skey = sec_key; } - +#endif /*0*/ static void get_dsa_key_fips186_with_seed_new (gcry_sexp_t *pkey, gcry_sexp_t *skey) @@ -610,7 +611,7 @@ get_dsa_key_fips186_with_seed_new (gcry_sexp_t *pkey, gcry_sexp_t *skey) (&key_spec, "(genkey" " (dsa" - " (nbits 4:1024)" + " (nbits 4:2048)" " (use-fips186)" " (transient-key)" " (derive-parms" @@ -722,12 +723,14 @@ check_run (void) gcry_sexp_release (pkey); gcry_sexp_release (skey); + /* We need new test vectors for get_dsa_key_fips186_with_domain_new. */ if (verbose) - fprintf (stderr, "Generating DSA key with given domain (FIPS 186).\n"); - get_dsa_key_fips186_with_domain_new (&pkey, &skey); - /* Fixme: Add a check function for DSA keys. */ - gcry_sexp_release (pkey); - gcry_sexp_release (skey); + fprintf (stderr, "Generating DSA key with given domain (FIPS 186)" + " - skipped.\n"); + /* get_dsa_key_fips186_with_domain_new (&pkey, &skey); */ + /* /\* Fixme: Add a check function for DSA keys. *\/ */ + /* gcry_sexp_release (pkey); */ + /* gcry_sexp_release (skey); */ if (verbose) fprintf (stderr, "Generating DSA key with given seed (FIPS 186).\n"); -- cgit v1.2.1