Line 0
Link Here
|
|
|
1 |
--- libnessus/network.c.orig 2006-05-22 14:14:35 UTC |
2 |
+++ libnessus/network.c |
3 |
@@ -532,12 +532,16 @@ open_SSL_connection(fp, timeout, cert, k |
4 |
|
5 |
switch (fp->transport) |
6 |
{ |
7 |
+#ifndef OPENSSL_NO_SSL2 |
8 |
case NESSUS_ENCAPS_SSLv2: |
9 |
fp->ssl_mt = SSLv2_client_method(); |
10 |
break; |
11 |
+#endif |
12 |
+#ifndef OPENSSL_NO_SSL3 |
13 |
case NESSUS_ENCAPS_SSLv3: |
14 |
fp->ssl_mt = SSLv3_client_method(); |
15 |
break; |
16 |
+#endif |
17 |
case NESSUS_ENCAPS_TLSv1: |
18 |
fp->ssl_mt = TLSv1_client_method(); |
19 |
break; |
20 |
@@ -724,9 +728,13 @@ open_stream_connection(args, port, trans |
21 |
{ |
22 |
case NESSUS_ENCAPS_IP: |
23 |
#ifdef HAVE_SSL |
24 |
+#ifndef OPENSSL_NO_SSL2 |
25 |
case NESSUS_ENCAPS_SSLv2: |
26 |
+#endif |
27 |
case NESSUS_ENCAPS_SSLv23: |
28 |
+#ifndef OPENSSL_NO_SSL3 |
29 |
case NESSUS_ENCAPS_SSLv3: |
30 |
+#endif |
31 |
case NESSUS_ENCAPS_TLSv1: |
32 |
#endif |
33 |
break; |
34 |
@@ -763,7 +771,9 @@ open_stream_connection(args, port, trans |
35 |
break; |
36 |
#ifdef HAVE_SSL |
37 |
case NESSUS_ENCAPS_SSLv23: |
38 |
+#ifndef OPENSSL_NO_SSL3 |
39 |
case NESSUS_ENCAPS_SSLv3: |
40 |
+#endif |
41 |
case NESSUS_ENCAPS_TLSv1: |
42 |
renice_myself(); |
43 |
cert = kb_item_get_str(plug_get_kb(args), "SSL/cert"); |
44 |
@@ -782,12 +792,13 @@ open_stream_connection(args, port, trans |
45 |
sslerror(msg); |
46 |
} |
47 |
} |
48 |
- |
49 |
+#ifndef OPENSSL_NO_SSL2 |
50 |
case NESSUS_ENCAPS_SSLv2: |
51 |
/* We do not need a client certificate in this case */ |
52 |
|
53 |
if (open_SSL_connection(fp, timeout, cert, key, passwd, cert_names) <= 0) |
54 |
goto failed; |
55 |
+#endif |
56 |
break; |
57 |
#endif |
58 |
} |
59 |
@@ -812,10 +823,14 @@ open_stream_connection_unknown_encaps5(a |
60 |
struct timeval tv1, tv2; |
61 |
static int encaps[] = { |
62 |
#ifdef HAVE_SSL |
63 |
+#ifndef OPENSSL_NO_SSL2 |
64 |
NESSUS_ENCAPS_SSLv2, |
65 |
+#endif |
66 |
NESSUS_ENCAPS_TLSv1, |
67 |
+#ifndef OPENSSL_NO_SSL3 |
68 |
NESSUS_ENCAPS_SSLv3, |
69 |
#endif |
70 |
+#endif |
71 |
NESSUS_ENCAPS_IP |
72 |
}; |
73 |
|
74 |
@@ -1044,9 +1059,13 @@ read_stream_connection_unbuffered(fd, bu |
75 |
{ |
76 |
/* NESSUS_ENCAPS_IP was treated before with the non-Nessus fd */ |
77 |
#ifdef HAVE_SSL |
78 |
+#ifndef OPENSSL_NO_SSL2 |
79 |
case NESSUS_ENCAPS_SSLv2: |
80 |
+#endif |
81 |
case NESSUS_ENCAPS_SSLv23: |
82 |
+#ifndef OPENSSL_NO_SSL3 |
83 |
case NESSUS_ENCAPS_SSLv3: |
84 |
+#endif |
85 |
case NESSUS_ENCAPS_TLSv1: |
86 |
# if DEBUG_SSL > 0 |
87 |
if (getpid() != fp->pid) |
88 |
@@ -1280,9 +1299,13 @@ write_stream_connection4(fd, buf0, n, i_ |
89 |
break; |
90 |
|
91 |
#ifdef HAVE_SSL |
92 |
+#ifndef OPENSSL_NO_SSL2 |
93 |
case NESSUS_ENCAPS_SSLv2: |
94 |
+#endif |
95 |
case NESSUS_ENCAPS_SSLv23: |
96 |
+#ifndef OPENSSL_NO_SSL3 |
97 |
case NESSUS_ENCAPS_SSLv3: |
98 |
+#endif |
99 |
case NESSUS_ENCAPS_TLSv1: |
100 |
FD_ZERO(&fdr); FD_ZERO(&fdw); |
101 |
FD_SET(fp->fd, & fdr); FD_SET(fp->fd, & fdw); |
102 |
@@ -1504,12 +1527,16 @@ get_encaps_name(code) |
103 |
{ |
104 |
case NESSUS_ENCAPS_IP: |
105 |
return "IP"; |
106 |
+#ifndef OPENSSL_NO_SSL2 |
107 |
case NESSUS_ENCAPS_SSLv2: |
108 |
return "SSLv2"; |
109 |
+#endif |
110 |
case NESSUS_ENCAPS_SSLv23: |
111 |
return "SSLv23"; |
112 |
+#ifndef OPENSSL_NO_SSL3 |
113 |
case NESSUS_ENCAPS_SSLv3: |
114 |
return "SSLv3"; |
115 |
+#endif |
116 |
case NESSUS_ENCAPS_TLSv1: |
117 |
return "TLSv1"; |
118 |
default: |
119 |
@@ -1527,9 +1554,13 @@ get_encaps_through(code) |
120 |
{ |
121 |
case NESSUS_ENCAPS_IP: |
122 |
return ""; |
123 |
+#ifndef OPENSSL_NO_SSL2 |
124 |
case NESSUS_ENCAPS_SSLv2: |
125 |
+#endif |
126 |
case NESSUS_ENCAPS_SSLv23: |
127 |
+#ifndef OPENSSL_NO_SSL3 |
128 |
case NESSUS_ENCAPS_SSLv3: |
129 |
+#endif |
130 |
case NESSUS_ENCAPS_TLSv1: |
131 |
return " through SSL"; |
132 |
default: |