Commit Graph

669 Commits

Author SHA1 Message Date
David Cooper
f216cbe61f Merge branch 'master' into version_negotiation 2016-07-08 09:39:12 -04:00
David Cooper
02a39e4859 Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-07-08 09:38:06 -04:00
David Cooper
788042ba37 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-07-08 09:35:52 -04:00
Dirk
af4117aa7a FIX #404 2016-07-08 11:25:41 +02:00
Dirk
8c11334030 FIX #405 2016-07-08 11:15:41 +02:00
Dirk Wetter
57bf01a360 Merge pull request #402 from dcooper16/poodle
Check for all CBC ciphers in Poodle test
2016-07-08 10:04:49 +02:00
Thomas Ward
de05711e5a Fix grammar issue in help output for --openssl
Missing a closing parentheses `)`.
2016-07-06 14:23:32 -04:00
David Cooper
ec6c0ce605 Check for all CBC ciphers in Poodle test
This PR should address issue #399.

I created the list of ciphers using the CIPHERS_BY_STRENGTH file from PR #373, making a list of all ciphers that had "CBC" in the RFC name and for which I had been able to find a corresponding OpenSSL name. Then, since that list contained more than 128 ciphers, I removed any ciphers from the list where the name ended in "-SHA256" or "-SHA384", as it is my understanding that those ciphers can only be used with TLS 1.2.
2016-07-06 10:52:54 -04:00
David Cooper
b6accbe737 Merge branch 'master' into version_negotiation 2016-07-05 10:24:53 -04:00
David Cooper
1102ef324c Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-07-05 10:23:13 -04:00
David Cooper
6ec00c33db Merge branch 'master' into more_sslv2_sslv3_fixes
Conflicts:
	testssl.sh
2016-07-05 10:19:53 -04:00
Dirk
0217992553 fixed error where an URI in X509v3 Issuer Alternative Name was displayed and an URI in SAN 2016-07-05 00:08:51 +02:00
Dirk
d2f2dab7fb fix regression lf in CN 2016-07-05 00:02:34 +02:00
Dirk
2bba19360f see #401, part 2 2016-07-04 23:52:52 +02:00
Dirk Wetter
251e3f9a3b Merge pull request #371 from dcooper16/fix_issue_276
Fix issue #276
2016-07-04 23:25:13 +02:00
Dirk
0b5705fff4 FIX #258, FIX #398
partly addressed: #246
2016-07-04 23:05:12 +02:00
Dirk
f01bff973a renamed function, better banner for logging 2016-07-04 13:59:39 +02:00
Dirk
491a03233b updating neat_list() to be faster and more compatible to openssl 1.1.0 with new chacha/poly ciphers 2016-07-03 22:35:21 +02:00
Dirk
d5242c255e FIX #384 2016-07-03 21:45:49 +02:00
Dirk
32f249b0c2 enabling sockets for client testing per default #375 2016-07-01 18:26:05 +02:00
Dirk
2362cd8745 wording for GOST sig algos and keys 2016-07-01 12:03:46 +02:00
David Cooper
0af62efb4f Merge branch 'master' into version_negotiation 2016-06-29 11:03:45 -04:00
David Cooper
a534b8de5f Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-06-29 11:02:14 -04:00
David Cooper
df55d4af51 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-06-29 09:57:38 -04:00
David Cooper
53dec241f1 Merge branch 'master' into fix_issue_276 2016-06-29 09:56:08 -04:00
Dirk
36d300b74e add line when using sockets for client simulation 2016-06-28 12:21:50 +02:00
David Cooper
be85fbf2b7 Update IE client simulation data
Change client data for IE 8-10 and IE 11 to match ssllabs.
2016-06-24 16:14:41 -04:00
David Cooper
799c6a5fd0 Handle missing $MAPPING_FILE_RFC
Changed code for run_client_simulation() so that cipher is output when sockets are used even if $MAPPING_FILE_RFC is missing. Also, updated the client data.
2016-06-24 15:48:40 -04:00
David Cooper
b6ccdec614 Merge branch 'master' into version_negotiation 2016-06-24 13:27:35 -04:00
David Cooper
31c3a87a72 Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-06-24 13:26:28 -04:00
David Cooper
0adac7a9a4 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-06-24 13:24:17 -04:00
David Cooper
f2077b7726 Merge branch 'master' into fix_issue_276 2016-06-24 13:23:07 -04:00
David Cooper
0e58e272f8 Merge branch 'master' into client_sim_sockets
Conflicts:
	testssl.sh
