Commit Graph
100 Commits
Author SHA1 Message Date
David Cooper ee0279edd7 Merge branch 'master' into openss2rfc_rfc2openssl 2016-09-26 17:01:46 -04:00
David Cooper 1c3bf3e592 Merge branch 'master' into openss2rfc_rfc2openssl 2016-09-26 09:45:28 -04:00
David Cooper 73d535ebb4 Merge branch 'master' into openss2rfc_rfc2openssl
Conflicts:
	testssl.sh
2016-09-21 16:11:55 -04:00
David Cooper 63fec45f3f Merge branch 'master' into openss2rfc_rfc2openssl 2016-09-14 14:36:15 -04:00
David CooperandGitHub 7932d34fda Updates to cipher suite table
Changed `Enc=CHACHA20/POLY1305(256)` to `Enc=ChaCha20(256)` and `Enc=GOST-28178-89-CNT(256)` to `Enc=GOST(256)` in order to shorten the names that are printed, so that they fit in the allocated column.

Added the four experimental post-quantum cipher suites mentioned in #462.
2016-09-06 14:47:20 -04:00
David Cooper 950b39122e Merge branch 'master' into openss2rfc_rfc2openssl 2016-09-06 10:34:53 -04:00
David Cooper f17a09e1d9 Merge branch 'master' into openss2rfc_rfc2openssl 2016-09-02 10:47:36 -04:00
David CooperandGitHub a9002ba6e6 Fix tls_sockets() when SNI empty
`socksend_tls_clienthello()` always includes a server name extension in the ClientHello (for TLS 1.0 and above), even if `$SNI` is empty. If `$NODE` is an IP address, then the IP address is placed in the extension, even though RFC 6066 says that only DNS names are supported in the extension.

This PR changes `socksend_tls_clienthello()` so that the server name extension is only included in the ClientHello is `$SNI` is not empty.
2016-09-01 13:22:39 -04:00
David Cooper 59d4acec11 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-09-01 10:56:57 -04:00
David Cooper e10d256ae6 Merge branch 'master' into openss2rfc_rfc2openssl 2016-09-01 10:55:29 -04:00
David CooperandGitHub e79e980336 Display SNI information in "Server Certificate" line
This PR is an attempt to address issue #447. If more than one certificate is being displayed, then a parenthetical saying "(in response to request w/o SNI)" is added for any certificate that was obtained using `$SNI=""`.

In addition, if the certificate was obtained without SNI, then `certificate_info()` doesn't call `$OPENSSL s_client` in order to obtain the non-SNI host certificate and it does not display a separate "Trust (hostname)" finding for the non-SNI certificate.
2016-08-30 15:22:46 -04:00
David Cooper f88ad58e72 Merge branch 'master' into openss2rfc_rfc2openssl 2016-08-29 15:03:35 -04:00
David Cooper 6e6fdf6410 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-08-29 15:02:40 -04:00
David Cooper 957225595f Merge branch 'master' into unsupported_purpose 2016-08-29 10:17:27 -04:00
David Cooper 01391e318a Merge branch 'master' into openss2rfc_rfc2openssl 2016-08-29 10:00:18 -04:00
David Cooper 97b8dd1959 Merge branch 'master' into more_sslv2_sslv3_fixes
Conflicts:
	testssl.sh
2016-08-29 09:57:36 -04:00
David CooperandGitHub 98dc3bfadb Support DH server keys
When `certificate_info()` is given a certificate with a DH public key it displays something like:
```
   Server key size              fixme:  dhKeyAgreement 3072 bits (FIXME: can't tell whether this is good or not)
```

This PR fixes that so that the output is:
```
   Server key size              DH 3072 bits
```
2016-08-25 15:23:53 -04:00
David CooperandGitHub aeba340dcb Output correct error for unsupported certificate purpose
This PR is in response to issue #454. I tried repeating the reported problem by creating a certificate in which the extendedKeyUsage extension was present and only included the anyExtendedKeyUsage OID. In running the test, I discovered two problems.

