Commit Graph

3534 Commits

Author SHA1 Message Date
David Cooper
aaf7bf8505 Backport #2157, #2160, #2162
This commit backports PR #2157, #2160, and #2162 from the 3.1dev branch to the 3.0 branch.
2022-05-02 10:33:07 -04:00
Dirk Wetter
793eaa3f84
Merge pull request #2165 from drwetter/ftp_starttls_auth_only_3.0
Relax STARTTLS FTP requirement (3.0)
2022-04-28 07:30:51 +02:00
Dirk
405f431612 Relax STARTTLS FTP requirement (3.0)
In rare? occassions where the STARTTLS FEAT request only displays AUTH instead
of AUTH TLS, testssl.sh fails as it cannot upgrade to TLS.

Required by RFC 4217 is only AUTH ("MUST"), AUTH TLS is optional ("should"), see section 6.
This PR relaxes the presence of TLS after AUTH and fixes #2132 for the 3.0 branch.
2022-04-27 14:52:46 +02:00
Dirk Wetter
2eac75d5b5
Merge pull request #2155 from dcooper16/server_pref_no_default_protocol_30
Fix run_server_preference() with no default protocol
2022-04-24 18:12:19 +02:00
David Cooper
93711f3d30 Fix run_server_preference() with no default protocol
run_server_preference() calls "default_proto=$(get_protocol $TMPFILE)" even if all attempts to connect to the server failed. This will result in default_proto incorrectly being set to TLS 1.2. This commit fixes the issue by only calling get_protocol() if an attempt to connect to the server was successful.
2022-04-14 12:29:21 -04:00
Dirk Wetter
0047e1f153
Merge pull request #2153 from dcooper16/no_session_id_30
Fix setting NO_SESSION_ID
2022-04-14 18:08:53 +02:00
Dirk Wetter
55785afb5e
Merge pull request #2152 from dcooper16/fix2147_30
Fix getting CRL
2022-04-14 18:07:29 +02:00
David Cooper
0d596e208b
Fix setting NO_SESSION_ID
With a TLS 1.3 connection, a session ID will only appears as part of a post-handshake session ticket. However, with OpenSSL 1.1.1 or newer when using $OPENSSL s_client as it is called in determine_optimal_proto() (i.e., with "< /dev/null"), a post-handshake session ticket will usually not be received, even if the server supports it. With versions of LibreSSL that support TLS 1.3, a post-handshake session ticket is never displayed (even without "< /dev/null"). This can result in NO_SESSION_ID incorrectly being set to true.

This commit fixes the issue by setting NO_SESSION_ID to true by default, and then setting it to false if a session ID is returned by any connection to the server.
2022-04-14 09:40:41 -04:00
David Cooper
6e6b8731c9
Fix getting CRL
OpenSSL 3.X pretty prints certificates in a slightly different way than previous versions, and this breaks the code for getting the URIs from the CRLDP extension.
This commit fixes the issue by having awk search for additional possible strings to start the CRL Distribution Points output. Unless the CRLDP extension is malformed, it will begin with "Full Name", "Relative Name", "Reasons", or "CRL Issuer".
2022-04-14 08:31:57 -04:00
Dirk Wetter
a47bc2097e
Merge pull request #2146 from dcooper16/ossl3_fix_30
More OpenSSL compatibility fixes
2022-04-12 18:51:06 +02:00
David Cooper
6b5ce68d1a
More OpenSSL compatibility fixes
This commit fixes yet another issue with using OpenSSL 3.X with the 3.0 branch. When $OPENSSL is used to obtain a fingerprint, OpenSSL 3.X prepends the fingerprint with "sha1" or "sha256" rather than "SHA1" or "SHA256".
2022-04-11 13:36:56 -04:00
Dirk Wetter
395907a79f
Merge pull request #2144 from dcooper16/ossl3_compat_30
OpenSSL compatibility fix
2022-04-07 21:34:30 +02:00
Dirk Wetter
4a5d93dad6
Merge pull request #2143 from dcooper16/fix2138_30
Fix #2138 in 3.0 branch
2022-04-07 21:27:32 +02:00
David Cooper
cd89134338
OpenSSL compatibility fix
OpenSSL 3.0.X uses different names for some elliptic cures in the "Server Temp Key" line than previous previous versions. This commit addresses this issue by checking for both names.
2022-04-07 14:31:40 -04:00
David Cooper
5b26b9931b
Fix #2138 in 3.0 branch
This commit fixes #2138 in the 3.0 branch.
2022-04-07 14:09:16 -04:00
Dirk
bc2c8d6eaa Remove trailing spaces to get rid of failing status of CI 2022-04-01 18:07:19 +02:00
Dirk Wetter
25ef6dc2ca
Merge pull request #2136 from drwetter/drwetter-patch-1
fix markup of roff in doc/
2022-04-01 14:38:17 +02:00
Dirk Wetter
68a35b7610
fix markup of roff in doc/ 2022-04-01 14:37:30 +02:00
Dirk Wetter
1f846f73d8
Merge pull request #2135 from drwetter/drwetter-patch-1
docs --> doc
2022-04-01 14:13:20 +02:00
Dirk Wetter
084990a890
docs --> doc
fix wrong dir for CI
2022-04-01 14:12:56 +02:00
Dirk Wetter
2078ca52a8
Merge pull request #2134 from drwetter/2074_md_fixes.3.0
Implement fixes in documentation from #2074 (3.0)
2022-04-01 14:08:45 +02:00
Dirk
61c4aa2cb7 Implement fixes in documentation from #2074 (3.0)
kudos @k0lter

  * numbering
  * some ticks / backticks
