branch Attitude Adjustment packages
[12.09/packages.git] / net / rrs / patches / 002-no_sslv2.patch
1 Index: rrs-1.70/rrs.c
2 ===================================================================
3 --- rrs-1.70.orig/rrs.c 2007-07-30 14:30:24.000000000 +0200
4 +++ rrs-1.70/rrs.c      2007-07-30 14:30:25.000000000 +0200
5 @@ -1826,9 +1826,12 @@
6                  }
7                  rrs_ssl = TLSv1;
8                  if (optarg) {
9 +#ifndef OPENSSL_NO_SSL2                    
10                      if (!strcasecmp(optarg, "SSLv2")) {
11                          rrs_ssl = SSLv2;
12 -                    } else if (!strcasecmp(optarg, "SSLv3")) {
13 +                    } else
14 +#endif
15 +                   if (!strcasecmp(optarg, "SSLv3")) {
16                          rrs_ssl = SSLv3;
17                      } else if (!strcasecmp(optarg, "TLSv1")) {
18                          rrs_ssl = TLSv1;
19 @@ -1981,9 +1984,12 @@
20          SSL_load_error_strings();
21  
22          if (rrs_listen) {
23 +#ifndef OPENSSL_NO_SSL2
24              if (rrs_ssl == SSLv2) {
25                  sslmethod = SSLv2_server_method();
26 -            } else if (rrs_ssl == SSLv3) {
27 +            } else
28 +#endif
29 +           if (rrs_ssl == SSLv3) {
30                  sslmethod = SSLv3_server_method();
31              } else if (rrs_ssl == TLSv1) {
32                  sslmethod = TLSv1_server_method();
33 @@ -1992,9 +1998,12 @@
34                  return err_generic;
35              }
36          } else {
37 +#ifndef OPENSSL_NO_SSL2
38              if (rrs_ssl == SSLv2) {
39                  sslmethod = SSLv2_client_method();
40 -            } else if (rrs_ssl == SSLv3) {
41 +            } else
42 +#endif
43 +           if (rrs_ssl == SSLv3) {
44                  sslmethod = SSLv3_client_method();
45              } else if (rrs_ssl == TLSv1) {
46                  sslmethod = TLSv1_client_method();