2016-06-24 13:18:25 -04:00
Dirk
5cb4b722b4 in client simulation it should be TLSv1.0 instead of TLSv1.0 2016-06-24 19:01:00 +02:00
Dirk
93204937c5 FIX #376 2016-06-23 19:42:26 +02:00
David Cooper
dd8788d670 Merge branch 'master' into fix_issue_276 2016-06-23 09:42:18 -04:00
David Cooper
8c14ba37d6 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-06-23 09:40:34 -04:00
David Cooper
df2904edbf Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-06-23 09:36:58 -04:00
David Cooper
df4edd4152 Merge branch 'master' into version_negotiation 2016-06-23 09:36:06 -04:00
David Cooper
bebdc3c70e Merge branch 'master' into client_sim_sockets 2016-06-23 09:24:54 -04:00
Dirk
68353db42b polishing #382 2016-06-23 14:33:26 +02:00
Dirk Wetter
31c8979d41 Merge pull request #382 from seccubus/mass_and_file_out
Allow the file output feature and mass_test feature to work together
2016-06-23 13:40:09 +02:00
Dirk Wetter
b5b9dd8712 Merge pull request #387 from bad/master
porting to NetBSD
2016-06-23 12:15:02 +02:00
Dirk
ef23703903 fix for #389 2016-06-23 12:04:45 +02:00
Florian Schuetz
18c5f273c3 HSTS: check if max-age is present and nonzero 2016-06-21 21:24:24 +02:00
Florian Schuetz
f8579ee2f7 Fix HSTS/HPKP includeSubDomains and preload being broken in file output. 2016-06-21 08:57:39 +02:00
Christoph Badura
0fd261eb6c Refactor date parsing. Makes testssl.sh work on NetBSD too.
Introduce a parse_date() function to handle all date parsing.
Check for the following date(1) variants:
GNU: accepts "-d date-to-parse".
FreeBSD/OS X: accepts "-j -f input-format"
everything else: accepts "-j date-to-parse"

usage: parse-date date output-format input-format

