summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/dh/dh_lib.c
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2018-02-20 18:01:42 +0000
committertb <tb@openbsd.org>2018-02-20 18:01:42 +0000
commit57addcd0b71c631a06928fd0b33117f9d0c597fa (patch)
tree67abbc8fe08d54511964e3d1228bef3eb898b9fc /lib/libcrypto/dh/dh_lib.c
parentProvide DH_bits() (diff)
downloadwireguard-openbsd-57addcd0b71c631a06928fd0b33117f9d0c597fa.tar.xz
wireguard-openbsd-57addcd0b71c631a06928fd0b33117f9d0c597fa.zip
Provide DH_set_length()
ok jsing
Diffstat (limited to 'lib/libcrypto/dh/dh_lib.c')
-rw-r--r--lib/libcrypto/dh/dh_lib.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/libcrypto/dh/dh_lib.c b/lib/libcrypto/dh/dh_lib.c
index ade6ace4871..856d32c1b60 100644
--- a/lib/libcrypto/dh/dh_lib.c
+++ b/lib/libcrypto/dh/dh_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dh_lib.c,v 1.27 2018/02/20 17:59:31 tb Exp $ */
+/* $OpenBSD: dh_lib.c,v 1.28 2018/02/20 18:01:42 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#include <limits.h>
#include <stdio.h>
#include <openssl/opensslconf.h>
@@ -324,3 +325,11 @@ DH_set_flags(DH *dh, int flags)
{
dh->flags |= flags;
}
+
+int
+DH_set_length(DH *dh, long length)
+{
+ if (length < 0 || length > INT_MAX)
+ dh->length = length;
+ return 1;
+}