Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 1 | From 7ff4eba20b5c4fc7365e5ee0dfb775ed29bdd5ce Mon Sep 17 00:00:00 2001 |
| 2 | From: Kai Kang <kai.kang@windriver.com> |
| 3 | Date: Wed, 1 Nov 2017 09:23:41 -0400 |
| 4 | Subject: [PATCH] stunnel: fix compile error when openssl disable des support |
| 5 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 6 | Upstream-Status: Pending |
| 7 | |
| 8 | When openssl disable des support with configure option 'no-des', it doesn't |
| 9 | provide des related header file and functions. That causes stunnel compile |
| 10 | failed. Fix it by checking macro OPENSSL_NO_DES to use openssl des related |
| 11 | library conditionaly. |
| 12 | |
| 13 | Signed-off-by: Kai Kang <kai.kang@windriver.com> |
| 14 | --- |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 15 | src/common.h | 2 ++ |
| 16 | src/protocol.c | 6 +++--- |
| 17 | 2 files changed, 5 insertions(+), 3 deletions(-) |
| 18 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 19 | diff --git a/src/common.h b/src/common.h |
Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame] | 20 | index 2b4869f..180d31a 100644 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 21 | --- a/src/common.h |
| 22 | +++ b/src/common.h |
Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame] | 23 | @@ -492,7 +492,9 @@ extern char *sys_errlist[]; |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 24 | #ifndef OPENSSL_NO_MD4 |
| 25 | #include <openssl/md4.h> |
| 26 | #endif /* !defined(OPENSSL_NO_MD4) */ |
| 27 | +#ifndef OPENSSL_NO_DES |
| 28 | #include <openssl/des.h> |
| 29 | +#endif |
| 30 | #ifndef OPENSSL_NO_DH |
| 31 | #include <openssl/dh.h> |
| 32 | #if OPENSSL_VERSION_NUMBER<0x10100000L |
| 33 | diff --git a/src/protocol.c b/src/protocol.c |
Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame] | 34 | index cfe6d3b..3936aea 100644 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 35 | --- a/src/protocol.c |
| 36 | +++ b/src/protocol.c |
Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame] | 37 | @@ -81,7 +81,7 @@ NOEXPORT void ldap_client_middle(CLI *); |
| 38 | |
| 39 | NOEXPORT void connect_server_early(CLI *); |
| 40 | NOEXPORT void connect_client_middle(CLI *); |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 41 | -#ifndef OPENSSL_NO_MD4 |
| 42 | +#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES) |
Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame] | 43 | NOEXPORT void ntlm(CLI *); |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 44 | NOEXPORT char *ntlm1(void); |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 45 | NOEXPORT char *ntlm3(char *, char *, char *, char *); |
Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame] | 46 | @@ -1331,7 +1331,7 @@ NOEXPORT void connect_client_middle(CLI *c) { |
| 47 | fd_printf(c, c->remote_fd.fd, "Host: %s", c->opt->protocol_host); |
| 48 | if(c->opt->protocol_username && c->opt->protocol_password) { |
| 49 | if(!strcasecmp(c->opt->protocol_authentication, "ntlm")) { |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 50 | -#ifndef OPENSSL_NO_MD4 |
| 51 | +#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES) |
Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame] | 52 | ntlm(c); |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 53 | #else |
| 54 | s_log(LOG_ERR, "NTLM authentication is not available"); |
Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame] | 55 | @@ -1374,7 +1374,7 @@ NOEXPORT void connect_client_middle(CLI *c) { |
| 56 | str_free(line); |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | -#ifndef OPENSSL_NO_MD4 |
| 60 | +#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES) |
| 61 | |
| 62 | /* |
| 63 | * NTLM code is based on the following documentation: |
Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame] | 64 | -- |
| 65 | 2.34.1 |
| 66 | |