diff options
author | tb <> | 2022-01-05 20:36:29 +0000 |
---|---|---|
committer | tb <> | 2022-01-05 20:36:29 +0000 |
commit | 76b5548b5c75a505052a7c87be2ee3251ccbda0f (patch) | |
tree | 81089aed6e4a488c115780ea22874cd47099e2ab /src/lib | |
parent | 96a387aa79534030b5f4e06cefb74062f01c4f87 (diff) | |
download | openbsd-76b5548b5c75a505052a7c87be2ee3251ccbda0f.tar.gz openbsd-76b5548b5c75a505052a7c87be2ee3251ccbda0f.tar.bz2 openbsd-76b5548b5c75a505052a7c87be2ee3251ccbda0f.zip |
Prepare to provide DH_get_length()
Will be needed by openssl(1) dhparam.
ok inoguchi jsing
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/dh/dh.h | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/dh/dh_lib.c | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/libcrypto/dh/dh.h b/src/lib/libcrypto/dh/dh.h index 8e57c191c4..83ad67bebf 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.27 2022/01/05 20:30:16 tb Exp $ */ | 1 | /* $OpenBSD: dh.h,v 1.28 2022/01/05 20:36:29 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 | * |
@@ -209,6 +209,9 @@ const BIGNUM *DH_get0_pub_key(const DH *dh); | |||
209 | void DH_clear_flags(DH *dh, int flags); | 209 | void DH_clear_flags(DH *dh, int flags); |
210 | int DH_test_flags(const DH *dh, int flags); | 210 | int DH_test_flags(const DH *dh, int flags); |
211 | void DH_set_flags(DH *dh, int flags); | 211 | void DH_set_flags(DH *dh, int flags); |
212 | #if defined(LIBRESSL_OPAQUE_DH) || defined(LIBRESSL_CRYPTO_INTERNAL) | ||
213 | long DH_get_length(const DH *dh); | ||
214 | #endif | ||
212 | int DH_set_length(DH *dh, long length); | 215 | int DH_set_length(DH *dh, long length); |
213 | 216 | ||
214 | /* Deprecated version */ | 217 | /* Deprecated version */ |
diff --git a/src/lib/libcrypto/dh/dh_lib.c b/src/lib/libcrypto/dh/dh_lib.c index 58f01b6e6a..d331e7cd08 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.34 2022/01/05 20:30:16 tb Exp $ */ | 1 | /* $OpenBSD: dh_lib.c,v 1.35 2022/01/05 20:36:29 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 | * |
@@ -355,6 +355,12 @@ DH_set_flags(DH *dh, int flags) | |||
355 | dh->flags |= flags; | 355 | dh->flags |= flags; |
356 | } | 356 | } |
357 | 357 | ||
358 | long | ||
359 | DH_get_length(const DH *dh) | ||
360 | { | ||
361 | return dh->length; | ||
362 | } | ||
363 | |||
358 | int | 364 | int |
359 | DH_set_length(DH *dh, long length) | 365 | DH_set_length(DH *dh, long length) |
360 | { | 366 | { |