aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/stunnel/stunnel/fix-openssl-no-des.patch
blob: aeb0bece971fa9432184736a3429d1b93ddf5df6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Upstream-Status: Pending

When openssl disable des support with configure option 'no-des', it doesn't
provide des related header file and functions. That causes stunnel compile
failed. Fix it by checking macro OPENSSL_NO_DES to use openssl des related
library conditionaly.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
diff --git a/src/common.h b/src/common.h
index f7d38b0..bf485af 100644
--- a/src/common.h
+++ b/src/common.h
@@ -478,7 +478,9 @@ extern char *sys_errlist[];
 #ifndef OPENSSL_NO_MD4
 #include <openssl/md4.h>
 #endif /* !defined(OPENSSL_NO_MD4) */
+#ifndef OPENSSL_NO_DES
 #include <openssl/des.h>
+#endif
 #ifndef OPENSSL_NO_DH
 #include <openssl/dh.h>
 #if OPENSSL_VERSION_NUMBER<0x10100000L
diff --git a/src/protocol.c b/src/protocol.c
index 587df09..8198eb6 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -67,7 +67,7 @@ NOEXPORT char *imap_server(CLI *, SERVICE_OPTIONS *, const PHASE);
 NOEXPORT char *ldap_client(CLI *, SERVICE_OPTIONS *, const PHASE);
 NOEXPORT char *connect_server(CLI *, SERVICE_OPTIONS *, const PHASE);
 NOEXPORT char *connect_client(CLI *, SERVICE_OPTIONS *, const PHASE);
-#ifndef OPENSSL_NO_MD4
+#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES)
 NOEXPORT void ntlm(CLI *, SERVICE_OPTIONS *);
 NOEXPORT char *ntlm1();
 NOEXPORT char *ntlm3(char *, char *, char *, char *);
@@ -1332,7 +1332,7 @@ NOEXPORT char *connect_client(CLI *c, SERVICE_OPTIONS *opt, const PHASE phase) {
     fd_printf(c, c->remote_fd.fd, "Host: %s", opt->protocol_host);
     if(opt->protocol_username && opt->protocol_password) {
         if(!strcasecmp(opt->protocol_authentication, "ntlm")) {
-#ifndef OPENSSL_NO_MD4
+#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES)
             ntlm(c, opt);
 #else
             s_log(LOG_ERR, "NTLM authentication is not available");
@@ -1376,7 +1376,7 @@ NOEXPORT char *connect_client(CLI *c, SERVICE_OPTIONS *opt, const PHASE phase) {
     return NULL;
 }
 
-#ifndef OPENSSL_NO_MD4
+#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES)
 
 /*
  * NTLM code is based on the following documentation: