aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/stunnel/stunnel/fix-openssl-no-des.patch
blob: 82d35510199aaffda310b22da42f93d53162e7b9 (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
55
56
57
58
59
60
61
62
63
64
65
66
From 7ff4eba20b5c4fc7365e5ee0dfb775ed29bdd5ce Mon Sep 17 00:00:00 2001
From: Kai Kang <kai.kang@windriver.com>
Date: Wed, 1 Nov 2017 09:23:41 -0400
Subject: [PATCH] stunnel: fix compile error when openssl disable des support

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>
---
 src/common.h   | 2 ++
 src/protocol.c | 6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/common.h b/src/common.h
index 2b4869f..180d31a 100644
--- a/src/common.h
+++ b/src/common.h
@@ -492,7 +492,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 cfe6d3b..3936aea 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -81,7 +81,7 @@ NOEXPORT void ldap_client_middle(CLI *);
 
 NOEXPORT void connect_server_early(CLI *);
 NOEXPORT void connect_client_middle(CLI *);
-#ifndef OPENSSL_NO_MD4
+#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES)
 NOEXPORT void ntlm(CLI *);
 NOEXPORT char *ntlm1(void);
 NOEXPORT char *ntlm3(char *, char *, char *, char *);
@@ -1331,7 +1331,7 @@ NOEXPORT void connect_client_middle(CLI *c) {
     fd_printf(c, c->remote_fd.fd, "Host: %s", c->opt->protocol_host);
     if(c->opt->protocol_username && c->opt->protocol_password) {
         if(!strcasecmp(c->opt->protocol_authentication, "ntlm")) {
-#ifndef OPENSSL_NO_MD4
+#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES)
             ntlm(c);
 #else
             s_log(LOG_ERR, "NTLM authentication is not available");
@@ -1374,7 +1374,7 @@ NOEXPORT void connect_client_middle(CLI *c) {
     str_free(line);
 }
 
-#ifndef OPENSSL_NO_MD4
+#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES)
 
 /*
  * NTLM code is based on the following documentation:
-- 
2.34.1