Commit Graph

2675 Commits

Author SHA1 Message Date
Emmanuel Fusté
7625422976 Spell fix 2024-11-04 21:02:03 +01:00
Emmanuel Fusté
5773303f23 Correct incomplete commit 2024-11-04 20:59:45 +01:00
Emmanuel Fusté
d8b439e48c Address a theorically still possible non HTTP case 2024-11-04 20:53:07 +01:00
Emmanuel Fusté
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
Emmanuel Fusté
dab177fda9 Big client renego cleanup / refactoring
All cases could be handled by the single openssl s_client invocation
loop:
- dispatch and adjust comments to not loose them
- remove the first s_client invocation: stuck connections are allready
  handled by the main loop
- remove the second s_client invocation: normal case and server closed
  connections are allready handled by the main loop. The loop take care
  of the race between server connection close and s_client terminating
  too by doing another loop run, not closing STDIN.
- special non HTTP case equivalent to ssl_reneg_attempts=2
- specialcase only the HTTP result printing to not change the output

- openssl-timeout option clashe badly with the main loop logic:
  Introduce $OPENSSL_NOTIMEOUT
2024-11-04 17:27:18 +01:00
Dirk Wetter
245ad2ae4a
Merge pull request #2592 from dcooper16/integrity_only_ciphersuites
Support RFC 9150 cipher suites
2024-10-29 00:35:34 +01:00
David Cooper
e17b1c17bb Support RFC 9150 cipher suites
This commit adds support for the two cipher suites in RFC 9150, TLS_SHA256_SHA256 and TLS_SHA384_SHA384. These are authentication and integrity-only cipher suites.
2024-10-28 15:07:22 -07:00
David Cooper
3c54474061
Support LibreSSL 4.0.0
LibreSSL 4.0.0 was recently released. This commit modified the version check in determine_trust() so that there isn't an incorrect warning suggesting that LibreSSL 4.0.0 "<= 1.0.2 might be too unreliable to determine trust."
2024-10-25 12:24:06 -07:00
David Cooper
1f37a8406f Accept stapled OCSP responses that use SHA-256 in CertID
This commit modifies check_revocation_ocsp() to check the revocation status of a certificate in a stapled OCSP response whether the response uses SHA-1 or SHA-256 in CertID.
2024-10-16 10:49:40 -07:00
Dirk
0abca6f067 Mute socat killing & improve STARTTLS grading explanation
Fixes #2582 .
2024-10-15 10:56:29 +02:00
Dirk
33fd749af8 Fix json/csv output when STARTTLS problem is passed back
In rare cases testssl.sh writes in the terminal output "likely not offered" but
misses the "likely" in the json/csv output.

This fixes #2575 by adding that word and amending the return value 4 with
a comment.
2024-10-14 16:15:18 +02:00
Dirk
fa5664f434 Polish comment + grade cap reason for STARTTLS 2024-10-14 14:17:02 +02:00
Dirk
7c0ccb3da7 Fix HTML output in #2568 2024-10-14 13:08:45 +02:00
Dirk
6c771f7902 Merge branch '3.1dev' of https://github.com/magnuslarsen/testssl.sh into magnuslarsen-3.1dev 2024-10-14 13:03:46 +02:00
Dirk Wetter
6110843fd0 The F5 cookie decoder doesn't detect IPs in the 10.x.x.x space for non-encrypted cookies.
This fixes the regex pattern, see also

https://github.com/drwetter/F5-BIGIP-Decoder/pull/4/files
2024-10-09 15:47:50 +02:00
Magnus Larsen
69bdbeb982 feat(rating): line-wrapping comments for grade_cap_reasons 2024-09-18 09:08:07 +02:00
Dirk Wetter
04c5ee391d "only" was important here 2024-09-08 13:19:16 +02:00
Dirk Wetter
4ce91d7d61 Explain OSSL_SHORTCUT better, "automagically" is the word we wanted to use 2024-09-08 12:27:51 +02:00
Dirk Wetter
be3e7651bb
Merge pull request #2564 from drwetter/starttls_phrasing
Phrasing of reason for STARTTLS grading improved
2024-09-07 17:08:50 +02:00
Dirk
3b85f53d52 added an accidently erased char 2024-09-07 16:15:03 +02:00
Dirk
a1c67c0794 proper English 2024-09-07 16:03:53 +02:00
Dirk
f9edaa7fe1 Phrasing of STARTTLS grading improved
... a a comment added in the desciption.

Unfortunately I couldn't get the line wrapping working.
2024-09-07 15:51:12 +02:00
Dirk
3d2bd5020c fix spellcheck 2024-09-06 13:00:27 +02:00
Dirk
12bc15adc3 misc
- remove 1xLF in UI
- fix obsolete statment for OPENSSL2
2024-09-06 12:53:00 +02:00
Dirk
becd310390 Address open UI problems for TLS 1.3 only hosts
While in 3.2 there was only a hint how to deal with TLS 1.3 only hosts, a restart
with --openssl=/usr/bin/openssl or setting of OSSL_SHORTCUT-true was required.

This PR changes the behavior: if an openssl version can be found in /usr/bin/openssl
(or SUPPLIED via OPENSSL2=/home/version/ofopenssl testssl <cmdline>) which
supports TLS 1.3 it switches automatically and informs the user that it has done so.
   This message is asynchonous and is implemented with a new function check_msg()
