diff options
| author | tb <> | 2018-02-20 18:01:42 +0000 |
|---|---|---|
| committer | tb <> | 2018-02-20 18:01:42 +0000 |
| commit | d6f857847da13bf66a33e009fdcf59034786be48 (patch) | |
| tree | bdef8812546fe7d01dbcaa4d1153354a8c8e45ec /src/lib/libc | |
| parent | 3008e5796a289ec1f7ab89d4e388f70529e951c2 (diff) | |
| download | openbsd-d6f857847da13bf66a33e009fdcf59034786be48.tar.gz openbsd-d6f857847da13bf66a33e009fdcf59034786be48.tar.bz2 openbsd-d6f857847da13bf66a33e009fdcf59034786be48.zip | |
Provide DH_set_length()
ok jsing
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/Symbols.list | 1 | ||||
| -rw-r--r-- | src/lib/libcrypto/dh/dh.h | 3 | ||||
| -rw-r--r-- | src/lib/libcrypto/dh/dh_lib.c | 11 |
3 files changed, 13 insertions, 2 deletions
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 | |||
| 776 | DH_set_default_method | 776 | DH_set_default_method |
| 777 | DH_set_ex_data | 777 | DH_set_ex_data |
| 778 | DH_set_flags | 778 | DH_set_flags |
| 779 | DH_set_length | ||
| 779 | DH_set_method | 780 | DH_set_method |
| 780 | DH_size | 781 | DH_size |
| 781 | DH_test_flags | 782 | 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 @@ | |||
| 1 | /* $OpenBSD: dh.h,v 1.23 2018/02/20 17:59:31 tb Exp $ */ | 1 | /* $OpenBSD: dh.h,v 1.24 2018/02/20 18:01:42 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 | * |
| @@ -197,6 +197,7 @@ int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key); | |||
| 197 | void DH_clear_flags(DH *dh, int flags); | 197 | void DH_clear_flags(DH *dh, int flags); |
| 198 | int DH_test_flags(const DH *dh, int flags); | 198 | int DH_test_flags(const DH *dh, int flags); |
| 199 | void DH_set_flags(DH *dh, int flags); | 199 | void DH_set_flags(DH *dh, int flags); |
| 200 | int DH_set_length(DH *dh, long length); | ||
| 200 | 201 | ||
| 201 | /* Deprecated version */ | 202 | /* Deprecated version */ |
| 202 | #ifndef OPENSSL_NO_DEPRECATED | 203 | #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 @@ | |||
| 1 | /* $OpenBSD: dh_lib.c,v 1.27 2018/02/20 17:59:31 tb Exp $ */ | 1 | /* $OpenBSD: dh_lib.c,v 1.28 2018/02/20 18:01:42 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 | * |
| @@ -56,6 +56,7 @@ | |||
| 56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | #include <limits.h> | ||
| 59 | #include <stdio.h> | 60 | #include <stdio.h> |
| 60 | 61 | ||
| 61 | #include <openssl/opensslconf.h> | 62 | #include <openssl/opensslconf.h> |
| @@ -324,3 +325,11 @@ DH_set_flags(DH *dh, int flags) | |||
| 324 | { | 325 | { |
| 325 | dh->flags |= flags; | 326 | dh->flags |= flags; |
| 326 | } | 327 | } |
| 328 | |||
| 329 | int | ||
| 330 | DH_set_length(DH *dh, long length) | ||
| 331 | { | ||
| 332 | if (length < 0 || length > INT_MAX) | ||
| 333 | dh->length = length; | ||
| 334 | return 1; | ||
| 335 | } | ||