First, when `determine_trust()` is calling `verify_retcode_helper()` to display the reason that path validation failed, it assumes that there are at least two certificate bundles provided. (I was running the test using just one certificate bundle, containing my local root.) So, I changed `determine_trust()` to use `${verify_retcode[1]}` rather than `${verify_retcode[2]}` in the case that all bundles failed (it seems that 2 vs. 1 was an arbitrary choice).

Once that was fixed, testssl.sh output "NOT ok  (unknown, pls report) 26". So, the second thing this PR fixes is to output "NOT ok (unsupported certificate purpose)" if OpenSSL responds with an unsupported certificate purpose error.
2016-08-25 11:41:16 -04:00
David CooperandGitHub 12e3a3314a OpenSSL 1.1.0 doesn't have "-no_ssl2" option
With OpenSSL 1.1.0, `s_client -no_ssl2` fails with an "unknown option" error. At the moment the `-no_ssl2` option is only used in two functions, `run_client_simulation()` and `run_crime()`. In `run_crime()`, the `-no_ssl2` option is only included if the OpenSSL version is 0.9.8.

This PR checks whether the OpenSSL version in use supports the `-no_ssl2` option, and if it doesn't, it removes it from the calls to `s_client` in `run_client_simulation()`.
2016-08-24 10:14:12 -04:00
David CooperandGitHub 7cfe97f23a Warning on BEAST when no local SSLv3 support
If the version of OpenSSL being used doesn't support `s_client -ssl3` (e.g., OpenSSL 1.1.0), `run_beast()` doesn't display a warning that testing for CBC in SSLv3 isn't locally supported.

This PR adds a "Local problem" warning if the OpenSSL being used doesn't support `s_client -ssl3`.
2016-08-23 12:37:22 -04:00
David CooperandGitHub 0fcb2bcb44 Fix SSLv2-only test in determine_optimal_proto()
The test for whether a server only supports SSLv2 was broken, since `$OPTIMAL_PROTO` will be `-ssl2` whether SSLv2 is the only protocol that succeeds or no protocol succeeds.

This PR sets $OPTIMAL_PROTO (or $STARTTLS_OPTIMAL_PROTO) to "" if no protocol succeeds.
2016-08-23 12:29:31 -04:00
David CooperandGitHub 38abfeb1e5 Return 0 even if test couldn't be performed 2016-08-23 11:35:03 -04:00
David CooperandGitHub 7dd1d15e9a run_ssl_poodle() when OpenSSL doesn't support SSLv3
If the version of OpenSSL being used doesn't support `s_client -ssl3` (e.g., OpenSSL 1.1.0), `run_ssl_poodle()` displays `not vulnerable (OK)` even though it can't test whether the server is vulnerable.

This PR fixes it so that a "Local problem" warning is displayed is `s_client -ssl3` isn't supported.

The PR also removes the `$SNI` from the call to `$OPENSSL s_client` since OpenSSL ignores the `-servername` directive for `-ssl3` anyways.
2016-08-23 11:31:04 -04:00
David CooperandGitHub 2b7a77979c Fix "--devel" with SSLv2
If testssl.sh is called with `--devel 22` and the response from `sslv2_sockets()` is not 0, then `tls_sockets()` will be called, and the result of the `tls_sockets()` command will be output rather than the result of the `sslv2_sockets()` command.
2016-08-11 14:40:20 -04:00
David CooperandGitHub 358a4082e8 Move printing of results out of sslv2_sockets()
This PR addresses the "FIXME" in `run_protocols()`:
```
      sslv2_sockets                                                    #FIXME: messages/output need to be moved to this (higher) level
```
It also changes `run_drown()` to call `sslv2_sockets()` in order to avoid duplicate code.
2016-08-11 14:16:33 -04:00
David Cooper ba74740613 Merge branch 'master' into server_preference_sslv2_fixes 2016-08-09 10:52:11 -04:00
David Cooper 7a5d698416 Merge branch 'master' into openss2rfc_rfc2openssl 2016-08-09 10:50:37 -04:00
David Cooper 8a7827436d Merge branch 'master' into more_sslv2_sslv3_fixes 2016-08-09 10:48:49 -04:00
David Cooper f9a4ab51b2 Merge branch 'master' into server_preference_sslv2_fixes 2016-07-26 13:36:15 -04:00
David Cooper 1a091c1a9a Merge branch 'master' into openss2rfc_rfc2openssl 2016-07-26 13:35:11 -04:00
David Cooper 1add0f86f9 Merge branch 'master' into more_sslv2_sslv3_fixes
Conflicts:
	testssl.sh
