diff --git a/testsuite/testutils.c b/testsuite/testutils.c index 8b96771faf0b3f60ee777d39b7eb1efdc909c1db..87cec2ffc84e05fe67899c315e0c9dec716302d5 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 1bd50549d88c85505768b3a36e1e51ba5401c4c8..8defa091087925bba67116ba1300be4fd4e5ac87 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 */