Tested on NetBSD, OS X 10.11 and Debian jessie.
2016-06-20 22:01:13 +02:00
Christoph Badura
48d5e5a7a1 Drop remaining '\c's in printf(1) arguments. 2016-06-20 22:01:13 +02:00
David Cooper
b8b779b419 Use sockets for client simulations
Modify run_client_simulation() to send the ClientHello from https://api.dev.ssllabs.com/api/v3/getClients (modified to use the correct value in the server name extension) if $EXPERIMENTAL is true, $STARTTLS is empty, and $SSL_NATIVE is false.
2016-06-17 16:33:00 -04:00
David Cooper
1275ce5ed2 Merge branch 'master' into version_negotiation 2016-06-17 16:18:09 -04:00
David Cooper
0a51239cda Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-06-17 16:17:31 -04:00
David Cooper
aeef882476 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-06-17 16:14:59 -04:00
David Cooper
2b4d10137a Merge branch 'master' into fix_issue_276 2016-06-17 16:14:24 -04:00
Dirk Wetter
02e9f5cd23 fix colum spacing again for all alg chacha poly ciphers 2016-06-15 21:31:10 +02:00
Dirk Wetter
d10dd6d34c align old chacha/poly ciphers output in OPENSSL name, see #379 2016-06-15 20:12:48 +02:00
Frank Breedijk
3b1d8b6253 Need to deal with the comma correctly if we are appending to a file 2016-06-14 10:36:57 +02:00
David Cooper
b590ecedcf Merge branch 'master' into version_negotiation 2016-06-13 15:03:11 -04:00
David Cooper
321a8bfe57 Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-06-13 15:02:20 -04:00
David Cooper
35deb6a40d Merge branch 'master' into more_sslv2_sslv3_fixes 2016-06-13 15:00:52 -04:00
David Cooper
5f120f8021 Merge branch 'fix_issue_276' of https://github.com/dcooper16/testssl.sh into fix_issue_276 2016-06-13 14:57:51 -04:00
David Cooper
3420c86e7f Merge branch 'master' into fix_issue_276 2016-06-13 14:55:55 -04:00
David Cooper
1d0c8cb3f8 Printing of subjectAltName extension
Modify the extraction of the subjectAltName extension from certificates in order to address SANs with name forms other than DNS and otherName.
2016-06-13 12:52:19 -04:00
David Cooper
b264714fd9 Add check of IP address
compare_server_name_to_cert() now checks the DNS names and IP addresses in the subjectAltName extension for a match.
2016-06-13 11:09:15 -04:00
Frank Breedijk
701545dbb6 Allow the file output feature and mass_test feature to work together 2016-06-13 15:35:56 +02:00
David Cooper
706db7553f Merge branch 'master' into more_sslv2_sslv3_fixes 2016-06-10 15:30:56 -04:00
David Cooper
76ea57863a Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-06-10 15:29:00 -04:00
David Cooper
f84ebd99b5 Merge branch 'master' into fix_issue_276 2016-06-10 15:27:46 -04:00
David Cooper
52d6eabdf7 Merge branch 'master' into version_negotiation
Conflicts:
	testssl.sh
2016-06-10 15:26:29 -04:00
David Cooper
8c86049848 run_cipher_per_proto() 128-cipher limit
Ensure that neither run_allciphers() nor run_cipher_per_proto() sends a ClientHello with 128 or more cipher suites.
2016-06-10 13:45:25 -04:00
David Cooper
b8348c6454 Merge branch 'master' into version_negotiation 2016-06-09 10:21:49 -04:00
David Cooper
bf4134844c Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-06-09 10:21:09 -04:00
David Cooper
c20d2dfc6f Merge branch 'master' into more_sslv2_sslv3_fixes 2016-06-09 10:20:20 -04:00
David Cooper
189fe662f5 Merge branch 'master' into fix_issue_276 2016-06-09 10:17:49 -04:00
Dirk
adbb1932eb simplified cipher and protocol retrieval in 'Testing server preferences' 2016-06-09 15:56:53 +02:00
David Cooper
c656015312 Merge branch 'master' into version_negotiation
Conflicts:
	testssl.sh
2016-06-09 09:34:37 -04:00
David Cooper
d2bded1114 Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-06-09 09:33:05 -04:00
David Cooper
aa9eeaf6af Merge branch 'master' into more_sslv2_sslv3_fixes
Conflicts:
	testssl.sh
2016-06-09 09:31:46 -04:00
David Cooper
a46b6791db Merge branch 'master' into fix_issue_276 2016-06-09 09:29:40 -04:00
Dirk
5ceace33e0 - FIX #189 with a smart check, introduced global var SERVER_SIZE_LIMIT_BUG
- introduced "has_server_protocol()" which can be used to check b4 connecting if protocol is a/v
2016-06-09 11:04:40 +02:00
David Cooper
eb9e2d85a0 Merge branch 'master' into version_negotiation 2016-06-08 13:47:35 -04:00
David Cooper
ce9b277b2c Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-06-08 13:47:01 -04:00
David Cooper
90fcb3500c Merge branch 'master' into more_sslv2_sslv3_fixes 2016-06-08 13:45:22 -04:00
David Cooper
a224bb5068 Merge branch 'master' into fix_issue_276 2016-06-08 13:44:16 -04:00
David Cooper
4750c3f0d5 Adding x25519 and x448 to ClientHello
This added x25519 and x448 to the list of supported elliptic curves in the ClientHello created by socksend_tls_clienthello().
2016-06-08 11:25:47 -04:00
David Cooper
5edd005df0 Merge branch 'master' into version_negotiation
Conflicts:
	testssl.sh
