diff options
author | tb <> | 2018-02-20 17:59:31 +0000 |
---|---|---|
committer | tb <> | 2018-02-20 17:59:31 +0000 |
commit | d30e5e15f9a3c998b56789b616020f1019eefbfb (patch) | |
tree | a5c11f63c8d4a75df6399e07bcf260c097db4998 | |
parent | 93b4c9ceb476b480a4ee81b5b43b72ba3b1810c3 (diff) | |
download | openbsd-d30e5e15f9a3c998b56789b616020f1019eefbfb.tar.gz openbsd-d30e5e15f9a3c998b56789b616020f1019eefbfb.tar.bz2 openbsd-d30e5e15f9a3c998b56789b616020f1019eefbfb.zip |
Provide DH_bits()
ok jsing
-rw-r--r-- | src/lib/libcrypto/Symbols.list | 1 | ||||
-rw-r--r-- | src/lib/libcrypto/dh/dh.h | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/dh/dh_lib.c | 8 |
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 | |||
755 | DES_string_to_key | 755 | DES_string_to_key |
756 | DES_xcbc_encrypt | 756 | DES_xcbc_encrypt |
757 | DH_OpenSSL | 757 | DH_OpenSSL |
758 | DH_bits | ||
758 | DH_check | 759 | DH_check |
759 | DH_check_pub_key | 760 | DH_check_pub_key |
760 | DH_clear_flags | 761 | 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 @@ | |||
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); | |||
183 | void DH_free(DH *dh); | 183 | void DH_free(DH *dh); |
184 | int DH_up_ref(DH *dh); | 184 | int DH_up_ref(DH *dh); |
185 | int DH_size(const DH *dh); | 185 | int DH_size(const DH *dh); |
186 | int DH_bits(const DH *dh); | ||
186 | int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | 187 | int 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); |
188 | int DH_set_ex_data(DH *d, int idx, void *arg); | 189 | 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 @@ | |||
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 | ||
243 | int | ||
244 | DH_bits(const DH *dh) | ||
245 | { | ||
246 | return BN_num_bits(dh->p); | ||
247 | } | ||
248 | |||
243 | void | 249 | void |
244 | DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) | 250 | DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) |
245 | { | 251 | { |