From d80e0e9f95e781dae5cd3e18026ee61d65837281 Mon Sep 17 00:00:00 2001 From: Dirk Wetter Date: Fri, 27 Jun 2025 19:09:01 +0200 Subject: [PATCH 1/2] Make code2network() faster by using bash only --- testssl.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/testssl.sh b/testssl.sh index fac999f..a2a9c69 100755 --- a/testssl.sh +++ b/testssl.sh @@ -12139,16 +12139,20 @@ send_close_notify() { fi } -# Format string properly for socket -# ARG1: any commented sequence of two bytes hex, separated by commas. It can contain comments, new lines, tabs and white spaces -# NW_STR holds the global with the string prepared for printf, like '\x16\x03\x03\' +# Format string properly for socket in ARG1 as it can be found here +# ARG1: sequence of 2 bytes hex, separated by commas. Can contain comments, new lines, tabs + white spaces +# NW_STR: holds afterwards the global with the string prepared for printf, like '\x16\x03\x03\' +# code2network() { - NW_STR=$(sed -e 's/,/\\\x/g' <<< "$1" | sed -e 's/# .*$//g' -e 's/ //g' -e '/^$/d' | tr -d '\n' | tr -d '\t') + NW_STR="$(sed -e 's/,/\\\x/g' -e 's/# .*$//g' -e 's/ //g' -e '/^$/d' <<< "$1")" + NW_STR="${NW_STR//$'\n'/}" + NW_STR="${NW_STR//$'\t'/}" } # sockets inspired by https://blog.chris007.de/using-bash-for-network-socket-operation/ # ARG1: hexbytes separated by commas, with a leading comma # ARG2: seconds to sleep +# socksend_clienthello() { local data="" @@ -12167,6 +12171,7 @@ socksend_clienthello() { # ARG1: hexbytes -- preceded by x -- separated by commas, with a leading comma # ARG2: seconds to sleep +# socksend() { local data line From 9511f3b9db816d2ea4f7f0a65133a0afc1145642 Mon Sep 17 00:00:00 2001 From: Dirk Wetter Date: Thu, 3 Jul 2025 16:59:54 +0200 Subject: [PATCH 2/2] Fix 52_ocsp_revoked (OCSP --> CRL) --- t/52_ocsp_revoked.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/52_ocsp_revoked.t b/t/52_ocsp_revoked.t index a9b29a9..6b8e186 100755 --- a/t/52_ocsp_revoked.t +++ b/t/52_ocsp_revoked.t @@ -31,8 +31,8 @@ system("@args") == 0 or die ("FAILED: \"@args\" "); $cat_csv=`cat $csv`; -# Is the certificate revoked? -like($cat_csv, qr/"cert_ocspRevoked".*"CRITICAL","revoked"/,"The certificate should be revoked"); +# Is the certificate revoked? (formerly: OCSP, now: CRL) +like($cat_csv, qr/"cert_crlRevoked".*"CRITICAL","revoked"/,"The certificate should be revoked"); $tests++; unlink $csv;