summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2022-01-05 20:36:29 +0000
committertb <>2022-01-05 20:36:29 +0000
commit76b5548b5c75a505052a7c87be2ee3251ccbda0f (patch)
tree81089aed6e4a488c115780ea22874cd47099e2ab /src/lib
parent96a387aa79534030b5f4e06cefb74062f01c4f87 (diff)
downloadopenbsd-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.h5
-rw-r--r--src/lib/libcrypto/dh/dh_lib.c8
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);
209void DH_clear_flags(DH *dh, int flags); 209void DH_clear_flags(DH *dh, int flags);
210int DH_test_flags(const DH *dh, int flags); 210int DH_test_flags(const DH *dh, int flags);
211void DH_set_flags(DH *dh, int flags); 211void DH_set_flags(DH *dh, int flags);
212#if defined(LIBRESSL_OPAQUE_DH) || defined(LIBRESSL_CRYPTO_INTERNAL)
213long DH_get_length(const DH *dh);
214#endif
212int DH_set_length(DH *dh, long length); 215int 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
358long
359DH_get_length(const DH *dh)
360{
361 return dh->length;
362}
363
358int 364int
359DH_set_length(DH *dh, long length) 365DH_set_length(DH *dh, long length)
360{ 366{