Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | Upstream-Status: Pending |
| 2 | |
| 3 | When openssl disable des support with configure option 'no-des', it doesn't |
| 4 | provide des related header file and functions. That causes stunnel compile |
| 5 | failed. Fix it by checking macro OPENSSL_NO_DES to use openssl des related |
| 6 | library conditionaly. |
| 7 | |
| 8 | Signed-off-by: Kai Kang <kai.kang@windriver.com> |
| 9 | --- |
| 10 | diff --git a/src/common.h b/src/common.h |
| 11 | index f7d38b0..bf485af 100644 |
| 12 | --- a/src/common.h |
| 13 | +++ b/src/common.h |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 14 | @@ -478,7 +478,9 @@ extern char *sys_errlist[]; |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 15 | #ifndef OPENSSL_NO_MD4 |
| 16 | #include <openssl/md4.h> |
| 17 | #endif /* !defined(OPENSSL_NO_MD4) */ |
| 18 | +#ifndef OPENSSL_NO_DES |
| 19 | #include <openssl/des.h> |
| 20 | +#endif |
| 21 | #ifndef OPENSSL_NO_DH |
| 22 | #include <openssl/dh.h> |
| 23 | #if OPENSSL_VERSION_NUMBER<0x10100000L |
| 24 | diff --git a/src/protocol.c b/src/protocol.c |
| 25 | index 587df09..8198eb6 100644 |
| 26 | --- a/src/protocol.c |
| 27 | +++ b/src/protocol.c |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 28 | @@ -67,7 +67,7 @@ NOEXPORT char *imap_server(CLI *, SERVICE_OPTIONS *, const PHASE); |
| 29 | NOEXPORT char *ldap_client(CLI *, SERVICE_OPTIONS *, const PHASE); |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 30 | NOEXPORT char *connect_server(CLI *, SERVICE_OPTIONS *, const PHASE); |
| 31 | NOEXPORT char *connect_client(CLI *, SERVICE_OPTIONS *, const PHASE); |
| 32 | -#ifndef OPENSSL_NO_MD4 |
| 33 | +#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES) |
| 34 | NOEXPORT void ntlm(CLI *, SERVICE_OPTIONS *); |
| 35 | NOEXPORT char *ntlm1(); |
| 36 | NOEXPORT char *ntlm3(char *, char *, char *, char *); |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 37 | @@ -1332,7 +1332,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] | 38 | fd_printf(c, c->remote_fd.fd, "Host: %s", opt->protocol_host); |
| 39 | if(opt->protocol_username && opt->protocol_password) { |
| 40 | if(!strcasecmp(opt->protocol_authentication, "ntlm")) { |
| 41 | -#ifndef OPENSSL_NO_MD4 |
| 42 | +#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES) |
| 43 | ntlm(c, opt); |
| 44 | #else |
| 45 | s_log(LOG_ERR, "NTLM authentication is not available"); |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 46 | @@ -1376,7 +1376,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] | 47 | return NULL; |
| 48 | } |
| 49 | |
| 50 | -#ifndef OPENSSL_NO_MD4 |
| 51 | +#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES) |
| 52 | |
| 53 | /* |
| 54 | * NTLM code is based on the following documentation: |