summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2018-02-20 17:59:31 +0000
committertb <tb@openbsd.org>2018-02-20 17:59:31 +0000
commita108d6e6ea6fc9da7b3b6c55fff679aaf5f45019 (patch)
tree40b8096de1ee424eef2ff24ead9d71b13d420b0d
parentProvide BIO_{g,s}et_shutdown(). (diff)
downloadwireguard-openbsd-a108d6e6ea6fc9da7b3b6c55fff679aaf5f45019.tar.xz
wireguard-openbsd-a108d6e6ea6fc9da7b3b6c55fff679aaf5f45019.zip
Provide DH_bits()
ok jsing
-rw-r--r--lib/libcrypto/Symbols.list1
-rw-r--r--lib/libcrypto/dh/dh.h3
-rw-r--r--lib/libcrypto/dh/dh_lib.c8
3 files changed, 10 insertions, 2 deletions
diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list
index f1c7f71fcb8..d13279d3fc0 100644
--- a/lib/libcrypto/Symbols.list
+++ b/lib/libcrypto/Symbols.list
@@ -755,6 +755,7 @@ DES_string_to_2keys
DES_string_to_key
DES_xcbc_encrypt
DH_OpenSSL
+DH_bits
DH_check
DH_check_pub_key
DH_clear_flags
diff --git a/lib/libcrypto/dh/dh.h b/lib/libcrypto/dh/dh.h
index 39e8d093e56..8e31d7542e7 100644
--- a/lib/libcrypto/dh/dh.h
+++ b/lib/libcrypto/dh/dh.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dh.h,v 1.22 2018/02/20 17:38:15 tb Exp $ */
+/* $OpenBSD: dh.h,v 1.23 2018/02/20 17:59:31 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -183,6 +183,7 @@ DH * DH_new(void);
void DH_free(DH *dh);
int DH_up_ref(DH *dh);
int DH_size(const DH *dh);
+int DH_bits(const DH *dh);
int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
int DH_set_ex_data(DH *d, int idx, void *arg);
diff --git a/lib/libcrypto/dh/dh_lib.c b/lib/libcrypto/dh/dh_lib.c
index e5e8b9146b9..ade6ace4871 100644
--- a/lib/libcrypto/dh/dh_lib.c
+++ b/lib/libcrypto/dh/dh_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dh_lib.c,v 1.26 2018/02/20 17:38:15 tb Exp $ */
+/* $OpenBSD: dh_lib.c,v 1.27 2018/02/20 17:59:31 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -240,6 +240,12 @@ DH_size(const DH *dh)
return BN_num_bytes(dh->p);
}
+int
+DH_bits(const DH *dh)
+{
+ return BN_num_bits(dh->p);
+}
+
void
DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g)
{