summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2018-02-20 17:59:31 +0000
committertb <>2018-02-20 17:59:31 +0000
commitd30e5e15f9a3c998b56789b616020f1019eefbfb (patch)
treea5c11f63c8d4a75df6399e07bcf260c097db4998
parent93b4c9ceb476b480a4ee81b5b43b72ba3b1810c3 (diff)
downloadopenbsd-d30e5e15f9a3c998b56789b616020f1019eefbfb.tar.gz
openbsd-d30e5e15f9a3c998b56789b616020f1019eefbfb.tar.bz2
openbsd-d30e5e15f9a3c998b56789b616020f1019eefbfb.zip
Provide DH_bits()
ok jsing
-rw-r--r--src/lib/libcrypto/Symbols.list1
-rw-r--r--src/lib/libcrypto/dh/dh.h3
-rw-r--r--src/lib/libcrypto/dh/dh_lib.c8
3 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list
index f1c7f71fcb..d13279d3fc 100644
--- a/src/lib/libcrypto/Symbols.list
+++ b/src/lib/libcrypto/Symbols.list
@@ -755,6 +755,7 @@ DES_string_to_2keys
755DES_string_to_key 755DES_string_to_key
756DES_xcbc_encrypt 756DES_xcbc_encrypt
757DH_OpenSSL 757DH_OpenSSL
758DH_bits
758DH_check 759DH_check
759DH_check_pub_key 760DH_check_pub_key
760DH_clear_flags 761DH_clear_flags
diff --git a/src/lib/libcrypto/dh/dh.h b/src/lib/libcrypto/dh/dh.h
index 39e8d093e5..8e31d7542e 100644
--- a/src/lib/libcrypto/dh/dh.h
+++ b/src/lib/libcrypto/dh/dh.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh.h,v 1.22 2018/02/20 17:38:15 tb Exp $ */ 1/* $OpenBSD: dh.h,v 1.23 2018/02/20 17:59:31 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -183,6 +183,7 @@ DH * DH_new(void);
183void DH_free(DH *dh); 183void DH_free(DH *dh);
184int DH_up_ref(DH *dh); 184int DH_up_ref(DH *dh);
185int DH_size(const DH *dh); 185int DH_size(const DH *dh);
186int DH_bits(const DH *dh);
186int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 187int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
187 CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); 188 CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
188int DH_set_ex_data(DH *d, int idx, void *arg); 189int DH_set_ex_data(DH *d, int idx, void *arg);
diff --git a/src/lib/libcrypto/dh/dh_lib.c b/src/lib/libcrypto/dh/dh_lib.c
index e5e8b9146b..ade6ace487 100644
--- a/src/lib/libcrypto/dh/dh_lib.c
+++ b/src/lib/libcrypto/dh/dh_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_lib.c,v 1.26 2018/02/20 17:38:15 tb Exp $ */ 1/* $OpenBSD: dh_lib.c,v 1.27 2018/02/20 17:59:31 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -240,6 +240,12 @@ DH_size(const DH *dh)
240 return BN_num_bytes(dh->p); 240 return BN_num_bytes(dh->p);
241} 241}
242 242
243int
244DH_bits(const DH *dh)
245{
246 return BN_num_bits(dh->p);
247}
248
243void 249void
244DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) 250DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g)
245{ 251{