From accf1b94b3627d2ed5d78c6638d3d618404a8a2d Mon Sep 17 00:00:00 2001 From: tb <> Date: Tue, 20 Feb 2018 18:01:42 +0000 Subject: Provide DH_set_length() ok jsing --- src/lib/libcrypto/Symbols.list | 1 + src/lib/libcrypto/dh/dh.h | 3 ++- src/lib/libcrypto/dh/dh_lib.c | 11 ++++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/Symbols.list b/src/lib/libcrypto/Symbols.list index d13279d3fc..885d5fb111 100644 --- a/src/lib/libcrypto/Symbols.list +++ b/src/lib/libcrypto/Symbols.list @@ -776,6 +776,7 @@ DH_set0_pqg DH_set_default_method DH_set_ex_data DH_set_flags +DH_set_length DH_set_method DH_size DH_test_flags diff --git a/src/lib/libcrypto/dh/dh.h b/src/lib/libcrypto/dh/dh.h index 8e31d7542e..a5e686b21a 100644 --- a/src/lib/libcrypto/dh/dh.h +++ b/src/lib/libcrypto/dh/dh.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dh.h,v 1.23 2018/02/20 17:59:31 tb Exp $ */ +/* $OpenBSD: dh.h,v 1.24 2018/02/20 18:01:42 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -197,6 +197,7 @@ int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key); void DH_clear_flags(DH *dh, int flags); int DH_test_flags(const DH *dh, int flags); void DH_set_flags(DH *dh, int flags); +int DH_set_length(DH *dh, long length); /* Deprecated version */ #ifndef OPENSSL_NO_DEPRECATED diff --git a/src/lib/libcrypto/dh/dh_lib.c b/src/lib/libcrypto/dh/dh_lib.c index ade6ace487..856d32c1b6 100644 --- a/src/lib/libcrypto/dh/dh_lib.c +++ b/src/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 #include #include @@ -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; +} -- cgit v1.2.3-55-g6feb