From c165b7b2a30149b7d809a27732c8419dc010f1f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Fri, 28 Mar 2014 18:42:15 +0100
Subject: [PATCH] Undo dsa-compat.h name mangling for testsuite.

---
 ChangeLog                   | 4 ++++
 testsuite/dsa-keygen-test.c | 6 +++---
 testsuite/testutils.h       | 6 ++++++
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b069d630..887d4791 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2014-03-28  Niels Möller  <nisse@lysator.liu.se>
 
+	* testsuite/dsa-keygen-test.c (test_main): Explicitly use
+	dsa_compat_generate_keypair.
+	* testsuite/testutils.h: Undo dsa-compat.h name mangling.
+
 	* dsa-keygen.c (dsa_generate_keypair): New interface, generating
 	only a keypair, and no new parameters.
 	* dsa-compat-keygen.c (dsa_compat_generate_keypair): New file.
diff --git a/testsuite/dsa-keygen-test.c b/testsuite/dsa-keygen-test.c
index 87b30f99..25757c95 100644
--- a/testsuite/dsa-keygen-test.c
+++ b/testsuite/dsa-keygen-test.c
@@ -23,7 +23,7 @@ test_main(void)
   knuth_lfib_init(&lfib, 13);
 
   params = (struct dsa_params *) &pub;
-  ASSERT (dsa_generate_keypair(&pub, &key,
+  ASSERT (dsa_compat_generate_keypair(&pub, &key,
 			       &lfib,
 			       (nettle_random_func *) knuth_lfib_random,
 			       NULL, verbose ? progress : NULL,
@@ -32,7 +32,7 @@ test_main(void)
   test_dsa_key(params, pub.y, key.x, 160);
   test_dsa160(&pub, &key, NULL);
 
-  ASSERT (dsa_generate_keypair(&pub, &key,
+  ASSERT (dsa_compat_generate_keypair(&pub, &key,
 			       &lfib,
 			       (nettle_random_func *) knuth_lfib_random,
 			       NULL, verbose ? progress : NULL,
@@ -41,7 +41,7 @@ test_main(void)
   test_dsa_key(params, pub.y, key.x, 256);
   test_dsa256(&pub, &key, NULL);
   
-  ASSERT (dsa_generate_keypair(&pub, &key,
+  ASSERT (dsa_compat_generate_keypair(&pub, &key,
 			       &lfib,
 			       (nettle_random_func *) knuth_lfib_random,
 			       NULL, verbose ? progress : NULL,
diff --git a/testsuite/testutils.h b/testsuite/testutils.h
index 7b079833..3e9f20d8 100644
--- a/testsuite/testutils.h
+++ b/testsuite/testutils.h
@@ -24,6 +24,10 @@
 # include "ecc-internal.h"
 # include "ecdsa.h"
 # include "gmp-glue.h"
+
+/* Undo some dsa-compat name mangling */
+#undef dsa_generate_keypair
+#define dsa_generate_keypair nettle_dsa_generate_keypair
 #endif
 
 #include "nettle-meta.h"
@@ -198,11 +202,13 @@ test_dsa256(const struct dsa_public_key *pub,
 	    const struct dsa_private_key *key,
 	    const struct dsa_signature *expected);
 
+#if 0
 void
 test_dsa_sign(const struct dsa_public_key *pub,
 	      const struct dsa_private_key *key,
 	      const struct nettle_hash *hash,
 	      const struct dsa_signature *expected);
+#endif
 
 void
 test_dsa_verify(const struct dsa_params *params,
-- 
GitLab