Commit Graph

2773 Commits

Author SHA1 Message Date
1539148f0b Corrected typo in the help message
Signed-off-by: Fabio Kruger <10956489+krufab@users.noreply.github.com>
2025-02-22 00:55:08 +01:00
b3609603f9 remove unnecessary "if" statements and remove break from "if" statements 2025-02-20 15:45:05 +01:00
5c7e7bcbc7 Fix check for OpenSSL supported curves
OpenSSL 3.X outputs a different error message than previous versions when $OPENSSL s_client -curves X ... is called with an unsupported curve. This was resulting in the check within find_openssl_binary() adding every curve to $OPENSSL_SUPPORTED_CURVES, even ones that were not supported. This commit changes to check in order to detect the new error message.
2025-02-19 12:47:35 -08:00
74209e05de Merge pull request #2660 from testssl/rm_comment
Remove obsolete comment that SNI is not needed for ticketbleed
2025-02-17 15:39:26 +01:00
2baaf61cc5 Merge pull request #2657 from dcooper16/fix_pattern_match
Fix pattern matches
2025-02-15 14:14:38 +01:00
f085fd1880 Merge pull request #2659 from dcooper16/npn_sockets
Enable run_npn() to use tls_sockets()
2025-02-15 13:47:13 +01:00
e79dc8161e Remove obsolete comment that SNI is not needed for ticketbleed
See also aa5d4917cf (r1954824502)
2025-02-15 13:33:52 +01:00
96bd3072de Enable run_npn() to use tls_sockets()
LibreSSL does not support the -nextprotoneg option. This commit enhances run_npn() to use tls_sockets() when $HAS_NPN is false, rather than reporting that the check can not be performed.
2025-02-14 12:25:39 -08:00
acf48977c2 Fix pattern matches
This commit fixes three lines of code that use Bash substring matching. In each case, a list of strings to match was enclosed in brackets. This resulted in a match if the string to test contained any character from any of the strings to match. This commit fixes the issue by removing the brackets.

(The bugs were introduced in b8e9b09ca7 and 8149c2d5cf)
2025-02-13 14:21:26 -08:00
aa5d4917cf Enhance ticketbleed testing
Some versions of OpenSSL/LibreSSL do not support TLS 1.1 and earlier, either because they do not support the protocol (e.g, `$OEPNSSL s_client -tls1` results in a "unknown option" error) or because the cryptography needed to support these protocol versions (e.g., MD5/SHA1) is not available.

Given the limitations of some versions of $OPENSSL, this commit enhances ticketbleed testing in two ways. First, it performs the testing using the newest (non-TLS 1.3) version supported by the server, so that TLS 1 and TLS 1.1 aren't used unless TLS 1.2 is not supported. Second, it adds tests for whether the protocol version to be used is supported by $OPENSSL and for whether connection attempts were successful, rather than assuming connection attempts succeed.
2025-02-13 07:59:36 -08:00
5e1db5f0a1 Address CA file parsing problem (3.2)
.... by forbidding spaces in supplied CA files/directories

Also now we're sanitizing the cmd line parameter better using `safe_echo()`

See also #2647 .
2025-02-07 12:30:41 +01:00
6e72c9b81d Merge pull request #2646 from testssl/fix_feature2098
Feature: Detection STARTTLS throtteling via code 421/SMTP
2025-01-31 12:26:44 +01:00
e73a2a9d53 Feature: Detection STARTTLS throtteling via code 421/SMTP
For this anotehr variable needed to be passed to starttls_full_read()
via starttls_smtp_dialog, where the variable is defined.

Handling of the connection problem will occur at the calling level, fd_socket(),
so that in the future this can be extended if another STARTTLS problem signals
that we're too fast.

Fixes #2098.
2025-01-31 11:26:44 +01:00
61cf7fe0e7 Fix error when hostname w trailing dot supplied 2025-01-29 20:47:13 +01:00
b054b5d687 two sieve fixes
* one logical error
* removing check for trailing space for OK
2025-01-28 22:15:17 +01:00
d9b293f6c7 fix typo 2025-01-24 18:51:11 +01:00
43a0099fbc Fix bug when legacy NPN is tested against a TLS 1.3 host
When testing a TLS 1.3 host s_client_options used TLS 1.3 ciphers to test
for NPN. As that is not implemented we nee dto make sure any other version
is used.

This PR ensures that --after testing whether it's a TLS 1.3-only host
where this test doesn't make any sense in the first place.