2016-07-26 13:33:49 -04:00
David CooperandGitHub 746eab7f6b Fix two minor typos
Fixes for two minor typos that were previously included in PR #345.
2016-07-26 12:07:08 -04:00
David CooperandGitHub 72bbdbf49b Remove fixes for minor typos 2016-07-26 12:00:46 -04:00
David CooperandGitHub 4ed1f2fc11 Don't ignore response to old OpenSSL warning
In the check for old versions of OpenSSL, the results of the call to `ignore_no_or_lame()` are ignored, and so the program continues even if the user enters `no`.
2016-07-26 11:29:25 -04:00
David CooperandGitHub bc6367d3ad Update testssl.sh 2016-07-26 11:21:23 -04:00
David CooperandGitHub b43562aabf Update testssl.sh 2016-07-26 11:13:45 -04:00
David CooperandGitHub 23d311b1fc SSLv2 fixes for determine_optimal_proto()
This PR makes three changes to `determine_optimal_proto()`:
* It no longer tries an empty string for `$OPTIMAL_PROTO` twice.
* It does not include `-servername` for `-ssl2` or `-ssl3`, since some versions of OpenSSL that support SSLv2 will fail if `s_client` is provided both the `-ssl2` and `-servername` options.
* It displays a warning if `$OPTIMAL_PROTO` is `-ssl2`, since some tests in testssl.sh will not work correctly for SSLv2-only servers.
2016-07-26 11:10:20 -04:00
David CooperandGitHub e9a2d27af3 Remove determine_optimal_proto() fix 2016-07-26 11:04:43 -04:00
David CooperandGitHub d67fff3223 SSLv2 fixes for server preference
This PR addresses two issues related to SSLv2 for "--server-preference" checks.

First, some versions of OpenSSL that support SSLv2 will fail if `s_client` is provided both the `-ssl2` and `-servername` options.

Second, the line for extracting the chosen cipher,`cipher=$(awk '/Cipher.*:/ { print $3 }' $TMPFILE)`, fails for SSLv2. For SSLv2, the output from `$OPENSSL s_client` is as shown below, and the `cipher=` line extracts the word `between` from `Ciphers common between both SSL endpoints:` rather than `IDEA-CBC-MD5` from `   Cipher    : IDEA-CBC-MD5`.

```
...
Ciphers common between both SSL endpoints:                                                                                                                                                                   
RC4-MD5         RC2-CBC-MD5     IDEA-CBC-MD5                                                                                                                                                                 
DES-CBC-MD5     DES-CBC3-MD5                                                                                                                                                                                 
---                                                                                                                                                                                                          
SSL handshake has read 1191 bytes and written 373 bytes                                                                                                                                                      
---                                                                                                                                                                                                          
New, SSLv2, Cipher is IDEA-CBC-MD5                                                                                                                                                                           
Server public key is 2048 bit                                                                                                                                                                                
Secure Renegotiation IS NOT supported                                                                                                                                                                        
Compression: NONE                                                                                                                                                                                            
Expansion: NONE                                                                                                                                                                                              
No ALPN negotiated                                                                                                                                                                                           
SSL-Session:                                                                                                                                                                                                 
    Protocol  : SSLv2                                                                                                                                                                                        
    Cipher    : IDEA-CBC-MD5
...
```
2016-07-26 10:22:36 -04:00
David CooperandGitHub 93ba2e5d65 Remove some server preference fixes 2016-07-26 10:11:22 -04:00
David Cooper 46323602b1 Merge branch 'master' into openss2rfc_rfc2openssl 2016-07-26 08:51:10 -04:00
David Cooper 6bd6b8959c Merge branch 'master' into more_sslv2_sslv3_fixes 2016-07-26 08:48:01 -04:00
David CooperandGitHub add75caf82 SSLv2 fixes for test_just_one()
This PR changes test_just_one() to correctly handle SSLv2 ciphers.