2016-06-08 09:52:45 -04:00
David Cooper
130aa350d2 Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-06-08 09:48:18 -04:00
David Cooper
cbb20bf661 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-06-08 09:46:58 -04:00
David Cooper
eaad4c7dd8 Merge branch 'master' into fix_issue_276 2016-06-08 09:46:25 -04:00
Dirk Wetter
c929fba206 Merge pull request #342 from dcooper16/socksend_tls_clienthello_extensions
More extensions in socksend_tls_clienthello()
2016-06-08 10:39:17 +02:00
Dirk
d858edca1b - filled PROTOS_OFFERED w sense
- minor fixes for fileout
- introduced "fixme()"
2016-06-07 23:06:58 +02:00
David Cooper
ec8420144d Merge branch 'master' into version_negotiation 2016-06-07 10:36:52 -04:00
David Cooper
c13ae4a001 Merge branch 'master' into socksend_tls_clienthello_extensions 2016-06-07 10:35:32 -04:00
David Cooper
c50f2cc796 Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-06-07 10:33:21 -04:00
David Cooper
366025256b Merge branch 'master' into more_sslv2_sslv3_fixes
Conflicts:
	testssl.sh
2016-06-07 10:30:46 -04:00
David Cooper
a6d59b5380 Merge branch 'master' into fix_issue_276 2016-06-07 10:24:56 -04:00
Dirk
8ed6214b6f preliminary fix for #189 (SIZELMT_W_ARND=true needed) 2016-06-07 13:02:58 +02:00
Dirk
29072315e5 output correction for IPv6 and --ip=<addr 2016-06-07 09:08:48 +02:00
Dirk
6f4ba5bda7 - corrected handling of shortened warning periods for LE certs (dual certs were wrong)
- (kind of) readded cert_key_algo in output
- smaller output fixes e.g. for GOST certificates
2016-06-06 13:42:17 +02:00
Dirk Wetter
561cfa16fc - FIX #367 2016-06-02 21:31:24 +02:00
David Cooper
b1e2fc7448 Merge branch 'master' into version_negotiation 2016-06-02 09:19:37 -04:00
David Cooper
e8cc32af54 Merge branch 'master' into socksend_tls_clienthello_extensions 2016-06-02 09:16:45 -04:00
David Cooper
f5fcff22d6 Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-06-02 09:14:20 -04:00
David Cooper
c593675b8e Merge branch 'master' into more_sslv2_sslv3_fixes 2016-06-02 09:09:57 -04:00
David Cooper
fc6b5070af Merge branch 'master' into fix_issue_276 2016-06-02 09:08:24 -04:00
Dirk Wetter
6a9b0e01fc - polishing #366 and IPv6-related 2016-06-02 09:59:52 +02:00
David Cooper
6825c0b363 Allow for certificates with no subjectAltName extension
While it seems that almost all certificates include a subjectAltName extension, need to allow for the possibility that the two certificates being compared don't have subjectAltName extensions.
2016-06-01 16:20:10 -04:00
David Cooper
3bc0d6b45c Fix issue #276
Here is my proposed change to fix issue #276.
2016-06-01 15:57:40 -04:00
David Cooper
a9cd3ec6ca Merge branch 'master' into version_negotiation
Conflicts:
	testssl.sh
