1
0
mirror of https://github.com/drwetter/testssl.sh.git synced 2025-07-18 19:51:45 +02:00
Commit Graph

3917 Commits

Author SHA1 Message Date
dc074ebdf1 Merge pull request from dcooper16/improve_cipher_pref_check
Improve cipher_pref_check()
2021-10-26 20:40:58 +02:00
2b752feea0 Remove unnecessary quotes 2021-10-26 12:05:36 -04:00
4536e933f9 Improve cipher_pref_check()
Some servers are configured to prioritize ChaCha ciphers if those ciphers are preferred by the client, even if the server is generally configured to use the server's cipher preferences rather than the client's. As a result of this, if a ChaCha cipher appears in the ClientHello before a non-ChaCha cipher, the server may select the ChaCha cipher even if the server is configured to prefer the non-ChaCha cipher.

In a few cases, e.g., cloudflare.com for TLS 1.2, this affects the ordering of the ciphers presented by cipher_pref_check(). This commit fixes the problem by having cipher_pref_check() (and check_tls12_pref()) always place any ChaCha ciphers at the end of the cipher list in the ClientHello. This ensures that cipher_pref_check() presents the ciphers in the server's preference order.
2021-10-25 14:28:51 -04:00
1a66155c4a Merge pull request from dcooper16/fix_s_client_options
Fix s_client_options()
2021-10-25 19:02:07 +02:00
00fb68f47c Fix s_client_options()
This commit fixes an error in s_client_options() when the function is called with an empty "-cipher" list and $OPENSSL supports "@SECLEVEL". This happens, for example, when ciphers_by_strength() is called for TLS 1.3.

The call to `openssl s_client` will fail is the cipher option is provided with an empty list or a list that just contains "@SECLEVEL=0". So, "@SECLEVEL=0" should only be added if the "$ciphers" list is non-empty. If "$ciphers" remains empty, then the "-cipher" option will not be added to the command line.
2021-10-25 12:15:13 -04:00
e36cfffb2c Merge pull request from drwetter/improve_precheck_curves
Improve precheck for curves
2021-10-23 23:02:21 +02:00
31162d2320 typo / wording 2021-10-23 18:40:29 +02:00
a11bd1585e Improvement for testing curves with several openssl / libressl versions
As noted in  the detection of curves in find_openssl_binary()
copuld be improved.

This commit removes another connect call. Also it corrects the port statement
for LibreSSL-like pre-checks as port 0 generally seems to me better suited.
Inline documentation was added.

It worked so far with openssl 1.0.2, 1.1.1 and 3.0 and LibreSSL 3.4.

This needs to be backported to 3.0.
2021-10-23 18:38:04 +02:00
6251a6c1d6 Merge pull request from drwetter/fix_double_ports
Fix double ports statement
2021-10-23 16:02:04 +02:00
82fc8e7431 Update feature_request.md 2021-10-21 11:01:13 +02:00
d5e761e9e9 Update bug_report.md 2021-10-21 11:00:44 +02:00
93c1180f9d Update feature_request.md 2021-10-21 10:56:27 +02:00
ff919df2e0 Update bug_report.md 2021-10-21 10:52:34 +02:00
489b63e9dd Merge pull request from drwetter/cab_is4browsers
Add browser requirement for the entropy of cert serial
2021-10-21 09:51:00 +02:00
110d1aa73c Add browser requirement for the entropy of cert serial 2021-10-20 19:26:23 +02:00
3140352b0c Fix double ports statement
In order to be in line with 3.0 this adds a statement to avoid double port
statements for WSL users in a precheck condition

   $OPENSSL s_client -groups $curve -connect 127.0.0.1:0:8443

This commit changes that to $OPENSSL s_client -groups $curve -connect 127.0.0.1:8443
which could cause a delay for WSL users and needs further investigation.

Not clear why port 8443 was chosen.
2021-10-20 09:01:09 +02:00
79df758023 Merge pull request from drwetter/fix_len_certserialnum
Check cert serial len + fix output when too big
2021-10-20 08:58:46 +02:00
2edfa57eaa Check cert serial len + fix output when too big
OpenSSL shows certificate serial numbers >35 with a LF (0A). Testssl.sh
just output that which makes JSON invalid and displays the LF in the terminal
too.

This commit fixes that () by adding filters so that the
serialnumber is not a multiline string.

Also this commit introduces a new function: a size check of the cert serial.
Below 8 bytes the CAB Forum's lower limit is hit which says the *entropy*
from a CSPRNG should be at least 64 bits. It is assumed that below 8 bytes
length this requirement isn't possible to meet (needs to be clarified with
Shannon, 8 bytes seems to low to me).
  The high threshold is according to RFC 5280, Section-4.1.2.2 .

See also .

The output has changed, so that on the terminal the serial has one line,
SHA1 and SHA256 each one line. The new json key is "cert_serialNumberLen".
2021-10-19 19:42:12 +02:00
9683af44a2 Merge pull request from drwetter/windows_dns_fix
Addressing lame DNS responses on WSL
2021-10-18 16:52:35 +02:00
d496c0d44b Merge pull request from smokris/1995-trusted-first
In determine_trust(), use the OpenSSL '-trusted_first' flag to ignore the now-expired DST Root CA X3 root certificate
2021-10-07 18:03:20 +02:00
5c4500ea4f Initialize/reset the TRUSTED1ST variable, in case determine_optimal_proto() changes the active openssl binary partway through execution 2021-10-06 16:01:13 -04:00
0012adf47e Add a test to verify that expired.badssl.com's chain of trust is expired. 2021-10-05 13:53:58 -04:00
c98bbdc36d In determine_trust(), use the OpenSSL '-trusted_first' flag to ignore the now-expired DST Root CA X3 root certificate. Fixes . 2021-10-05 13:45:26 -04:00
d720720150 Merge pull request from drwetter/fix_1992_certificateIssuerName
Fix invalid JSON when certificate issuer contains non-ASCII chars
2021-10-03 19:52:35 +02:00
a5aa3a4bbf Fix invalid JSON when certificate issuer contains non-ASCII chars
Changed printf %s to printf %b which cause now to output
UTF-8 correctly.