2022-04-01 14:03:06 +02:00
Dirk Wetter
7733140e6e
Merge pull request #2126 from drwetter/drwetter-patch-1
Remove reference to fixed 3.0.x version
2022-03-16 17:00:17 +01:00
Dirk Wetter
9e14cbf255
Remove reference to fixed 3.0.x version 2022-03-16 16:59:50 +01:00
Dirk Wetter
21fdf5f2de
Merge pull request #2121 from dcooper16/ffdhe_supported_groups
Add FFDHE groups to supported_groups
2022-03-09 22:08:44 +01:00
David Cooper
61bbfb4489
Add FFDHE groups to supported_groups
There is at least one server that will not negotiate TLS_DHE_* cipher suites with TLS 1.2 and below if the supported_groups extension is present but does not include any DH groups. This commit adds the DH groups that are currently in the TLS 1.3 ClientHello to the TLS 1.2 and earlier ClientHello.
2022-03-09 15:19:33 -05:00
Dirk Wetter
5e9ee13780
Merge pull request #2119 from dcooper16/rsapss
Include RSA-PSS in ClientHello
2022-03-09 14:14:44 +01:00
David Cooper
f5e75054d3
Include RSA-PSS in ClientHello
This commit changes prepare_tls_clienthello() so that the RSA-PSS algorithms are offered in the signature algorithms extension of TLS 1.2 and below ClientHello messages.
2022-03-09 07:45:52 -05:00
Dirk Wetter
5bd2952108
Merge pull request #2109 from drwetter/bump_version_3.0
Bump version in 3.0 branch
2022-02-19 14:38:16 +01:00
Dirk Wetter
06821e31ff Codespell 2022-02-19 14:37:14 +01:00
Dirk Wetter
7729fd1267 Add a few items 2022-02-19 14:28:24 +01:00
Dirk Wetter
c6dce9d8b3 Bump patch version number 2022-02-17 09:10:41 +01:00
Dirk Wetter
f96df1138b
Merge pull request #2107 from drwetter/fix_2096.3.0
Fix "ID resumption test failed" under Darwin (3.0)
2022-02-17 09:04:57 +01:00
Dirk Wetter
93b9a37c0c Fix "ID resumption test failed" under Darwin (3.0)
Under Darwin using LibreSSL it was not possible to test for session
resumption by session ID.

This fixes the issue #2096 for 3.0 by checking not only the return value of the
s_client hello but also whether a probable certificate is being returned.
2022-02-16 23:18:04 +01:00
Dirk Wetter
de0f4f7a7e
Merge pull request #2104 from drwetter/fix_2103
Fix JSON output bc of missing locale in alpine (3.0)
2022-02-16 12:18:26 +01:00
Dirk Wetter
c511319683 Fix JSON output bc of missing locale in alpine (3.0)
It is now being tested whether the binary locale exists and
there's a global introduced for that.

Also there's no fileout warning at this early stage anymore
as it leads to non-valid JSON
2022-02-16 10:45:12 +01:00
Dirk Wetter
a385339b10
Merge pull request #2102 from drwetter/fix_2100_3.0
Fix locale error message when en_US.UTF-8 isn't available (3.0)
2022-02-15 11:10:53 +01:00
Dirk Wetter
f872bd5e3e fix typo 2022-02-14 19:54:08 +01:00
Dirk Wetter
f149c7450a Fix locale error message when en_US.UTF-8 isn't available (3.0)
Therefore a new global function was declared checking whether any of
the known locales work on the client without seeting them.
C / POSIX should work as well for LC_COLLATE.

