summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-04-17 05:51:17 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-04-17 05:51:17 +0000
commit13e5b62550085e93596eec5cc130f45d294a6326 (patch)
tree08c0971a902496cee6c4e58f9fc538710f93e4c3 /lib
parentaaf44a07eaeb672ea419b074e85f1560f843f832 (diff)
Move DHparam_print_fp() next to DHparam_print()
As usual with the fp suffix, the former wraps the latter with a file BIO. There is no reason for this function to be in a separate file.
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/dh/dh_ameth.c18
-rw-r--r--lib/libcrypto/dh/dh_prn.c17
2 files changed, 18 insertions, 17 deletions
diff --git a/lib/libcrypto/dh/dh_ameth.c b/lib/libcrypto/dh/dh_ameth.c
index a0bcf8a761e..f1e15762a1e 100644
--- a/lib/libcrypto/dh/dh_ameth.c
+++ b/lib/libcrypto/dh/dh_ameth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dh_ameth.c,v 1.26 2022/12/26 07:18:51 jmc Exp $ */
+/* $OpenBSD: dh_ameth.c,v 1.27 2023/04/17 05:51:16 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006.
*/
@@ -474,6 +474,22 @@ DHparams_print(BIO *bp, const DH *x)
return do_dh_print(bp, x, 4, NULL, 0);
}
+int
+DHparams_print_fp(FILE *fp, const DH *x)
+{
+ BIO *b;
+ int ret;
+
+ if ((b = BIO_new(BIO_s_file())) == NULL) {
+ DHerror(ERR_R_BUF_LIB);
+ return 0;
+ }
+ BIO_set_fp(b,fp,BIO_NOCLOSE);
+ ret = DHparams_print(b, x);
+ BIO_free(b);
+ return ret;
+}
+
static int
dh_pkey_public_check(const EVP_PKEY *pkey)
{
diff --git a/lib/libcrypto/dh/dh_prn.c b/lib/libcrypto/dh/dh_prn.c
index 56a96f86314..2c6d17938b6 100644
--- a/lib/libcrypto/dh/dh_prn.c
+++ b/lib/libcrypto/dh/dh_prn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dh_prn.c,v 1.6 2017/01/29 17:49:22 beck Exp $ */
+/* $OpenBSD: dh_prn.c,v 1.7 2023/04/17 05:51:16 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -62,18 +62,3 @@
#include <openssl/err.h>
#include <openssl/evp.h>
-int
-DHparams_print_fp(FILE *fp, const DH *x)
-{
- BIO *b;
- int ret;
-
- if ((b = BIO_new(BIO_s_file())) == NULL) {
- DHerror(ERR_R_BUF_LIB);
- return 0;
- }
- BIO_set_fp(b,fp,BIO_NOCLOSE);
- ret = DHparams_print(b, x);
- BIO_free(b);
- return ret;
-}