As with PR #424, this PR addresses the problem in which servers that do not implement SSLv2, but that implement RC4-MD5, EXP-RC2-CBC-MD5, EXP-RC4-MD5, or NULL-MD5 are shown as implementing both the SSLv2 and SSLv3 versions of the ciphers, and that any SSLv2 ciphers that a server does implement are not shown as being implemented.
2016-07-25 17:00:49 -04:00
David CooperandGitHub db0a6db620 Remove fixes for test_just_one() 2016-07-25 16:54:19 -04:00
David CooperandGitHub 43d5ad5071 SSLv2 fixes for run_rc4()
This PR changes run_rc4() to correctly handle SSLv2 ciphers.

It addresses the problem in which servers that do not implement SSLv2, but that implement SSLv3 ciphers that share an OpenSSL name with an SSLv2 cipher (RC4-MD5 and EXP-RC4-MD5), are not incorrectly shown as having implemented the SSLv2 cipher.

It also addresses the problem that if a server does implement SSLv2 with an RC4 SSLv2-cipher suite, then that cipher suite it not shown as being implemented.
2016-07-25 16:42:04 -04:00
David CooperandGitHub d2f1e15243 Remove fixes for run_rc4() 2016-07-25 16:30:30 -04:00
David Cooper b142962063 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-07-25 16:24:35 -04:00
David Cooper bb29e3c917 Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-07-25 09:39:28 -04:00
David Cooper 6d164d8a2e Merge branch 'master' into openss2rfc_rfc2openssl 2016-07-25 09:38:05 -04:00
David Cooper 36a3230b84 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-07-25 09:36:50 -04:00
David CooperandGitHub ae38670067 Fix check for self-signed certificate
The check for whether a certificate is self-signed was using the undefined variable $CN rather than $cn.
2016-07-22 12:06:52 -04:00
David CooperandGitHub 59002c1088 Update JSON id for chain-of-trust 2016-07-22 11:57:16 -04:00
David CooperandGitHub df64e47fb9 CN <--> hostname match
PR to address issue #94 (CN <--> hostname match)
2016-07-22 11:31:52 -04:00
David Cooper 603ed33f57 Merge branch 'master' into version_negotiation 2016-07-20 13:39:11 -04:00
David Cooper 6730ed8340 Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-07-20 13:37:54 -04:00
David Cooper 89df7c5ec2 Merge branch 'master' into openss2rfc_rfc2openssl 2016-07-20 13:36:12 -04:00
David Cooper e8d10a5e05 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-07-20 13:34:39 -04:00
David Cooper bdea1a0971 Merge branch 'master' into issuer2
Conflicts:
	testssl.sh
2016-07-20 11:45:08 -04:00
David CooperandGitHub 346c52dc7c CA names with domain component attributes
`certificate_info()` does not correctly display the Issuer name for CAs that use domain component attributes.

There is a server on the NIST intra-net that I test against that has a certificate issued by a NIST CA, and the issuer name in the certificate is of the form: `/DC=net/DC=example/DC=internal/CN=CAname`

