blob: aeb0bece971fa9432184736a3429d1b93ddf5df6 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001Upstream-Status: Pending
2
3When openssl disable des support with configure option 'no-des', it doesn't
4provide des related header file and functions. That causes stunnel compile
5failed. Fix it by checking macro OPENSSL_NO_DES to use openssl des related
6library conditionaly.
7
8Signed-off-by: Kai Kang <kai.kang@windriver.com>
9---
10diff --git a/src/common.h b/src/common.h
11index f7d38b0..bf485af 100644
12--- a/src/common.h
13+++ b/src/common.h
Andrew Geisslere34f8962021-04-15 15:53:51 -050014@@ -478,7 +478,9 @@ extern char *sys_errlist[];
Brad Bishopd7bf8c12018-02-25 22:55:05 -050015 #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
24diff --git a/src/protocol.c b/src/protocol.c
25index 587df09..8198eb6 100644
26--- a/src/protocol.c
27+++ b/src/protocol.c
Andrew Geisslere34f8962021-04-15 15:53:51 -050028@@ -67,7 +67,7 @@ NOEXPORT char *imap_server(CLI *, SERVICE_OPTIONS *, const PHASE);
29 NOEXPORT char *ldap_client(CLI *, SERVICE_OPTIONS *, const PHASE);
Brad Bishopd7bf8c12018-02-25 22:55:05 -050030 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 Geisslere34f8962021-04-15 15:53:51 -050037@@ -1332,7 +1332,7 @@ NOEXPORT char *connect_client(CLI *c, SERVICE_OPTIONS *opt, const PHASE phase) {
Brad Bishopd7bf8c12018-02-25 22:55:05 -050038 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 Geisslere34f8962021-04-15 15:53:51 -050046@@ -1376,7 +1376,7 @@ NOEXPORT char *connect_client(CLI *c, SERVICE_OPTIONS *opt, const PHASE phase) {
Brad Bishopd7bf8c12018-02-25 22:55:05 -050047 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: