From: Niels Möller Date: Wed, 9 Oct 2002 19:34:36 +0000 (+0200) Subject: * testsuite/testutils.c (test_dsa): Needs both public and private X-Git-Tag: nettle_1.7_release_20030311~265 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16404e0a903ac1b1e00ab0efa014197c170bfabc;p=thirdparty%2Fnettle.git * testsuite/testutils.c (test_dsa): Needs both public and private key as arguments. Rev: src/nettle/testsuite/testutils.c:1.15 Rev: src/nettle/testsuite/testutils.h:1.13 --- diff --git a/testsuite/testutils.c b/testsuite/testutils.c index 8b96771f..87cec2ff 100644 --- a/testsuite/testutils.c +++ b/testsuite/testutils.c @@ -457,7 +457,8 @@ test_rsa_key(struct rsa_public_key *pub, ) void -test_dsa(struct dsa_private_key *key) +test_dsa(const struct dsa_public_key *pub, + const struct dsa_private_key *key) { struct sha1_ctx sha1; struct dsa_signature signature; @@ -468,7 +469,7 @@ test_dsa(struct dsa_private_key *key) knuth_lfib_init(&lfib, 1111); sha1_update(&sha1, LDATA("The magic words are squeamish ossifrage")); - dsa_sign(key, + dsa_sign(pub, key, &lfib, (nettle_random_func) knuth_lfib_random, &sha1, &signature); @@ -487,19 +488,19 @@ test_dsa(struct dsa_private_key *key) #endif /* Try bad data */ - if (DSA_VERIFY(&key->pub, &sha1, + if (DSA_VERIFY(pub, &sha1, "The magick words are squeamish ossifrage", &signature)) FAIL(); /* Try correct data */ - if (!DSA_VERIFY(&key->pub, &sha1, + if (!DSA_VERIFY(pub, &sha1, "The magic words are squeamish ossifrage", &signature)) FAIL(); /* Try bad signature */ mpz_togglebit(signature.r, 17); - if (DSA_VERIFY(&key->pub, &sha1, + if (DSA_VERIFY(pub, &sha1, "The magic words are squeamish ossifrage", &signature)) FAIL(); diff --git a/testsuite/testutils.h b/testsuite/testutils.h index 1bd50549..8defa091 100644 --- a/testsuite/testutils.h +++ b/testsuite/testutils.h @@ -88,7 +88,8 @@ test_rsa_key(struct rsa_public_key *pub, struct rsa_private_key *key); void -test_dsa(struct dsa_private_key *key); +test_dsa(const struct dsa_public_key *pub, + const struct dsa_private_key *key); #endif /* WITH_PUBLIC_KEY */