See 
2021-10-03 18:19:24 +02:00
b6b5a67b92 Save # of connects / WSL uses 127.0.0.1:0 by default
In order to save time and to spare WSL users lame DNS lookups
I removed a couple of connect calls from 14 to 4:

$OPENSSL s_client -ssl2 -connect invalid.
-->
OPENSSL s_client -ssl2

NXCONNECT to localhost IP and port 0 is now the default when WSL
is detected. Not sure whether this is working under all circumstances,
so this needs some testing.
2021-10-02 15:25:42 +02:00
068e07c52c Merge pull request from mig5/fix-letsencrypt-remove-dst-root-x3-ca-cert
Remove the expired DST Root CA X3 cert from all trust stores, and ensure Mozilla's is up to date (fixes ISRG X1 alternate path)
2021-10-02 08:38:34 +02:00
bab14124c1 Merge pull request from drwetter/revert-1998-1995-trusted-first
Revert "In determine_trust(), use the OpenSSL '-trusted_first' flag to ignore the now-expired DST Root CA X3 root certificate"
2021-10-02 08:34:07 +02:00
e874c1013b Revert "In determine_trust(), use the OpenSSL '-trusted_first' flag to ignore the now-expired DST Root CA X3 root certificate" 2021-10-02 08:33:39 +02:00
624e934f77 Merge pull request from smokris/1995-trusted-first
In determine_trust(), use the OpenSSL '-trusted_first' flag to ignore the now-expired DST Root CA X3 root certificate
2021-10-02 08:33:03 +02:00
905f801309 Remove the expired DST Root CA X3 cert from all trust stores, and ensure Mozilla's is up to date (fixes ISRG X1 alternate path)
Remove changes to Dockerfiles

Update hashes for CA trust stores
2021-10-02 08:05:56 +10:00
b0754ce0f1 In determine_trust(), use the OpenSSL '-trusted_first' flag to ignore the now-expired DST Root CA X3 root certificate. Fixes . 2021-10-01 16:24:04 -04:00
667c6e698c Merge pull request from dcooper16/fix_md_formatting
Update testssl.1.md
2021-10-01 18:02:03 +02:00
8b129577a7 Update testssl.1.md
testssl.1.md included '.SS "SINGLE CHECK OPTIONS"', which belongs in testssl.1, but not in testssl.1.md. This commit removes this extra line.
2021-09-30 14:09:17 -04:00
b8bff805f7 Merge pull request from klaernie/contenttype
fix html output content type header
2021-09-24 14:21:04 +02:00
4f72f2fa8e fix html output content type header 2021-09-24 11:36:29 +02:00
ae21ef7eab Merge pull request from drwetter/fix_1982_kali.cnf
Fix : Newer openssl.cnf break openssl detection
2021-09-15 11:19:05 +02:00
fe6c22f7fd Addressing lame DNS responses on WSL (WIP)
This commit provides a global variable to the RFC 6761 use of "invalid."
which WSL clients doen't seem to handle very well, see , .

With this commit it e.g. is possible to use

     NXCONNECT=localhost:0 ./testssl.sh <TARGET>

to save some time.

This commit will be amended later.
2021-09-15 09:53:20 +02:00
2405176a26 Fix : Newer openssl.cnf break openssl detection
Newer configuration files from openssl may include statements
which aren't compatible with our supplied old openssl version.
This commit adds an autodetection of such a file and uses a
openssl.cnf provided by this project then.
2021-09-15 09:31:03 +02:00
3207357e8c Merge pull request from DimitriPapadopoulos/codespell
Typos found by codespell
2021-09-14 13:37:59 +02:00
fcb282e3c3 Typos found by codespell
Run codespell in CI
2021-09-14 13:33:39 +02:00
3dddcbf445 Merge pull request from drwetter/drwetter-patch-1
Update bug_report.md
2021-09-10 18:37:43 +02:00
611754165f Merge pull request from drwetter/drwetter-patch-2
Update feature_request.md
2021-09-10 18:37:17 +02:00
5fc23932ac Update feature_request.md 2021-09-10 18:37:02 +02:00
2f173de7e0 Update bug_report.md 2021-09-10 18:33:39 +02:00
1d4acd9027 Merge pull request from drwetter/fix_1978
Fix minor inconsistency in description of cipher categories
2021-09-10 08:09:21 +02:00
529e9da823 Fix GHA (starttls nntp)
using another IP
2021-09-09 23:17:09 +02:00
15cfd849fe Replace --standard by --categories 2021-09-09 22:07:44 +02:00
739f45015f Fix minor inconsistency in description of cipher categories
A longer while back the section ~ "Testing standard ciphers" was
renamed to "Testing cipher categories". However the internal help
didn't reflect that.

This fixes that, including an addtion to the documentation.

Note: the help still lists "-s --std, --standard" as a cmd line
switch.
2021-09-08 08:46:47 +02:00
8f20d11830 Merge pull request from ap-wtioit/3.1dev-fix_dig_r_check
Fix dig -r check to only run if dig is available
2021-09-06 10:19:41 +02:00