Move DSA_generate_parameters() from dsa_depr.c to dsa_gen.c
authortb <tb@openbsd.org>
Thu, 13 Apr 2023 14:58:27 +0000 (14:58 +0000)
committertb <tb@openbsd.org>
Thu, 13 Apr 2023 14:58:27 +0000 (14:58 +0000)
Discussed with jsing

lib/libcrypto/dsa/dsa_depr.c
lib/libcrypto/dsa/dsa_gen.c

index b3f7ec0..98a377e 100644 (file)
@@ -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.
  *
 
 #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
index 49b4561..4a16278 100644 (file)
@@ -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