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> |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame^] | 14 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 15 | --- |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame^] | 16 | src/common.h | 2 ++ |
| 17 | src/protocol.c | 6 +++--- |
| 18 | 2 files changed, 5 insertions(+), 3 deletions(-) |
| 19 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 20 | diff --git a/src/common.h b/src/common.h |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame^] | 21 | index bc37eb5..03ee3e5 100644 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 22 | --- a/src/common.h |
| 23 | +++ b/src/common.h |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame^] | 24 | @@ -486,7 +486,9 @@ extern char *sys_errlist[]; |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 25 | #ifndef OPENSSL_NO_MD4 |
| 26 | #include <openssl/md4.h> |
| 27 | #endif /* !defined(OPENSSL_NO_MD4) */ |
| 28 | +#ifndef OPENSSL_NO_DES |
| 29 | #include <openssl/des.h> |
| 30 | +#endif |
| 31 | #ifndef OPENSSL_NO_DH |
| 32 | #include <openssl/dh.h> |
| 33 | #if OPENSSL_VERSION_NUMBER<0x10100000L |
| 34 | diff --git a/src/protocol.c b/src/protocol.c |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame^] | 35 | index 804f115..d9b2b50 100644 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 36 | --- a/src/protocol.c |
| 37 | +++ b/src/protocol.c |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame^] | 38 | @@ -66,7 +66,7 @@ NOEXPORT char *nntp_client(CLI *, SERVICE_OPTIONS *, const PHASE); |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 39 | NOEXPORT char *ldap_client(CLI *, SERVICE_OPTIONS *, const PHASE); |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 40 | NOEXPORT char *connect_server(CLI *, SERVICE_OPTIONS *, const PHASE); |
| 41 | NOEXPORT char *connect_client(CLI *, SERVICE_OPTIONS *, const PHASE); |
| 42 | -#ifndef OPENSSL_NO_MD4 |
| 43 | +#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES) |
| 44 | NOEXPORT void ntlm(CLI *, SERVICE_OPTIONS *); |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame^] | 45 | NOEXPORT char *ntlm1(void); |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 46 | NOEXPORT char *ntlm3(char *, char *, char *, char *); |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame^] | 47 | @@ -1351,7 +1351,7 @@ NOEXPORT char *connect_client(CLI *c, SERVICE_OPTIONS *opt, const PHASE phase) { |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 48 | fd_printf(c, c->remote_fd.fd, "Host: %s", opt->protocol_host); |
| 49 | if(opt->protocol_username && opt->protocol_password) { |
| 50 | if(!strcasecmp(opt->protocol_authentication, "ntlm")) { |
| 51 | -#ifndef OPENSSL_NO_MD4 |
| 52 | +#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES) |
| 53 | ntlm(c, opt); |
| 54 | #else |
| 55 | s_log(LOG_ERR, "NTLM authentication is not available"); |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame^] | 56 | @@ -1395,7 +1395,7 @@ NOEXPORT char *connect_client(CLI *c, SERVICE_OPTIONS *opt, const PHASE phase) { |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 57 | return NULL; |
| 58 | } |
| 59 | |
| 60 | -#ifndef OPENSSL_NO_MD4 |
| 61 | +#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES) |
| 62 | |
| 63 | /* |
| 64 | * NTLM code is based on the following documentation: |