2016-05-31 09:51:13 -04:00
typingArtist
2c69e83f5b https://github.com/drwetter/testssl.sh/issues/365 add UNBRACKETED_IPV6 quirks option
Since some OpenSSL binaries, namely Gentoo’s, don’t support bracketed
IPv6 addresses but unbracketed ones, specified as the -connect option,
the UNBRACKETED_IPV6 environment variable can be set to true for
disabling the automatic addition of brackets around IPv6 addresses on
such platforms.
2016-05-27 20:11:47 +02:00
typingArtist
cf62353fc6 https://github.com/drwetter/testssl.sh/issues/365 ensure DNS PTR lookups use un-bracketed IPv6 address
While standard OpenSSL requires the literal IPv6 address enclosed
in [brackets], standard DNS lookup tools don’t support the additional
characters. Before making reverse PTR lookups, these brackets have to
be removed from the IPv6 addresses.
2016-05-27 19:54:23 +02:00
Dirk Wetter
e1a8306286 - try to address #352
- WARNING in fileout is MEDIUM now
- NOT ok for medium on screen squashed
2016-05-27 17:43:45 +02:00
Dirk Wetter
6fb15e83fa global $OPENSSL_NR_CIPHERS 2016-05-26 12:56:55 +02:00
David Cooper
4d059f7106 Merge branch 'master' into version_negotiation 2016-05-25 16:57:37 -04:00
David Cooper
acc72a1daf Merge branch 'master' into socksend_tls_clienthello_extensions 2016-05-25 16:50:56 -04:00
David Cooper
a503d883c7 Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-05-25 16:38:23 -04:00
David Cooper
f9757c4e4d Merge branch 'master' into more_sslv2_sslv3_fixes 2016-05-25 16:32:04 -04:00
David Cooper
2a4d987f31 Merged master fixed conflict. 2016-05-24 14:19:19 -04:00
David Cooper
e0c147ec86 run_pfs() and run_rc4() show each fixes
When run_rc4() is run with the "--show-each" option, but without the "--wide" option, a list of all RC4 ciphers is printed, without any distinction between those that are supported by the server and those that are not. This is the same issue I noted in #332 for run_pfs().

In run_pfs(), the displayed output was corrected, but all ciphers were still being added to $pfs_ciphers, so the list of supported PFS ciphers sent to fileout() was incorrect.

