Commit Graph

2844 Commits

Author SHA1 Message Date
d85c65e3b2 output missing proxy support if connect fails 2025-07-03 23:01:59 +02:00
c942283b34 Re-add correct version \# 2025-07-03 15:01:04 +02:00
49dcd5b854 First try for QUIC (OpenSSL only)
This is an implementation for QUIC (RFC 9000, RFC 9114). It's purely
OpenSSL based for now. As some distros support newer (>= 3.2) versions
this works on some distros now and will work on more as time goes by.

It has been tested with MacOS and Linux. If there's an OpenSSL version
in /usr/bin/ it will automagically use that version.

A new short sub function named sub_quic() was introduced for handling this as
run_protocols() is already "full".

It appears below TLS 1.3. A check against HTTPS RR #2484 is planned but
not implemented yet. PR #2484 has to be worked on and merged before.

New variables were introduces (HAS_QUIC/ +HAS2_QUIC). Also there's
QUIC_WAIT as we run the connect in the background and we need a wait time.

HAS_UDS2 was renamed to HAS2_UDS as HAS2 should signal this is for OPENSSL2
and UDS2 doesn't make sense.

To clarify:
- check for a proxy and then don't do the check?
- short unit test (t/31_isJSON_valid.t cjecks cloudflare but ...)
2025-07-03 14:36:55 +02:00
3792bceeda Improve error message for sockets fail and Alpine
See $2807 .

Also some prln_magenta were modified (see #2816) to pr_warning.
2025-06-29 15:24:44 +02:00
c9a11a9fb0 Minor improvements to #2798
see https://github.com/testssl/testssl.sh/pull/2798#issuecomment-2972834180
2025-06-23 18:43:34 +02:00
529a373b2e Update testssl.sh
Modified grading for incomplete chain
2025-06-13 10:54:13 +02:00
f2aa87ba66 Bump version
"just" bugfix release.
2025-06-12 17:26:06 +02:00
235a6a0f88 add another OPENSSL_CONF='' 2025-06-11 19:02:06 +02:00
91a35026b6 Fix OPENSSL_CONF problem for OPENSSL2
In #2727 there were workarounds introduced which sped up processing decryption of
ChaCha20 and and AES-GCM by using OPENSSL2 when it is supporting such functions.

However when OPENSSL2 is called and OPENSSL_CONF still points to the autogenerated
file which works for `~/bin/openssl.$(uname -s).$(uname -m)` the decryption `$plaintext`
will be empty which later on caused a negative value, see #2780 .

This fixes #2780 by prepending `OPENSSL_CONF=''` to each OPENSSL2 instance. Also it
makes `chacha20()` and `gcm-decrypt()` more robust. It is now more readable now.

At other places $OPENSSL2 were prepended by `OPENSSL_CONF=''` also if there weren't
any obvious errors noticed.

Also now all OPENSSL2 vars will appear in /tmp/testssl.XXXXXX/environment.txt when
debugging.

It was also noticed that the `find_socat()` function had room for improvements, it was
not set in any case when `socat was in $PATH or supplied via env SOCAT.
2025-06-11 18:47:14 +02:00
735cc668c0 Merge pull request #2792 from testssl/fix_issuerCN
Fix missing issuer CN
2025-06-11 11:13:21 +02:00
0a89d5c94f Some cert need 5 lines to reach the CN 2025-06-11 09:06:41 +02:00
39029e9995 fix orthographic error 2025-06-10 23:13:00 +02:00
61947405e0 Fix missing issuer CN
This fixes a problem which was introduced @ 8d8f83ace5.
It caused for some hosts not to parse / display the issuer CN correctly.

Also it adds some code in testssl.sh and in a unit test to detect
this earlier. In general an output string FIXME will now cause a
unit test to fail. This can + should be used at other places too!

Fixes #2789
2025-06-10 22:54:11 +02:00
889aedc0e4 Fix parser for server header
Do word match and exclude minus sign

This fixes #2787 for 3.2.
2025-06-10 21:59:40 +02:00
0daf83cf76 fix typo 2025-05-21 14:22:13 +02:00
cd575526a7 Fix CCS injection regression
The rhs of the pattern was off by one byte and it worked in practise until recent PR #2657.

This fixes #2691 for 3.2 .
2025-05-21 14:17:54 +02:00
85d8d44fbe Try to fix the renegotiation problem
as suggested, see https://github.com/testssl/testssl.sh/issues/2765#issuecomment-2891140503
2025-05-19 16:24:46 +02:00
c109cafa17 Merge branch '3.2' into mac_runner 2025-05-16 18:16:58 +02:00
0aad0a0fac Try /usr/bin/echo for testing
.. although it seems not an option to include this in prod.
RSsee https://github.com/testssl/testssl.sh/issues/2765

Omitting redirecting stderr
2025-05-12 10:43:43 +02:00
bce1083df8 fix run_breach error output 2025-05-08 07:48:20 -06:00
aa2ebf3c21 Uses tolower() utility for hostname conversion 2025-05-08 17:03:04 +12:00
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