summaryrefslogtreecommitdiff
blob: b14de58433aa1452f2186317982eb5a6b7e4bac4 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
From 7a281b1131399f04627986e6f9a54499b08e239d Mon Sep 17 00:00:00 2001
From: Felix Janda <felix.janda@posteo.de>
Date: Thu, 21 Apr 2016 23:12:10 +0200
Subject: [PATCH] Make openssl SSLv2 and SSLv3 support optional

Fixes compilation with libressl
---
 uim/openssl.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/uim/openssl.c b/uim/openssl.c
index ba1b238..35ca1ca 100644
--- a/uim/openssl.c
+++ b/uim/openssl.c
@@ -208,34 +208,64 @@ c_SSL_write(uim_lisp s_, uim_lisp buf_)
 static uim_lisp
 c_SSLv2_method(void)
 {
+#ifndef OPENSSL_NO_SSL2
   return MAKE_PTR(SSLv2_method());
+#else
+  uim_notify_fatal(N_("uim-openssl: SSLv2_method() is not supported on this system"));
+  return uim_scm_f();
+#endif
 }
 static uim_lisp
 c_SSLv2_server_method(void)
 {
+#ifndef OPENSSL_NO_SSL2
   return MAKE_PTR(SSLv2_server_method());
+#else
+  uim_notify_fatal(N_("uim-openssl: SSLv2_server_method() is not supported on this system"));
+  return uim_scm_f();
+#endif
 }
 static uim_lisp
 c_SSLv2_client_method(void)
 {
+#ifndef OPENSSL_NO_SSL2
   return MAKE_PTR(SSLv2_client_method());
+#else
+  uim_notify_fatal(N_("uim-openssl: SSLv2_client_method() is not supported on this system"));
+  return uim_scm_f();
+#endif
 }
 
 /* SSLv3 */
 static uim_lisp
 c_SSLv3_method(void)
 {
+#ifndef OPENSSL_NO_SSL3
   return MAKE_PTR(SSLv3_method());
+#else
+  uim_notify_fatal(N_("uim-openssl: SSLv3_method() is not supported on this system"));
+  return uim_scm_f();
+#endif
 }
 static uim_lisp
 c_SSLv3_server_method(void)
 {
+#ifndef OPENSSL_NO_SSL3
   return MAKE_PTR(SSLv3_server_method());
+#else
+  uim_notify_fatal(N_("uim-openssl: SSLv3_server_method() is not supported on this system"));
+  return uim_scm_f();
+#endif
 }
 static uim_lisp
 c_SSLv3_client_method(void)
 {
+#ifndef OPENSSL_NO_SSL3
   return MAKE_PTR(SSLv3_client_method());
+#else
+  uim_notify_fatal(N_("uim-openssl: SSLv3_client_method() is not supported on this system"));
+  return uim_scm_f();
+#endif
 }
 
 /* SSLv3 but can rollback to v2 */