Commit Graph

2773 Commits

Author SHA1 Message Date
6678d2dedc Lowercase URL to match 'HTTPS://<server>/' 2025-05-05 14:42:13 -04:00
06ba579475 Merge pull request #2742 from testssl/bump_version
Prepare for upcoming release
2025-04-23 11:33:39 +02:00
58da779a8e Merge pull request #2721 from testssl/fix_some_ipv6proxy_issues
Fix some ipv6proxy issues
2025-04-22 15:05:05 +02:00
ffe5dea844 remove misleading command 2025-04-22 12:55:42 +02:00
b4cdc37f9e trailing zero sounds better / is more distinguishable 2025-04-22 12:47:48 +02:00
295a68e7ab Just bump version for upcoming release 2025-04-18 13:32:53 +02:00
d1531cdf60 Support decrypting TLS 1.3 handshakes with PQ key exchange
This commit modifies testssl.sh so that TLS 1.3 handshakes that use post-quantum algorithms for key exchange can be decrypted, if $OPENSSL supports the algorithms.
2025-04-10 14:05:30 -07:00
ecaa7878e5 Support ML-DSA server keys
This commit adds support for server certificates that have ML-DSA pubilc keys. It also adds supports for certificates that are signed with ML-DSA or SLH-DSA. The ML-DSA code points for the signature_algorithms extension are taken from https://datatracker.ietf.org/doc/draft-tls-westerbaan-mldsa/ and are the ones used by OpenSSL 3.5.0.
2025-04-10 09:15:04 -07:00
9f48c51dc7 Get supported groups list from OpenSSL 3.5.0
In OpenSSL 3.5.0 the `list` command can be used to obtain a list of supported groups for TLS. The commit makes use of this command when $OPENSSL is OpenSSL 3.5.0 or later. This should be faster than testing curves one at a time.
2025-04-09 09:21:54 -07:00
b7f9ff1bf2 Merge pull request #2727 from dcooper16/chacha20
ChaCha20 decryption
2025-04-04 11:54:05 +02:00
f6ff390799 Fix checks with HAS_UDS and HAS_UDS2
This commit fixes a check where the Boolean variables $HAS_UDS and $HAS_UDS2 are checked for whether they are empty rather than for whether they are true.
2025-04-02 08:03:58 -07:00
e2accb6442 ChaCha20 decryption
Decryption is TLS 1.3 handshakes is very slow if the response is encrypted using ChaCha20 and the $OPENSSL enc command does not support ChaCha20. This commit mitigates that problem by using $OPENSSL2 for ChaCha20 decryption if such decryption is needed and $OPENSSL does not support it.

This commit also changes testssl.sh to make use of $OPENSSL2 for AES-GCM decryption, when $OPENSSL2 supports it, but $OPENSSL does not. However, this change is not as important. Implementing AES-GCM in Bash using $OPENSSL for AES ECB operations isn't nearly as slow as fully implementing ChaCha20 in Bash.
2025-04-02 07:55:31 -07:00
44d9f520fb Add check for proxy IPv6 support
... of the binary. Testing needs to be done.
2025-04-01 23:37:54 +02:00
36a58e2b3e Allow square bracket notation for IPv6 proxy 2025-03-27 18:26:17 +01:00
e81b09176d Distunguish between LibreSSL and OpenSSL IPv6 proxy
Somehow the proxy now shows only IPv6 source addresses when specifying
--proxy=IPV6ADDRESS:PORT
2025-03-25 19:42:54 +01:00
18da1b8df5 Fix some IPv6 proxy issues
As a quick hack this PR enables *basically* the IPv6 proxy which results that testssl.sh
will use an IPv6 proxy when

* the binary supports that
* the binary is used an not tls_sockets()
* there's no A record but an AAAA record of the proxy or an IPv6 address as proxy address was specified.

The latter should guarantee that it doesn't break anything.

However tls_sockets() still uses IPv4 for the connection to the proxy.

See #1105
2025-03-25 19:13:30 +01:00
040ef1e0c9 Comment the first lines get_server_certificate()
See https://github.com/testssl/testssl.sh/issues/2707#issuecomment-2741053487
2025-03-25 17:22:10 +01:00
a17bb42a37 Sanitze HTTP header early and better
On MacOS `run_http_header()` hiccuped when in any place of the web site unprintable chars were returned, see https://github.com/testssl/testssl.sh/issues/2708#issuecomment-2738347784 .

This PR fixes that by moving the sanitization to a separate function and run it earlier before any processing of the returned content (header plus body) takes place.

Output was:

