From 16404e0a903ac1b1e00ab0efa014197c170bfabc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se> Date: Wed, 9 Oct 2002 21:34:36 +0200 Subject: [PATCH] * 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 --- testsuite/testutils.c | 11 ++++++----- testsuite/testutils.h | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) 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 */ -- GitLab