diff options
author | tb <> | 2018-02-20 17:38:15 +0000 |
---|---|---|
committer | tb <> | 2018-02-20 17:38:15 +0000 |
commit | dfa181abfd37625e8fcbe30907b6fd5f37c2df2d (patch) | |
tree | 41664251ed853390ab0c687663d1db137fe42b29 | |
parent | 4f1ee631944961365c3b2ee139bc108c1ceff2ed (diff) | |
download | openbsd-dfa181abfd37625e8fcbe30907b6fd5f37c2df2d.tar.gz openbsd-dfa181abfd37625e8fcbe30907b6fd5f37c2df2d.tar.bz2 openbsd-dfa181abfd37625e8fcbe30907b6fd5f37c2df2d.zip |
Provide DH_{clear,set,test}_flags().
ok jsing
-rw-r--r-- | src/lib/libcrypto/Symbols.list | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/dh/dh.h | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/dh/dh_lib.c | 20 |
3 files changed, 26 insertions, 2 deletions
diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list index 2252220278..5a5df4702b 100644 --- a/src/lib/libcrypto/Symbols.list +++ b/src/lib/libcrypto/Symbols.list | |||
@@ -755,6 +755,7 @@ DES_xcbc_encrypt | |||
755 | DH_OpenSSL | 755 | DH_OpenSSL |
756 | DH_check | 756 | DH_check |
757 | DH_check_pub_key | 757 | DH_check_pub_key |
758 | DH_clear_flags | ||
758 | DH_compute_key | 759 | DH_compute_key |
759 | DH_free | 760 | DH_free |
760 | DH_generate_key | 761 | DH_generate_key |
@@ -771,8 +772,10 @@ DH_set0_key | |||
771 | DH_set0_pqg | 772 | DH_set0_pqg |
772 | DH_set_default_method | 773 | DH_set_default_method |
773 | DH_set_ex_data | 774 | DH_set_ex_data |
775 | DH_set_flags | ||
774 | DH_set_method | 776 | DH_set_method |
775 | DH_size | 777 | DH_size |
778 | DH_test_flags | ||
776 | DH_up_ref | 779 | DH_up_ref |
777 | DHparams_dup | 780 | DHparams_dup |
778 | DHparams_it | 781 | DHparams_it |
diff --git a/src/lib/libcrypto/dh/dh.h b/src/lib/libcrypto/dh/dh.h index f1c51850eb..39e8d093e5 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.21 2018/02/18 14:58:12 tb Exp $ */ | 1 | /* $OpenBSD: dh.h,v 1.22 2018/02/20 17:38:15 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 | * |
@@ -193,6 +193,9 @@ void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, | |||
193 | int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g); | 193 | int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g); |
194 | void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key); | 194 | void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key); |
195 | int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key); | 195 | int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key); |
196 | void DH_clear_flags(DH *dh, int flags); | ||
197 | int DH_test_flags(const DH *dh, int flags); | ||
198 | void DH_set_flags(DH *dh, int flags); | ||
196 | 199 | ||
197 | /* Deprecated version */ | 200 | /* Deprecated version */ |
198 | #ifndef OPENSSL_NO_DEPRECATED | 201 | #ifndef OPENSSL_NO_DEPRECATED |
diff --git a/src/lib/libcrypto/dh/dh_lib.c b/src/lib/libcrypto/dh/dh_lib.c index bb2ca426a0..e5e8b9146b 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.25 2018/02/18 14:58:12 tb Exp $ */ | 1 | /* $OpenBSD: dh_lib.c,v 1.26 2018/02/20 17:38:15 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 | * |
@@ -300,3 +300,21 @@ DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) | |||
300 | 300 | ||
301 | return 1; | 301 | return 1; |
302 | } | 302 | } |
303 | |||
304 | void | ||
305 | DH_clear_flags(DH *dh, int flags) | ||
306 | { | ||
307 | dh->flags &= ~flags; | ||
308 | } | ||
309 | |||
310 | int | ||
311 | DH_test_flags(const DH *dh, int flags) | ||
312 | { | ||
313 | return dh->flags & flags; | ||
314 | } | ||
315 | |||
316 | void | ||
317 | DH_set_flags(DH *dh, int flags) | ||
318 | { | ||
319 | dh->flags |= flags; | ||
320 | } | ||