```
'HTTP Status Code           awk: towc: multibyte conversion failure on: '� disabilitato");

 input record number 36, file /tmp/testssl.FHu8E0/AAA.BBB.CCC.DDD.http_header.txt
 source line number 1
'wk: towc: multibyte conversion failure on: '� disabilitato");

 input record number 36, file /tmp/testssl.FHu8E0/AAA.BBB.CCC.DDD.http_header.txt
 source line number 1
  200 OK
```
2025-03-20 13:34:46 +01:00
692b9c9260 Merge pull request #2710 from testssl/fix_2708_TLS_FALLBACK_SCSV
Set POODLE var when exiting run_ssl_poodle()
2025-03-20 10:45:57 +01:00
e4bbd6b517 Set POODLE var when exiting run_ssl_poodle()
... so that run_tls_fallback_scsv() doesn't exit with a warning.

This fixes #2708 .
2025-03-19 23:30:06 +01:00
8d8f83ace5 Fix LibreSSL parsing (-nameopt utf8)
When parsing the intermediate cerificates there was a parser problem when using
LibreSSL and not OpenSSL.

This PR fixes the issue #2705 and addresses the problem by using the -nameopt multiline command
of LibreSSL/OpenSSL .
2025-03-19 22:36:37 +01:00
ebeb3e7b9d OpenSSL version check in check_revocation_ocsp()
The current code for setting $host_header in check_revocation_ocsp() will not work for LibreSSL 3.* or for upcoming versions of OpenSSL (version 4 or greater). The check will also not work correctly if $OPENSSL2 is used and $OPENSSL2 is not /usr/bin/openssl. This commit fixes these issues.
2025-03-17 08:53:19 -07:00
52476b8a46 Fix finger confusion ;-) 2025-03-15 17:27:28 +01:00
2090bdc849 Merge pull request #2698 from testssl/fixDockerOcspCall
Fix --phone-out + ocsp, also in docker container
2025-03-15 17:11:52 +01:00
430c5c8d09 Fix --phone-out + ocsp, also in docker container
Previously in 4f1a91f92e there was a
double header sent to the server to check whether the certificate
was revoked.

