Lines 1-258
Link Here
|
1 |
--- spamc/libspamc.c.orig |
|
|
2 |
+++ spamc/libspamc.c |
3 |
@@ -1187,7 +1187,7 @@ int message_filter(struct transport *tp, |
4 |
unsigned int throwaway; |
5 |
SSL_CTX *ctx = NULL; |
6 |
SSL *ssl = NULL; |
7 |
- SSL_METHOD *meth; |
8 |
+ const SSL_METHOD *meth; |
9 |
char zlib_on = 0; |
10 |
unsigned char *zlib_buf = NULL; |
11 |
int zlib_bufsiz = 0; |
12 |
@@ -1213,11 +1213,7 @@ int message_filter(struct transport *tp, |
13 |
if (flags & SPAMC_USE_SSL) { |
14 |
#ifdef SPAMC_SSL |
15 |
SSLeay_add_ssl_algorithms(); |
16 |
- if (flags & SPAMC_TLSV1) { |
17 |
- meth = TLSv1_client_method(); |
18 |
- } else { |
19 |
- meth = SSLv3_client_method(); /* default */ |
20 |
- } |
21 |
+ meth = SSLv23_client_method(); |
22 |
SSL_load_error_strings(); |
23 |
ctx = SSL_CTX_new(meth); |
24 |
#else |
25 |
@@ -1596,7 +1592,7 @@ int message_tell(struct transport *tp, c |
26 |
int failureval; |
27 |
SSL_CTX *ctx = NULL; |
28 |
SSL *ssl = NULL; |
29 |
- SSL_METHOD *meth; |
30 |
+ const SSL_METHOD *meth; |
31 |
|
32 |
assert(tp != NULL); |
33 |
assert(m != NULL); |
34 |
@@ -1604,7 +1600,7 @@ int message_tell(struct transport *tp, c |
35 |
if (flags & SPAMC_USE_SSL) { |
36 |
#ifdef SPAMC_SSL |
37 |
SSLeay_add_ssl_algorithms(); |
38 |
- meth = SSLv3_client_method(); |
39 |
+ meth = SSLv23_client_method(); |
40 |
SSL_load_error_strings(); |
41 |
ctx = SSL_CTX_new(meth); |
42 |
#else |
43 |
--- spamc/spamc.c.orig |
44 |
+++ spamc/spamc.c |
45 |
@@ -368,16 +368,11 @@ read_args(int argc, char **argv, |
46 |
case 'S': |
47 |
{ |
48 |
flags |= SPAMC_USE_SSL; |
49 |
- if (!spamc_optarg || (strcmp(spamc_optarg,"sslv3") == 0)) { |
50 |
- flags |= SPAMC_SSLV3; |
51 |
- } |
52 |
- else if (strcmp(spamc_optarg,"tlsv1") == 0) { |
53 |
- flags |= SPAMC_TLSV1; |
54 |
- } |
55 |
- else { |
56 |
- libspamc_log(flags, LOG_ERR, "Please specify a legal ssl version (%s)", spamc_optarg); |
57 |
- ret = EX_USAGE; |
58 |
- } |
59 |
+ if(spamc_optarg) { |
60 |
+ libspamc_log(flags, LOG_ERR, |
61 |
+ "Explicit specification of an SSL/TLS version no longer supported."); |
62 |
+ ret = EX_USAGE; |
63 |
+ } |
64 |
break; |
65 |
} |
66 |
#endif |
67 |
--- spamd/spamd.raw.orig |
68 |
+++ spamd/spamd.raw |
69 |
@@ -409,7 +409,6 @@ GetOptions( |
70 |
'sql-config!' => \$opt{'sql-config'}, |
71 |
'ssl' => \$opt{'ssl'}, |
72 |
'ssl-port=s' => \$opt{'ssl-port'}, |
73 |
- 'ssl-version=s' => \$opt{'ssl-version'}, |
74 |
'syslog-socket=s' => \$opt{'syslog-socket'}, |
75 |
'syslog|s=s' => \$opt{'syslog'}, |
76 |
'log-timestamp-fmt:s' => \$opt{'log-timestamp-fmt'}, |
77 |
@@ -744,11 +743,6 @@ if ( defined $ENV{'HOME'} ) { |
78 |
|
79 |
# Do whitelist later in tmp dir. Side effect: this will be done as -u user. |
80 |
|
81 |
-my $sslversion = $opt{'ssl-version'} || 'sslv3'; |
82 |
-if ($sslversion !~ /^(?:sslv3|tlsv1)$/) { |
83 |
- die "spamd: invalid ssl-version: $opt{'ssl-version'}\n"; |
84 |
-} |
85 |
- |
86 |
$opt{'server-key'} ||= "$LOCAL_RULES_DIR/certs/server-key.pem"; |
87 |
$opt{'server-cert'} ||= "$LOCAL_RULES_DIR/certs/server-cert.pem"; |
88 |
|
89 |
@@ -899,9 +893,8 @@ sub compose_listen_info_string { |
90 |
$socket_info->{ip_addr}, $socket_info->{port})); |
91 |
|
92 |
} elsif ($socket->isa('IO::Socket::SSL')) { |
93 |
- push(@listeninfo, sprintf("SSL [%s]:%s, ssl version %s", |
94 |
- $socket_info->{ip_addr}, $socket_info->{port}, |
95 |
- $opt{'ssl-version'}||'sslv3')); |
96 |
+ push(@listeninfo, sprintf("SSL [%r]:%s", $socket_info->{ip_addr}, |
97 |
+ $socket_info->{port})); |
98 |
} |
99 |
} |
100 |
|
101 |
@@ -1072,7 +1065,6 @@ sub server_sock_setup_inet { |
102 |
$sockopt{V6Only} = 1 if $io_socket_module_name eq 'IO::Socket::IP' |
103 |
&& IO::Socket::IP->VERSION >= 0.09; |
104 |
%sockopt = (%sockopt, ( |
105 |
- SSL_version => $sslversion, |
106 |
SSL_verify_mode => 0x00, |
107 |
SSL_key_file => $opt{'server-key'}, |
108 |
SSL_cert_file => $opt{'server-cert'}, |
109 |
@@ -1093,7 +1085,8 @@ sub server_sock_setup_inet { |
110 |
if (!$server_inet) { |
111 |
$diag = sprintf("could not create %s socket on [%s]:%s: %s", |
112 |
$ssl ? 'IO::Socket::SSL' : $io_socket_module_name, |
113 |
- $adr, $port, $!); |
114 |
+ $adr, $port, $ssl && $IO::Socket::SSL::SSL_ERROR ? |
115 |
+ "$!,$IO::Socket::SSL::SSL_ERROR" : $!); |
116 |
push(@diag_fail, $diag); |
117 |
} else { |
118 |
$diag = sprintf("created %s socket on [%s]:%s", |
119 |
@@ -3238,7 +3231,6 @@ Options: |
120 |
-H [dir], --helper-home-dir[=dir] Specify a different HOME directory |
121 |
--ssl Enable SSL on TCP connections |
122 |
--ssl-port port Override --port setting for SSL connections |
123 |
- --ssl-version sslversion Specify SSL protocol version to use |
124 |
--server-key keyfile Specify an SSL keyfile |
125 |
--server-cert certfile Specify an SSL certificate |
126 |
--socketpath=path Listen on a given UNIX domain socket |
127 |
@@ -3727,14 +3719,6 @@ Optionally specifies the port number for |
128 |
SSL connections (default: whatever --port uses). See B<--ssl> for |
129 |
more details. |
130 |
|
131 |
-=item B<--ssl-version>=I<sslversion> |
132 |
- |
133 |
-Specify the SSL protocol version to use, one of B<sslv3> or B<tlsv1>. |
134 |
-The default, B<sslv3>, is the most flexible, accepting a SSLv3 or |
135 |
-higher hello handshake, then negotiating use of SSLv3 or TLSv1 |
136 |
-protocol if the client can accept it. Specifying B<--ssl-version> |
137 |
-implies B<--ssl>. |
138 |
- |
139 |
=item B<--server-key> I<keyfile> |
140 |
|
141 |
Specify the SSL key file to use for SSL connections. |
142 |
--- spamc/spamc.pod.orig |
143 |
+++ spamc/spamc.pod |
144 |
@@ -177,12 +177,10 @@ The default is 1 time (ie. one attempt a |
145 |
Sleep for I<sleep> seconds between failed spamd filtering attempts. |
146 |
The default is 1 second. |
147 |
|
148 |
-=item B<-S>, B<--ssl>, B<--ssl>=I<sslversion> |
149 |
+=item B<-S>, B<--ssl>, B<--ssl> |
150 |
|
151 |
If spamc was built with support for SSL, encrypt data to and from the |
152 |
spamd process with SSL; spamd must support SSL as well. |
153 |
-I<sslversion> specifies the SSL protocol version to use, either |
154 |
-C<sslv3>, or C<tlsv1>. The default, is C<sslv3>. |
155 |
|
156 |
=item B<-t> I<timeout>, B<--timeout>=I<timeout> |
157 |
|
158 |
--- t/spamd_ssl_tls.t.orig |
159 |
+++ t/spamd_ssl_tls.t |
160 |
@@ -1,28 +0,0 @@ |
161 |
-#!/usr/bin/perl |
162 |
- |
163 |
-use lib '.'; use lib 't'; |
164 |
-use SATest; sa_t_init("spamd_ssl_tls"); |
165 |
-use Test; plan tests => (($SKIP_SPAMD_TESTS || !$SSL_AVAILABLE) ? 0 : 9); |
166 |
- |
167 |
-exit if ($SKIP_SPAMD_TESTS || !$SSL_AVAILABLE); |
168 |
- |
169 |
-# --------------------------------------------------------------------------- |
170 |
- |
171 |
-%patterns = ( |
172 |
- |
173 |
-q{ Return-Path: sb55sb55@yahoo.com}, 'firstline', |
174 |
-q{ Subject: There yours for FREE!}, 'subj', |
175 |
-q{ X-Spam-Status: Yes, score=}, 'status', |
176 |
-q{ X-Spam-Flag: YES}, 'flag', |
177 |
-q{ X-Spam-Level: **********}, 'stars', |
178 |
-q{ TEST_ENDSNUMS}, 'endsinnums', |
179 |
-q{ TEST_NOREALNAME}, 'noreal', |
180 |
-q{ This must be the very last line}, 'lastline', |
181 |
- |
182 |
- |
183 |
-); |
184 |
- |
185 |
-ok (sdrun ("-L --ssl --ssl-version=tlsv1 --server-key data/etc/testhost.key --server-cert data/etc/testhost.cert", |
186 |
- "--ssl=tlsv1 < data/spam/001", |
187 |
- \&patterns_run_cb)); |
188 |
-ok_all_patterns(); |
189 |
--- t/spamd_ssl_v3.t.orig |
190 |
+++ t/spamd_ssl_v3.t |
191 |
@@ -1,28 +0,0 @@ |
192 |
-#!/usr/bin/perl |
193 |
- |
194 |
-use lib '.'; use lib 't'; |
195 |
-use SATest; sa_t_init("spamd_sslv3"); |
196 |
-use Test; plan tests => (($SKIP_SPAMD_TESTS || !$SSL_AVAILABLE) ? 0 : 9); |
197 |
- |
198 |
-exit if ($SKIP_SPAMD_TESTS || !$SSL_AVAILABLE); |
199 |
- |
200 |
-# --------------------------------------------------------------------------- |
201 |
- |
202 |
-%patterns = ( |
203 |
- |
204 |
-q{ Return-Path: sb55sb55@yahoo.com}, 'firstline', |
205 |
-q{ Subject: There yours for FREE!}, 'subj', |
206 |
-q{ X-Spam-Status: Yes, score=}, 'status', |
207 |
-q{ X-Spam-Flag: YES}, 'flag', |
208 |
-q{ X-Spam-Level: **********}, 'stars', |
209 |
-q{ TEST_ENDSNUMS}, 'endsinnums', |
210 |
-q{ TEST_NOREALNAME}, 'noreal', |
211 |
-q{ This must be the very last line}, 'lastline', |
212 |
- |
213 |
- |
214 |
-); |
215 |
- |
216 |
-ok (sdrun ("-L --ssl --ssl-version=sslv3 --server-key data/etc/testhost.key --server-cert data/etc/testhost.cert", |
217 |
- "--ssl=sslv3 < data/spam/001", |
218 |
- \&patterns_run_cb)); |
219 |
-ok_all_patterns(); |
220 |
--- t/spamd_ssl_accept_fail.t.orig |
221 |
+++ t/spamd_ssl_accept_fail.t |
222 |
@@ -23,9 +23,9 @@ q{ This must be the very last line}, 'la |
223 |
|
224 |
); |
225 |
|
226 |
-ok (start_spamd ("-L --ssl --ssl-version=sslv3 --server-key data/etc/testhost.key --server-cert data/etc/testhost.cert")); |
227 |
+ok (start_spamd ("-L --ssl --server-key data/etc/testhost.key --server-cert data/etc/testhost.cert")); |
228 |
ok (spamcrun ("< data/spam/001", \&patterns_run_cb)); |
229 |
-ok (spamcrun ("--ssl=sslv3 < data/spam/001", \&patterns_run_cb)); |
230 |
+ok (spamcrun ("--ssl < data/spam/001", \&patterns_run_cb)); |
231 |
ok (stop_spamd ()); |
232 |
|
233 |
ok_all_patterns(); |
234 |
--- t/spamd_ssl.t.orig |
235 |
+++ t/spamd_ssl.t |
236 |
@@ -2,10 +2,7 @@ |
237 |
|
238 |
use lib '.'; use lib 't'; |
239 |
use SATest; sa_t_init("spamd_ssl"); |
240 |
-use Test; plan tests => (($SKIP_SPAMD_TESTS || !$SSL_AVAILABLE) ? 0 : 9), |
241 |
- onfail => sub { |
242 |
- warn "\n\nNote: This may not be a SpamAssassin bug, as some platforms require that you" . |
243 |
- "\nspecify a protocol in spamc --ssl option, and possibly in spamd --ssl-version.\n\n" }; |
244 |
+use Test; plan tests => (($SKIP_SPAMD_TESTS || !$SSL_AVAILABLE) ? 0 : 9); |
245 |
|
246 |
exit if ($SKIP_SPAMD_TESTS || !$SSL_AVAILABLE); |
247 |
|
248 |
--- MANIFEST.orig |
249 |
+++ MANIFEST |
250 |
@@ -513,8 +513,6 @@ t/spamd_report_ifspam.t |
251 |
t/spamd_sql_prefs.t |
252 |
t/spamd_ssl.t |
253 |
t/spamd_ssl_accept_fail.t |
254 |
-t/spamd_ssl_tls.t |
255 |
-t/spamd_ssl_v3.t |
256 |
t/spamd_stop.t |
257 |
t/spamd_symbols.t |
258 |
t/spamd_syslog.t |