Fix for #2633
2025-01-24 18:46:07 +01:00
bf75a91bc7 Merge branch '3.2' into bump_version 2025-01-24 14:41:21 +01:00
002b91192c fix spelling 2025-01-24 13:50:35 +01:00
49db77e63a Conflicts resolved 2025-01-24 13:44:19 +01:00
69d6a50696 Merge branch '3.2' into bump_version 2025-01-24 11:05:00 +01:00
9e9334f3c8 Merge pull request #2619 from testssl/co_header
Add more security headers
2025-01-23 11:47:34 +01:00
4efe324ef7 Fix round bracket and remove obsolete comment 2025-01-23 10:45:15 +01:00
4df0d9e4c3 Re-added the ) to make the action word (why??) 2025-01-22 23:32:39 +01:00
207b902109 Merge branch '3.2' into co_header 2025-01-22 22:50:00 +01:00
ad912ea332 Fix typo + tags 2025-01-22 20:05:19 +01:00
12036fb6c8 Update baseline scan + add/deprecate security headers 2025-01-22 19:54:34 +01:00
a1c2dc7c72 Remove --nsa in help() and add --forward-secrecy instead
Both are possible to use
2025-01-22 19:19:16 +01:00
17f2a5d5b9 Merge pull request #2622 from dcooper16/draft-kwiatkowski-tls-ecdhe-mlkem
Support draft-kwiatkowski-tls-ecdhe-mlkem
2025-01-22 11:03:11 +01:00
a85073bf0d Fix checks for whether X25519 and X448 are supported
In some cases OpenSSL returns an "unsupported" message rather than a "not found" message if X25519 and X448 are not supported. This commit changes the check for whether X5519 and X448 are supported for checking for either response.
2025-01-21 09:10:33 -08:00
11d7979f41 Support draft-kwiatkowski-tls-ecdhe-mlkem and draft-tls-westerbaan-xyber768d00
This commit adds support for the three code points in draft-kwiatkowski-tls-ecdhe-mlkem and the code point 0x6399 from draft-tls-westerbaan-xyber768d00. The group 0x6399 uses a pre-standard version of Kyber and is considered obsolete.
2025-01-21 09:00:21 -08:00
355b9d2dcc add fix to sockets and move test after original one 2025-01-20 17:27:31 +01:00
95b6258f82 Fix #2614
Currently `compare_server_name_to_cert()` only indicates whether the server's host name matches a wildcard name in the certificate. So, it does not indicate if the certificate includes a wildcard name that does not match the server's host name. As a result, if a certificate includes the names "api.sub.example.tld" and "*.api.sub.example.tld," then a wildcard certificate warning will be issued for host names such as www.api.sub.example.tld, but not for api.sub.example.tld.

This commit changes `compare_server_name_to_cert()` to indicate whether the certificate is a wildcard certificate in addition to providing information about how the certificate matches the server's host name. Functions that use this function's response are then changed to extract the information they need (matching or wildcard) from the return value.
2025-01-17 05:43:39 -08:00
2ae28d7f64 fix curves findings in TLS1.2 and prior versions 2025-01-17 12:03:34 +01:00
8000885371 Add more security headers
... and deprecate "X-Content-Security-Policy" and "X-WebKit-CSP"
2025-01-16 21:18:47 +01:00
8e184b886e Fix #2615
The server mentioned in #2615 has a bug, which results in it sending a handshake_failure alert rather than a successful connection if the signature_algorithms extension lists RSA+MD5 before one of the signature algorithms that it supports.

This commit works around this issue by reversing the order in which it lists the signature algorithms in the signature_algorithms extension, thus (generally) listing stronger options first.

This change should not affect the testing, except that it will result in the order of the supported signature algorithms being reversed in the output, if the server respects the client's preferences.
2025-01-16 06:55:54 -08:00
5f4ca15e57 Merge branch '3.2' into links 2025-01-06 15:41:16 +01:00
b708026151 Change orga from drwetter --> testssl
... to avoid redirects on the client side and to make repo migration better visible.

Also amend 'Status' and 'Contributing' in Readme.md. bluesky added, albeit mastodon
seems more interactive. Clarify twitter account is not in use anymore.
2025-01-06 15:34:45 +01:00
6c17b66418 CI fix : Cleanup
testssl.sh worked as expected.
Under the hood, broken pipes are expected as part of the fast loop exit
strategy that relies as little as possible on timeout detection.
But under the CI, testssl.sh output is garbled by the subshells stderr
outputs, catched for some reason by 'prove -v'.
Simply redirecting the stderr output of the offending command to
/dev/null fixes the problem.
2024-12-09 14:19:56 +01:00
88856ecad5 2nd try 2024-12-09 12:00:16 +01:00
f39408086b Merge branch '3.2' into client-renego-refactoring 2024-12-09 11:03:42 +01:00
e4e3afbbe8 Tentative to fix CI tests 2024-12-09 10:46:45 +01:00
701c606eac Merge pull request #2597 from Tazmaniac/quick-fix-2590
Quick fix for #2590
2024-11-27 11:39:25 +01:00
26a3a8fd51 Fix #2599
This commit fixes #2599 by not wrapping fileout() messages in a "clientProblem" wrapper if TLS13_ONLY is set. The TLS13_ONLY flag being set is an indicator that fileout_banner() has already been called.
2024-11-26 09:13:11 -08:00
991c1fefb2 One tab fix 2024-11-07 12:25:50 +01:00
1aaab67e81 Multiple IP fix and simple not vulnerable printing case recover
- Recover the "not vulnerable" case (no mitigation) printing, cosmetic
  fix.
- With the removing of all s_client invocation other than the main loop
  one, fix the init of the ERRFILE and TMPFILE: no need to append, no
  need to remove, inconditionally zap the content before the loop.
2024-11-05 12:59:01 +01:00
7625422976 Spell fix 2024-11-04 21:02:03 +01:00
5773303f23 Correct incomplete commit 2024-11-04 20:59:45 +01:00
d8b439e48c Address a theorically still possible non HTTP case 2024-11-04 20:53:07 +01:00
09719a322b Remove the last 1s euristic
In the wait loop, I was relying on a 1s sleep to eliminate a possible
late zero return value server close on the last attempt.
- do globaly one more harmless "for" iteration
  and remove the sleep 1 for faster and more robust result
- correct the non HTTP case iteration value
- adjust the timeout to the conservative 6s in the non HTTP case,
  for HTTP case it become 33s
- improve comments
2024-11-04 20:25:31 +01:00