This PR addresses that and fixes #2667 .
2025-03-15 15:58:28 +01:00
ad8684d324 Fix OpenSSL version check
Before version 3.0.0, OpenSSL versions includes letters (e.g., 1.1.1w). Such version numbers confuse [[ ${OSSL_VER//./} -ge 210 ]]. Since this check is only needed for LibreSSL, this commit adds a conditional so that the check is only performed for LibreSSL.
2025-03-14 14:06:17 -07:00
4f1a91f92e Fix segfault with error 4 in check_revocation_ocsp() when using --phone-out
As `--phone-out` sometimes doesn't work with our binary we switch transparently/automagically
to the vendor support openssl binary -- if available.

This fixes at least #2516 where the issue has been explained/debugged in detail.
See also #2667 and #1275.
2025-03-14 17:06:42 +01:00
c53f4a3e44 Merge pull request #2682 from testssl/speedup_curvetests
Speed up startup checks for supported curves and more
2025-03-13 10:59:42 +01:00
8b00ab4c47 Add a few extension numbers in the server hello
Issue #2686 showed a server which listed an unknown extension number from
RFC 8446. THis PR adds this number and a few (later) ones.

It just lists them when detected in `parse_tls_serverhello()`

See also https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml
2025-03-11 15:57:25 +01:00
830af44953 Merge pull request #2690 from dcooper16/mlkem
Support draft-connolly-tls-mlkem-key-agreement
2025-03-11 15:33:22 +01:00
70e1c4d693 Merge pull request #2689 from dcooper16/sort_tls_extns
Sort TLS extensions
2025-03-11 15:20:36 +01:00
6ed6db500b Merge pull request #2688 from dcooper16/ossl4_compat
OpenSSL 4 compatibility
2025-03-11 15:16:45 +01:00
410b3acf5c OpenSSL 4 compatibility
According to https://openssl-library.org/roadmap/index.html, OpenSSL 4 is scheduled to be released in April 2026. This commit modifies code that checks $OPENSSL version numbers so that versions 4 and above will be recognized.
2025-03-10 15:58:40 -07:00
75b78bc21a Sort TLS extensions
This commit modifies testssl.sh so that run_server_defaults() prints the server's supported TLS extensions sorted by extension number rather than listing them in the order in which they were found.

In order to simplify the sorting of the extensions, this commit changes $TLS_EXTENSIONS from a string to an array. In February 2017 comments were added (925e1061b2) saying that it would be $TLS_EXTENSIONS were an array. So, this commit addresses those comments. However, it is possible that the reason for those comments no longer apply.
2025-03-10 15:38:24 -07:00
683f028164 Support draft-connolly-tls-mlkem-key-agreement
This commit adds support for the three code points in draft-connolly-tls-mlkem-key-agreement.
2025-03-06 11:42:00 -08:00
6a333d17b7 OpenSSL 3.5 compatibility
With the current master branch of OpenSSL (3.5.0-dev), the output that is provided by s_client has changed in the case of a cipher suite that uses an ephemeral key. Rather than preceding the ephemeral key information with "Server Temp Key: ", it is now preceded by either "Peer Temp Key:" or "Negotiated TLS1.3 group:". This commit modifies the lines that extract ephemeral key information from OpenSSL responses to accept any of these strings.
2025-03-06 10:33:04 -08:00
4a8377a396 Conflicts resolved 2025-03-06 11:01:00 +01:00
7bb04e020e Fix regex for openssl banner
,,, and also update the warning when runing in SSL native mode to check the ciphers
before and include OpenSSL also
2025-03-05 17:52:34 +01:00
f03440bc28 Speed up startup checks for supported curves and more
In order to avoid delays due to lookups of the hostname "invalid." we
just avoid to use "invalid." whenever possible. :-)

Therefore we just do a test before whether `$OPENSSL s_client 2>&1 </dev/null`
does a connect, except when a WSL system is discovered. If that succeeds
we omit the part `-connect invalid.` to check whether the curve is supported.
In some quick testing this in fact improved the startup time.

This seemed to work under Linux with several openssl and one LibreSSL binary.
More testing would be required, especially e.g. under WSL / WSL2.

Also in `sclient_supported()` the `$OPENSSL s_client` statement was changed
in a similar fashion. That worked so far but would need to be observed more
closely.
2025-03-05 17:22:01 +01:00
e6cfe8c3b0 Resolve merge conflict by incorporating both suggestions 2025-03-05 15:35:18 +01:00
e2ee8b24b4 fix typo in comment 2025-03-05 15:06:41 +01:00
5ffcd086eb Add missing local vars 2025-03-05 15:02:15 +01:00
3152cdf864 Banner change + minor fix for curve detection
In order to tell openssl binaries better apart the short banner below the
hash tag signs contain now also the date. That is the short version of the
build date unless it is not supplied which is the case of opensuse. Then
the name contains the date and it's taken from there.

The start and end banner lines have the same length now.

"sieve" was added in a comment and the sequence where sieve appears in
a pattern was trying to match other occurences (i.e. after nntp)

While testing the banners it appeared under Linux that a) the vendor
supplied openssl sometimes hangs during startup when determining the
supported curves using -connect b) a pattern was missing to detect
whether the curve was not supported which falsely labeled all supplied curves
as supported when using /usr/bin/openssl . The pattern for the latter
was added (b). For a) there needs to be a follow up PR to avoid the
long delays.
2025-03-05 14:41:12 +01:00
bbdf19df85 Fix typo
This commit fixes a typo that was introduced by #2656.
2025-03-04 14:01:50 -08:00
c9d1ba4fcc Merge pull request #2673 from dcooper16/avoid_subshell
Avoid subshell overhead
2025-02-27 10:31:04 +01:00
78dd0a13c9 Merge pull request #2671 from javabrett/javabrett/improve-ev-detection
Improved (experimental) Extended Validation (EV) certificate identification
2025-02-26 22:56:21 +01:00
c38f46880f Avoid subshell overhead
This commit removes the use of parenthesis in two expressions in run_fs() in order to avoid subshell overhead.
2025-02-26 13:25:49 -08:00
102e4fb9b7 Merge pull request #2620 from Odinmylord/fix_curves
fix curves findings in TLS1.2 and prior versions
2025-02-26 13:15:34 -08:00
352ed61a2e Improved (experimental) Extended Validation (EV) certificate identification.
Three changes:

- added grep for "EV TLS" in addition to "EV SSL", as some issuers are
  using this.  This grep link actually picks-up most EV policies.
- Added policy detection for 2.23.140.1.1.  This is from CA Browser
  Forum https://cabforum.org/resources/object-registry/ extended-validation(1).
- Added policy detection for 1.3.6.1.4.1.38064.1.3.1.4 , which is SSL.com's EV policy.
2025-02-26 10:10:21 +11:00
9429afade1 fix(rating): explicit enable rating if required tests are ran 2025-02-23 11:48:41 +01:00