and a global OPEN_MSG, so that we maintain the formatting. Otherwise it would have
appeared between rDNS and service detection. Now it's nicely after service detection.
2024-09-06 12:47:03 +02:00
Dirk Wetter
a20fd796e8
Merge pull request #2552 from drwetter/fix_2466
Trailing space after value in header is fine
2024-09-03 20:51:18 +02:00
Dirk Wetter
031c2a55ec
Merge pull request #2553 from drwetter/noCtrlCharInHeader
Remove crtl chars from HTTP header
2024-09-03 20:50:18 +02:00
Dirk
2b36b33112 Remove crtl chars from HTTP header
... which fixes #2337
2024-09-03 19:24:46 +02:00
Dirk
30a33e9a6e Trailing space after value in header is fine
This fixes #2466.
2024-09-03 19:10:29 +02:00
Dirk
dbb8fc8013 Fix CI 2024-09-03 18:28:56 +02:00
Dirk
5a1fd2623f Improve banner (3.2)
... for readability and bugs to be filed (fixes #2506)

This PR defines a short string for the OpenSSL banner as some suppliers have made them (unnecessarily) long so that it won't fit nice in the banner anymore.

The banner also now omits the built line from openssl as for the user it is normally not important.
2024-09-03 15:40:55 +02:00
NaN
8a5d534b8a
Update testssl.sh
Fix to be consistent in reporting (Not Ok) for ClientHello/ServerHello errors.
2024-08-23 14:19:09 -07:00
Dirk
dd66449a45 Fix IPv6 addresses
Local and ULA and more IPv6 adresses were incorrectly filtered by ``awk '/^[0-9]/ { print $1 }'``
which searches in the first term for only numeric values.

The PR adds a-f and fixes #2529 .
2024-07-22 21:07:50 +02:00
David Cooper
c72f4061b4
Fix #2502
This commit fixes #2502 in the 3.2 branch by checking that the key_share extension is at least 4 bytes long (8 in ASCII-HEX). These 4 bytes encode the group value (2 bytes) and the length of the key (2 bytes).
2024-06-13 05:53:50 -07:00
Dirk
5af152d575 Address overwrite option to --file/-iL with warnings off
When choosing --file or -iL warnings were set in any case to --batch which
needs e.g. crurrenly an interaction when do bacth scanning. This PR enables
to supply WARNINgs / --warnings =off before so that the intercation is mot
needed.

See also #2496.
2024-05-24 13:53:09 +02:00
Dirk
e49747ca14 Add / improve #2490 2024-04-26 16:29:43 +02:00
Dirk
a3d3133c59 Add / improve #2490 2024-04-26 16:10:03 +02:00
Jim
6d2aef5c7d
Update testssl.sh
added new line character on line 17366
2024-04-24 15:47:34 -07:00
Emmanuel Fusté
6d80ec189f Small important fixes:
- In case of multiple IP testing, clear ERRFILE bettween runs
- Zero return value with server connection close should be taken into
  account in the looping logic case too. Add it.
- Break the wait loop in case of connection close for faster result.
- Ignore "notAfter" in the wait loop for expired certificates.
- Indentation and tab cleanup.

Tested on 57 url with previously suspicious results with success. No
regressions on 50 others.
2024-03-26 12:23:38 +01:00
Dirk Wetter
375ddf565c
Merge pull request #2475 from Tazmaniac/renego_timing_fix2
Renego timing fix2
2024-03-14 13:57:53 +01:00
Maurizio S
a1dae24a20
Fix: modified mtls option location in s_client_options() and code cleanup 2024-03-09 09:21:50 +01:00
Emmanuel Fusté
426bfa6cd5 Fix the cleanup ... 2024-03-06 16:02:19 +01:00
Emmanuel Fusté
2824e347b4 Cleanup bash $(( )) arithmetic usage 2024-03-06 15:44:34 +01:00
Emmanuel Fusté
43e55617bb errorlog filtering fix
Filter out verify and deph lines to not reintrodure timing race
condition.
2024-03-06 14:53:34 +01:00
Emmanuel Fusté
91367caa71 Fix and optimisation
There is a race condition if openssl exit during a renego but after
the RENEGOTIATING printing.
In this case we could issue a R before the process exit and be blocked
in the waiting loop.
With the safety guards in place (loop count + timeout) this is harmless
but not optimal.
Fix this by:
- reordering the sleep vs echo to let the process exit and catch the
  pipe error more frequently.
- exit the while loop if RENEGOTIATING is not the last log line. We
  will catch the pipe error on the next for loop echo.
- correct the k variable initialisation
- correct the for (( ; ; )) variable $ convention usage
- reduce the while loop count limit to 120 to align with the global
  timeout
2024-03-06 13:57:21 +01:00
Emmanuel Fusté
35496e5c5f Clean up watchdog file logic 2024-03-04 19:16:48 +01:00
Emmanuel Fusté
81167dc908 Fixes:
- Add safety gards againts infinite sleep loop
- correct the for loop test
- reverse the watchdog file logic for sleep loop. No timing dependance.
2024-03-04 18:48:21 +01:00
Emmanuel Fusté
8627ba518f Kill the heuristic an count the real number of renegociations
The heuristic is too fragile and timing dependant.

- As for the initial TLS negociation, wait for the result of the
  renegociation request before sending the next one.
- Remove the result ratio calculation and message as we now reach the
  timeout in case of exponential backoff or connection hang.

This commit depend on the fix of the timeout, broken by the zombi fix.
2024-03-01 22:02:00 +01:00
Emmanuel Fusté
2bdbdec5d9 Do not wait on pid you are not a parent.
The zombi fix did too much modifications breaking the global time-out
function.
As the wait $pid failed, we no longer create the watchdog file.
Fix by reverting unnecessary changes.
2024-03-01 17:40:43 +01:00
Dirk
55ae9bf248 Polish PR2461 (mTLS) + label as beta
also revert #1383
2024-02-27 15:59:16 +01:00