This fixes #2100 for 3.0 .
2022-02-14 19:52:14 +01:00
Dirk Wetter
8b2fae0e3b
Merge pull request #2095 from drwetter/fix_2052.Darwin.3.0
Fix Darwin / LibreSSL startup problem (3.0)
2022-02-02 13:34:38 +01:00
Dirk Wetter
37c6d78bfa Fix Darwin / LibreSSL startup problem (3.0)
This PR addresses a bug where a user encountered the question "The results
might look ok but they could be nonsense. Really proceed".

That happened under Darwin and probably some LibreSSL versions when
checking some hosts. sclient_auth() returned 1 indicating no SSL/TLS
handshake could be established.

This PR modifies sclient_auth() so that in those cases 0 is returned by
skipping the check for the session ID. As NO_SSL_SESSIONID needs to
be set when there's no session ID. This is done separately.

This fixes #2052 for 3.0
2022-02-02 12:20:06 +01:00
Dirk Wetter
1809595576
Merge pull request #2082 from dcooper16/sclient_dev_null_30
Send /dev/null to s_client
2022-01-06 21:19:00 +01:00
David Cooper
a51dfcc498
Send /dev/null to s_client
As discussed in #2079, this commit adds "</dev/null" to calls "$OPENSSL s_client" that are intended to test whether a certain option is supported. This is done to prevent hanging in the case that the option is supported, a TLS server happens to be listening on the port to which s_client tries to connect, and the connection is successful.
2022-01-06 08:23:20 -05:00
Dirk Wetter
82f64a376a
Merge pull request #2068 from drwetter/polish+fixhttpclockskew_3.0
Backport HTTP 'Age' header field
2021-12-10 17:43:10 +01:00
Dirk Wetter
fab42dd477 Backport HTTP 'Age' header field
See #2032 / #2067, kudos @Wahnes. This is a backport for 3.0

    Currently, when "HTTP clock skew" is calculated, this is taken to be the
    difference between the timestamp of the moment the HTTPS request was sent and
    the date given in the HTTP Date header. This does not yield valid results in
    case a HTTP cache is used, either on the client side or on the server side.
    According to the HTTP specs, the Date field will contain the timestamp the
    response was created, which may not be the timestamp the response was
    delivered.

    Consider the following example that queries the Varnish project's web server.
    Note that Varnish is a popular HTTP caching server, so HTTP caching will of
    course be used when serving HTTP responses from this project's web server.
    testssl.sh https://varnish-cache.org/ This will typically output a HTTP clock
    skew of some thousand seconds.

    The patch takes into account the HTTP Age header that caching servers add to
    the HTTP response to signal the response's freshness. As client-side caches
    normally do not cache HTTPS requests (except maybe for "enterprise" HTTP proxy
    caches that do MITM HTTPS proxying), this is mostly targeted to HTTPS websites
    that employ server side HTTP caching.

    Addtional polishing:

    * address my comments in #2032
    * add JSON field HTTP_headerAge if they exists
    * output HTTP_AGE if it was detected
    * do stripping of line feeds closer to where variables were set
2021-12-10 15:27:43 +01:00
Dirk Wetter
2cd0ab5b82
Merge pull request #2065 from dcooper16/fix_json_header_30
Fix JSON header in 3.0
2021-12-09 13:17:28 +01:00
David Cooper
9c0fac1790
Fix JSON header
This commit fixes an issue with the headers in the structured JSON output. If run_cipher_match() is performed the header that is used is "pretest" rather than "singleCipher".
2021-12-08 14:38:37 -05:00
Dirk Wetter
bc203c5b4c
Merge pull request #2062 from dcooper16/update_host_depended_vars_30
Update reset_hostdepended_vars()
2021-12-08 15:28:22 +01:00
David Cooper
bcc6178c57
Update reset_hostdepended_vars()
This commit adds several variables to reset_hostdepended_vars() that are not currently being reset for each host being tested, but that should be reset.
2021-12-08 09:16:55 -05:00
Dirk Wetter
89bd8294e2
Merge pull request #2058 from mspncp/git-simplify-worktree-check-3.0
Simplify check for git working tree in 3.0
2021-12-07 08:55:24 +01:00