From d30e5e15f9a3c998b56789b616020f1019eefbfb Mon Sep 17 00:00:00 2001 From: tb <> Date: Tue, 20 Feb 2018 17:59:31 +0000 Subject: Provide DH_bits() ok jsing --- src/lib/libcrypto/Symbols.list | 1 + src/lib/libcrypto/dh/dh.h | 3 ++- src/lib/libcrypto/dh/dh_lib.c | 8 +++++++- 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src/lib') 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 DES_string_to_key DES_xcbc_encrypt DH_OpenSSL +DH_bits DH_check DH_check_pub_key DH_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 @@ -/* $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/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 @@ -/* $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) { -- cgit v1.2.3-55-g6feb