Lines 1-120
Link Here
|
1 |
--- sslscan.c.orig 2009-09-01 14:35:59.000000000 +0200 |
1 |
--- sslscan.c.orig 2016-03-24 21:02:55 UTC |
2 |
+++ sslscan.c 2015-03-07 23:26:34.286277205 +0100 |
2 |
+++ sslscan.c |
3 |
@@ -41,6 +41,7 @@ |
3 |
@@ -788,7 +788,7 @@ int testCompression(struct sslCheckOptio |
4 |
#include <openssl/pkcs12.h> |
4 |
#endif |
5 |
#include <openssl/x509.h> |
5 |
{ |
6 |
#include <openssl/x509v3.h> |
6 |
printf("%sOpenSSL version does not support compression%s\n", COL_RED, RESET); |
7 |
+#include <netinet/in.h> |
7 |
- printf("%sRebuild with zlib1g-dev package for zlib support%s\n\n", COL_RED, RESET); |
|
|
8 |
+ printf("\n"); |
9 |
} |
8 |
|
10 |
|
9 |
// Defines... |
11 |
// Disconnect SSL over socket |
10 |
#define false 0 |
12 |
@@ -1291,7 +1291,11 @@ int testCipher(struct sslCheckOptions *o |
11 |
@@ -563,6 +564,7 @@ |
13 |
return false; |
12 |
} |
14 |
} |
13 |
if (options->xmlOutput != 0) |
15 |
|
14 |
fprintf(options->xmlOutput, " sslversion=\""); |
16 |
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L |
15 |
+#ifndef OPENSSL_NO_SSL2 |
17 |
cipherid = SSL_CIPHER_get_id(sslCipherPointer); |
16 |
if (sslCipherPointer->sslMethod == SSLv2_client_method()) |
18 |
+#else |
17 |
{ |
19 |
+ cipherid = sslCipherPointer->id; |
18 |
if (options->xmlOutput != 0) |
|
|
19 |
@@ -571,8 +573,11 @@ |
20 |
printf("SSLv2 || "); |
21 |
else |
22 |
printf("SSLv2 "); |
23 |
- } |
24 |
- else if (sslCipherPointer->sslMethod == SSLv3_client_method()) |
25 |
+ } |
26 |
+ else |
27 |
+#endif |
20 |
+#endif |
28 |
+#ifndef OPENSSL_NO_SSL3 |
21 |
cipherid = cipherid & 0x00ffffff; // remove first byte which is the version (0x03 for TLSv1/SSLv3) |
29 |
+ if (sslCipherPointer->sslMethod == SSLv3_client_method()) |
22 |
|
30 |
{ |
23 |
// Show Cipher Status |
31 |
if (options->xmlOutput != 0) |
|
|
32 |
fprintf(options->xmlOutput, "SSLv3\" bits=\""); |
33 |
@@ -582,6 +587,7 @@ |
34 |
printf("SSLv3 "); |
35 |
} |
36 |
else |
37 |
+#endif |
38 |
{ |
39 |
if (options->xmlOutput != 0) |
40 |
fprintf(options->xmlOutput, "TLSv1\" bits=\""); |
41 |
@@ -688,6 +694,7 @@ |
42 |
cipherStatus = SSL_connect(ssl); |
43 |
if (cipherStatus == 1) |
44 |
{ |
45 |
+#ifndef OPENSSL_NO_SSL2 |
46 |
if (sslMethod == SSLv2_client_method()) |
47 |
{ |
48 |
if (options->xmlOutput != 0) |
49 |
@@ -697,7 +704,10 @@ |
50 |
else |
51 |
printf(" SSLv2 "); |
52 |
} |
53 |
- else if (sslMethod == SSLv3_client_method()) |
54 |
+ else |
55 |
+#endif |
56 |
+#ifndef OPENSSL_NO_SSL3 |
57 |
+ if (sslMethod == SSLv3_client_method()) |
58 |
{ |
59 |
if (options->xmlOutput != 0) |
60 |
fprintf(options->xmlOutput, " <defaultcipher sslversion=\"SSLv3\" bits=\""); |
61 |
@@ -707,6 +717,7 @@ |
62 |
printf(" SSLv3 "); |
63 |
} |
64 |
else |
65 |
+#endif |
66 |
{ |
67 |
if (options->xmlOutput != 0) |
68 |
fprintf(options->xmlOutput, " <defaultcipher sslversion=\"TLSv1\" bits=\""); |
69 |
@@ -1192,18 +1203,26 @@ |
70 |
switch (options->sslVersion) |
71 |
{ |
72 |
case ssl_all: |
73 |
+#ifndef OPENSSL_NO_SSL2 |
74 |
status = defaultCipher(options, SSLv2_client_method()); |
75 |
if (status != false) |
76 |
+#endif |
77 |
+#ifndef OPENSSL_NO_SSL3 |
78 |
status = defaultCipher(options, SSLv3_client_method()); |
79 |
if (status != false) |
80 |
+#endif |
81 |
status = defaultCipher(options, TLSv1_client_method()); |
82 |
break; |
83 |
+#ifndef OPENSSL_NO_SSL2 |
84 |
case ssl_v2: |
85 |
status = defaultCipher(options, SSLv2_client_method()); |
86 |
break; |
87 |
+#endif |
88 |
+#ifndef OPENSSL_NO_SSL3 |
89 |
case ssl_v3: |
90 |
status = defaultCipher(options, SSLv3_client_method()); |
91 |
break; |
92 |
+#endif |
93 |
case tls_v1: |
94 |
status = defaultCipher(options, TLSv1_client_method()); |
95 |
break; |
96 |
@@ -1415,16 +1434,24 @@ |
97 |
switch (options.sslVersion) |
98 |
{ |
99 |
case ssl_all: |
100 |
+#ifndef OPENSSL_NO_SSL2 |
101 |
populateCipherList(&options, SSLv2_client_method()); |
102 |
+#endif |
103 |
+#ifndef OPENSSL_NO_SSL3 |
104 |
populateCipherList(&options, SSLv3_client_method()); |
105 |
+#endif |
106 |
populateCipherList(&options, TLSv1_client_method()); |
107 |
break; |
108 |
+#ifndef OPENSSL_NO_SSL2 |
109 |
case ssl_v2: |
110 |
populateCipherList(&options, SSLv2_client_method()); |
111 |
break; |
112 |
+#endif |
113 |
+#ifndef OPENSSL_NO_SSL3 |
114 |
case ssl_v3: |
115 |
populateCipherList(&options, SSLv3_client_method()); |
116 |
break; |
117 |
+#endif |
118 |
case tls_v1: |
119 |
populateCipherList(&options, TLSv1_client_method()); |
120 |
break; |