From 444a1e2335883999b57e5f9b1f505b5915c2da3d Mon Sep 17 00:00:00 2001
From: tb <>
Date: Thu, 13 Apr 2023 14:58:27 +0000
Subject: Move DSA_generate_parameters() from dsa_depr.c to dsa_gen.c

Discussed with jsing
---
 src/lib/libcrypto/dsa/dsa_depr.c | 21 +--------------------
 src/lib/libcrypto/dsa/dsa_gen.c  | 23 ++++++++++++++++++++++-
 2 files changed, 23 insertions(+), 21 deletions(-)

(limited to 'src/lib')

diff --git a/src/lib/libcrypto/dsa/dsa_depr.c b/src/lib/libcrypto/dsa/dsa_depr.c
index b3f7ec0413..98a377e5b5 100644
--- a/src/lib/libcrypto/dsa/dsa_depr.c
+++ b/src/lib/libcrypto/dsa/dsa_depr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsa_depr.c,v 1.11 2023/04/09 19:10:23 tb Exp $ */
+/* $OpenBSD: dsa_depr.c,v 1.12 2023/04/13 14:58:27 tb Exp $ */
 /* ====================================================================
  * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
  *
@@ -70,23 +70,4 @@
 
 #include "bn_local.h"
 
-DSA *
-DSA_generate_parameters(int bits, unsigned char *seed_in, int seed_len,
-    int *counter_ret, unsigned long *h_ret, void (*callback)(int, int, void *),
-    void *cb_arg)
-{
-	BN_GENCB cb;
-	DSA *ret;
-
-	if ((ret = DSA_new()) == NULL)
-		return NULL;
-
-	BN_GENCB_set_old(&cb, callback, cb_arg);
-
-	if (DSA_generate_parameters_ex(ret, bits, seed_in, seed_len,
-	    counter_ret, h_ret, &cb))
-		return ret;
-	DSA_free(ret);
-	return NULL;
-}
 #endif
diff --git a/src/lib/libcrypto/dsa/dsa_gen.c b/src/lib/libcrypto/dsa/dsa_gen.c
index 49b4561494..4a16278b5a 100644
--- a/src/lib/libcrypto/dsa/dsa_gen.c
+++ b/src/lib/libcrypto/dsa/dsa_gen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsa_gen.c,v 1.28 2023/03/27 10:25:02 tb Exp $ */
+/* $OpenBSD: dsa_gen.c,v 1.29 2023/04/13 14:58:27 tb Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -355,4 +355,25 @@ err:
 
 	return ok;
 }
+
+DSA *
+DSA_generate_parameters(int bits, unsigned char *seed_in, int seed_len,
+    int *counter_ret, unsigned long *h_ret, void (*callback)(int, int, void *),
+    void *cb_arg)
+{
+	BN_GENCB cb;
+	DSA *ret;
+
+	if ((ret = DSA_new()) == NULL)
+		return NULL;
+
+	BN_GENCB_set_old(&cb, callback, cb_arg);
+
+	if (DSA_generate_parameters_ex(ret, bits, seed_in, seed_len,
+	    counter_ret, h_ret, &cb))
+		return ret;
+	DSA_free(ret);
+	return NULL;
+}
+
 #endif
-- 
cgit v1.2.3-55-g6feb