diff --git a/ChangeLog b/ChangeLog
index 92c70aaef427e08f78e883c959770f9943d86ba2..2c2d75f466c6cb48dc4c5830de8efc1bb1b048cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-03-25  Niels Möller  <nisse@lysator.liu.se>
 
+	* testsuite/dsa-keygen-test.c (test_main): Do dsa_param cast once,
+	and assign to variable.
+
 	* dsa.h: Deleted old interface (moved to dsa-compat.h).
 	(struct dsa_value): Deleted. Updated many files.
 
diff --git a/testsuite/dsa-keygen-test.c b/testsuite/dsa-keygen-test.c
index 6a4f6fc324ed0308938dded9d9238ee3f34c11b2..25757c95fb606606c1b466a38cb70f298cc0d05a 100644
--- a/testsuite/dsa-keygen-test.c
+++ b/testsuite/dsa-keygen-test.c
@@ -13,7 +13,8 @@ test_main(void)
 {
   struct dsa_public_key pub;
   struct dsa_private_key key;
-  
+  struct dsa_params *params;
+
   struct knuth_lfib_ctx lfib;
   
   dsa_private_key_init(&key);
@@ -21,13 +22,14 @@ test_main(void)
 
   knuth_lfib_init(&lfib, 13);
 
+  params = (struct dsa_params *) &pub;
   ASSERT (dsa_compat_generate_keypair(&pub, &key,
 			       &lfib,
 			       (nettle_random_func *) knuth_lfib_random,
 			       NULL, verbose ? progress : NULL,
 			       1024, 160));
 
-  test_dsa_key((const struct dsa_params *) &pub, pub.y, key.x, 160);
+  test_dsa_key(params, pub.y, key.x, 160);
   test_dsa160(&pub, &key, NULL);
 
   ASSERT (dsa_compat_generate_keypair(&pub, &key,
@@ -36,7 +38,7 @@ test_main(void)
 			       NULL, verbose ? progress : NULL,
 			       2048, 256));
 
-  test_dsa_key((const struct dsa_params *) &pub, pub.y, key.x, 256);
+  test_dsa_key(params, pub.y, key.x, 256);
   test_dsa256(&pub, &key, NULL);
   
   ASSERT (dsa_compat_generate_keypair(&pub, &key,
@@ -45,7 +47,7 @@ test_main(void)
 			       NULL, verbose ? progress : NULL,
 			       2048, 224));
 
-  test_dsa_key((const struct dsa_params *) &pub, pub.y, key.x, 224);
+  test_dsa_key(params, pub.y, key.x, 224);
   test_dsa256(&pub, &key, NULL);
   
   dsa_public_key_clear(&pub);