This PR fixes both issues.
2016-05-24 13:57:47 -04:00
Dirk
5a03e96304 - consequently removed "NOT ok" for not-av of TLS 1.2 2016-05-23 22:42:40 +02:00
Dirk Wetter
bf17a17b70 - 3DES in standard cipher list is medium, thus "NOT ok" is too much (need for elegant general way for "medium")
(see also https://www.keylength.com/en/8/)
2016-05-23 18:56:05 +02:00
Dirk Wetter
aa99c5eb88 - FIX #347
- LF removed in JSON
2016-05-20 13:45:53 +02:00
Dirk Wetter
803e363310 Merge pull request #356 from dcooper16/server_key_size
Fix typo in Server key size check
2016-05-20 08:16:48 +02:00
David Cooper
2ffed62d53 Recognize more signature algorithms
This PR adds to the list of signature algorithms recognized in certificate_info().
2016-05-19 16:45:56 -04:00
David Cooper
dccf9bef63 Fix typo in Server key size check
When certificate_info() is trying to determine what type of public key the server has so that it can determine whether the key size is acceptable, it sometimes looks at $cert_sig_algo rather than $cert_key_algo. This PR fixes that and also adds support for DSA public keys.
2016-05-19 16:39:06 -04:00
Dirk Wetter
9a1425da14 - FIX #354
- polish #353
2016-05-18 19:06:26 +02:00
David Cooper
2a0a382321 Don't use dec2hex
The dec2hex() was actually converting from hex to decimal. Since it was only being used in one place, and wasn't really needed there, I just deleted it.
2016-05-17 12:02:12 -04:00
David Cooper
cba7fddbdd Revised parse_tls_serverhello()
Revised parse_tls_serverhello() to more carefully check the response for errors, and to provide for more flexibility (e.g., if handshake messages are split across multiple fragments).
2016-05-16 16:52:51 -04:00
David Cooper
07a8bd3143 Support version negotiation test
The new test in PR #346 sends a TLSv1.4 ClientHello, so socksend_tls_clienthello() needs to include the signature algorithms extension if $tls_low_byte >= 3 rather than only if it is equal to 3.
2016-05-11 09:24:07 -04:00
Dirk Wetter
4eefe0df8b Merge pull request #314 from thomaspatzke/master
logfile, jsonfile and csvfile parameters work without =
2016-05-11 00:14:24 +02:00
David Cooper
1d4622ebab Additional checks in run_protocols()
One server I am testing responds to an SSLv3 ClientHello with TLSv1.2. If tls_sockets is being used, then testssl.sh responds with "#FIXME: downgraded. still missing a test case here." This PR fixes that, and in general checks the responses in run_protocols() more closely.

If tls_sockets is being used and the connection fails even though the server supports an earlier version of SSL/TLS, then it flags an error. If tls_sockets returns 2, then it verifies that $DETECTED_TLS_VERSION is equal to the highest version number supported by the server (that is also less than the version number in the ClientHello).

In addition, in order to test servers' support for version negotiation, it adds a new test that sends a TLSv1.4 ClientHello and verifies that the server responds with the highest version number that it supports. (This test only runs if both $using_sockets and $EXPERIMENTAL are true and server actually supports some version of SSL/TLS other than SSLv2.)
2016-05-06 15:12:53 -04:00
David Cooper
92c2b60d9b Signature Algorithms extension for TLSv1.2 only
Changed to only include the signature algorithms extension for TLSv1.2, since RFC 5246 says:

   Note: this extension is not meaningful for TLS versions prior to 1.2.
   Clients MUST NOT offer it if they are offering prior versions.
   However, even if clients do offer it, the rules specified in [TLSEXT]
   require servers to ignore extensions they do not understand.

Inclusion of the extension for TLS 1.1 didn't seem to cause any harm, but it seems better to follow the RFC and not include it for TLSv1.0 or TLSv1.1.
2016-05-05 17:08:40 -04:00
David Cooper
120a5c86ef Add padding extension
RFC 7685 notes that there is at least one TLS implementation that hangs if the client sends a ClientHello with a TLSCiphertext.length between 256 and 511 bytes, and so the padding extension was defined in order to get around this bug. (OpenSSL s_client includes this extension when the -bugs option is used.) So, I changed socksend_tls_clienthello() to include the padding extension if the CLientHello would have a length between 256 and 511 bytes, making the padding extension just large enough to make the ClientHello 512 bytes.

I also fixed a typo (a missing "0x") in the check for whether any ECC ciphers are included in the Client Hello.
2016-05-03 16:48:42 -04:00
David Cooper
9d1803d6eb More SSLv2 (and SSLv3) related fixes
In doing some work on cipher_pref_check() I noticed that it was failing on SSLv2 since the call to "$OPENSSL s_client" includes SNI. I've also noticed in my testing that "$OPENSSL s_client" will not connect to an SSLv2-only server unless the "-ssl2" flag is included. So, I carefully checked each call to "$OPENSSL s_client" in the program (other than in run_allciphers and run_cipher_per_proto, since those functions are already addresses in PR #341) to see whether they would inappropriate fail with an SSLv2-only (or SSLv3-only) server.

As a general rule, if the call doesn't currently include the protocol, then I added "-ssl2" if $OPTIMAL_PROTO is "-ssl2", indicating that the server only supports SSLv2, and I removed any $SNI if a protocol is specified if a protocol is specified and it is either SSLv2 or SSLv3.

I tested it on an SSLv2-only server, and the results are much better. I also tested it on a collection of other servers, none of which support SSLv2, and the results are the same as with the current code.

The only thing I haven't been able to test is how the revised code works when the "--starttls" option is used. I don't believe the changes I made would cause anything to break in that case, but I also don't think code will work any better in that case, if the server only supports SSLv2. Of course, since no server should support SSLv2 (let alone only SSLv2), it shouldn't really be an issue.

One thing that I did not change, but that I do not understand; why does determine_optimal_proto() try the protocols in the order "-tls1_2 -tls1 -ssl3 -tls1_1 -ssl2" rather than "-tls1_2 -tls1_1 -tls1 -ssl3 -ssl2"? Doesn't the current ordering imply that TLS v1.0 and SSLv3 are better than TLS v1.1?
2016-04-29 17:04:01 -04:00
David Cooper
91bab81e26 "$OPENSSL ciphers" ignores "-tls1_1" and "-tls1_2"
Versions of OpenSSL prior to 1.1.0 ignore the options "-tls1_1" and "-tls1_2". So, a call of the form "$OPENSSL ciphers -tls1_2 -V 'ALL:COMPLEMENTOFALL:@STRENGTH' would list all supported ciphers (including SSLv2 ciphers), not just ciphers appropriate for TLS1.2.

This changes the code to use "-tls1" instead of "-tls1_1" or "-tls1_2" if a version of OpenSSL other than 1.1.0 is being used.
2016-04-21 14:05:19 -04:00
Dirk Wetter
269a9e8c60 - fix LF in JSON/CSV output
- fix EV detection
2016-04-21 18:44:57 +02:00
David Cooper
cf84d69171 Fix some typos
Note: I deleted line 207, "HAS_SSL2=false", since it was a repeat of line 203.
2016-04-21 12:04:33 -04:00
Dirk
c62177044b - FIX #336 2016-04-20 18:53:04 +02:00
David Cooper
fe098d4b39 Use $HAS_SSL2
I changed the code to use the global $HAS_SSL2 rather than $sslv2_locally_supported.

I don't think there's a need to use $HAS_SSL3 in run_allciphers(), since the call to "$OPENSSL s_client" for non-SSLv2 ciphers does not specify a protocol. It's also not needed in run_cipher_per_proto(), since there is already a call to locally_supported() before anything further is done with a protocol.
2016-04-19 09:47:52 -04:00
David Cooper
7e506e5c5a More extensions in socksend_tls_clienthello()
This PR adds the signature algorithms, heartbeat, session ticket, and next protocol extensions to the client hello message created by socksend_tls_clienthello() for TLS 1.0 and above. It also adds the supported elliptic curves and ec points format extensions if the client hello message includes any ECC cipher suites.

I tested this version against several servers with $EXPERIMENTAL set to true and get the same results as with the current code with $EXPERIMENTAL set to false.
2016-04-13 15:39:12 -04:00
David Cooper
c6db49066f run_allciphers(),run_cipher_per_proto(), and SSLv2
This PR addresses two problems related to SSLv2 in run_allciphers() and run_cipher_per_proto().

In run_cipher_per_proto(), the call to "$OPENSSL s_client" is changed to that $SNI is not included if $proto is -sslv2 or -sslv3. As noted in a comment within run_prototest_openssl(), "newer openssl throw an error if SNI is supplied with SSLv2" and "SSLv3 doesn't have SNI (openssl doesn't complain though -- yet)."

run_allciphers() will sometimes incorrectly report that a server supports an SSLv2 cipher, even if the server does not support SSLv2 at all. The problem occurs if there is a supported SSLv3 cipher suite that has the same OpenSSL name as an SSLv2 cipher suite (e.g., RC4-MD5). Since the call to "$OPENSSL s_client" only uses the OpenSSL name, but the results report both the name, hexcode, and RFC cipher suite name, both the SSLv2 and SSLv3 cipher suites are reported as being supported (e.g., 0x04=RC4-MD5=TLS_RSA_WITH_RC4_128_MD5 and x010080=RC4-MD5=SSL_CK_RC4_128_WITH_MD5). This PR fixes the problem by testing SSLv2 cipher suites separately from non-SSLv2 cipher suites.
2016-04-11 15:51:53 -04:00
Dirk Wetter
199708f94c Merge pull request #335 from dcooper16/run_cipher_per_proto_speedup
run_cipher_per_proto speedup
2016-04-08 22:11:59 +02:00
David Cooper
bbb8af804e Fix typo in neat_list()
The last line of neat_list currently uses $HEXC as the parameter to show_rfc_style(), but it should use $hexcode. At the moment using $HEXC instead of $hexcode makes no difference, since hexcode="$1" and in all calls to neat_list() the first parameter is $HEXC. However, this bug could create problems in the future since neat_list() will misbehave if the value of the first parameter (hexcode) isn't the same as $HEXC.
2016-04-08 14:49:44 -04:00
David Cooper
bbcc869dec run_cipher_per_proto speedup
This PR makes basically the same changes to run_cipher_per_proto() as I previously made to run_allciphers(). The main difference is that in this function, round 0 consists of a single call to "$OPENSSL s_client" with "-cipher" including all of the locally supported ciphers. The reason for the difference is that in run_allciphers() its saves time to assume the server supports at least one cipher suite. In the case of run_cipher_per_proto(), however, it is likely that the server will not support some protocols at all, so its usually faster to start with a single call to "$OPENSSL s_client" that tests whether the server supports the protocol at all.
2016-03-31 09:38:20 -04:00
Dirk
16927f523f - NOT OK ==> NOT ok
- FIX #332 (--show-each w/o --wide)
- polishing PR #329
2016-03-30 23:28:31 +02:00
Dirk
bed1a602f1 - small hint for new chacha/poly ciphers 2016-03-29 21:56:31 +02:00
David Cooper
eac2df6d81 run_allciphers() speedup
The run_allciphers() function currently works by calling "$OPENSSL s_client" once for each cipher suite supported by $OPENSSL. In the case of "OpenSSL 1.0.2-chacha (1.0.2e-dev)" that means 195 calls to  "$OPENSSL s_client" even though servers tend to only support a small fraction of these cipher suites.

This PR produces the same output as the current run_allciphers() with fewer calls to "$OPENSSL s_client", which results in the function running faster (usually much faster). The basic idea behind the revised function is to test cipher suites in blocks. If $OPENSSL supports 195 cipher suites, then it group these cipher suites into 4 blocks of 64 (with the final block being smaller). It makes one call to "$OPENSSL s_client" with cipher suites 1-64, and if it fails, then it knows that none of these 64 cipher suites are supported by the server and it doesn't need to perform any more tests on these 64 cipher suites. If it succeeds, then it breaks the 64 cipher suites into 4 blocks of 16 and calls "$OPENSSL s_client" with each of those blocks. The blocks of 16 that are successful are broken into blocks of 4, and for each of the successful blocks of 4 the individual cipher suites are tested.

For testssl.sh and www.google.com the number of calls to "$OPENSSL s_client" is reduced from 195 to 88. For github.com the number of calls is reduced to 56!

I haven't made any changes to run_cipher_per_proto yet, but if this PR is accepted I can make the same changes in that function.

Thanks,

David
2016-03-25 10:00:50 -04:00
Dirk
dd30b8225e - FIX #324 (thx, @dawsonpaul 2016-03-21 23:03:42 +01:00
Dirk Wetter
b5b158d5b2 - BREACH missed a LF 2016-03-19 18:15:38 +01:00
Dirk
ab7f66533c - FIX #323
- add  MicrosoftSharePointTeamServices in header detection
2016-03-19 17:20:36 +01:00
Dirk Wetter
942359c8c1 - FIX #318
- minor code housekeeping
- increased amount of buffer read for sockets, real fix follows. #313
2016-03-12 17:08:43 +01:00