Since there is no organizational name, testssl.sh displays the name as:
```
 Issuer                       "CAname" ("")
```
In this PR, if the Issuer name has 'DC=' attributes, but does not have an 'O=' attribute, the "DC=" attributes are combined into a DNS name that is used as if it were the organizational name:
```
 Issuer                       "CAname" ("internal.example.net")
```
I should note, however, that I have not been able to find any other examples of TLS server certificates that have been issued by CAs that have domain components ("DC=") in their names. So, it may not be worthwhile to change the code to try to accommodate such CAs.
2016-07-20 11:37:51 -04:00
David CooperandGitHub d9f8024d9a Fix JSON output of Issuer name
`certificate_info()` currently outputs `$issuer` to the JSON file, where is should be outputting `$issuer_CN` in order for the information in the JSON file to match the information that is displayed.

This PR also fixes the problem that if an Issuer name contains a domain component attribute (DC=) then it will be mistakenly treated as a country attribute (C=).
2016-07-20 10:50:38 -04:00
David CooperandGitHub a06ac81df3 Speed up finding supported curves
Rather than try each curve one at a time, follow model in `cipher_pref_check()`.  First include all curves in ClientHello, then successively remove from the ClientHello those curves that have been offered by the server until the connection fails. This makes the number of calls to `$OPENSSL s_client` one more than the number of supported curves rather than the number of curves in NamedCurve supported by $OPENSSL.

Note, however, that OpenSSL defines MAX_CURVELIST as 28 and fails if the `-curves` option includes more than 28 curves. Since OpenSSL 1.1.0 offers 29 curves from NamedCurve, this PR breaks the list of supported curves in 2. At the cost of one additional calls to `$OPENSSL s_client` it ensures that the number of curves provides to the `-curves` option is below the limit.
2016-07-14 13:23:50 -04:00
David CooperandGitHub 891c56f8bf Determine support elliptic curves for ECDHE- ciphers
This PR extends run_pfs() to display the set of elliptic curves supported by the server, if the server supports any ECDHE- ciphers.
2016-07-11 11:00:56 -04:00
David CooperandGitHub fb94221ce0 Reorder supported curves
Reorder the supported curves sent by socksend_tls_clienthello() from strongest to weakest.
2016-07-11 10:52:48 -04:00
David Cooper f968bd8346 Merge branch 'master' into version_negotiation 2016-07-11 10:45:59 -04:00
David Cooper 197bee8658 Merge branch 'master' into run_allciphers(),run_cipher_per_proto(),-and-SSLv2 2016-07-11 10:44:37 -04:00
David Cooper c6373a181f Merge branch 'master' into openss2rfc_rfc2openssl 2016-07-11 10:43:35 -04:00
David Cooper 08953416e8 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-07-11 10:42:28 -04:00
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 dfa92445ee Merge branch 'master' into openss2rfc_rfc2openssl 2016-07-08 09:37:09 -04:00
David Cooper 788042ba37 Merge branch 'master' into more_sslv2_sslv3_fixes 2016-07-08 09:35:52 -04:00
David CooperandGitHub 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 ad92ca8519 Merge branch 'master' into openss2rfc_rfc2openssl 2016-07-05 10:21:30 -04:00
David Cooper 6ec00c33db Merge branch 'master' into more_sslv2_sslv3_fixes
Conflicts:
	testssl.sh
2016-07-05 10:19:53 -04:00
David CooperandGitHub a8f3223100 Fix typo
Fix typo in parsing $CIPHERS_BY_STRENGTH_FILE.
2016-06-30 13:50:47 -04: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 c4d6f3fb58 Merge branch 'master' into openss2rfc_rfc2openssl
Conflicts:
	testssl.sh
2016-06-29 09:59:52 -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
David CooperandGitHub 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 CooperandGitHub 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 d30dbe3c41 Merge branch 'master' into openss2rfc_rfc2openssl 2016-06-24 13:25:11 -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
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 549d432dc7 Merge branch 'master' into openss2rfc_rfc2openssl 2016-06-23 09:38:04 -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
David CooperandGitHub 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 5a5424653b Merge branch 'master' into openss2rfc_rfc2openssl
Conflicts:
	testssl.sh
2016-06-17 16:16:38 -04:00