From b054b5d687583fba470f35c41b60421a3c6a1ca7 Mon Sep 17 00:00:00 2001 From: Dirk Date: Tue, 28 Jan 2025 22:15:17 +0100 Subject: [PATCH] two sieve fixes * one logical error * removing check for trailing space for OK --- testssl.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/testssl.sh b/testssl.sh index 6d99b1a..533477d 100755 --- a/testssl.sh +++ b/testssl.sh @@ -11500,8 +11500,7 @@ starttls_full_read(){ debugme tmln_out "${debugpad} ${one_line} " IFS="${oldIFS}" break - fi - if [[ ! ${one_line} =~ ${cont_pattern} ]]; then + elif [[ ! ${one_line} =~ ${cont_pattern} ]]; then debugme echo "=== full read syntax error, expected regex pattern ${cont_pattern} (cont) or ${end_pattern} (end) ===" IFS="${oldIFS}" ret_found=2 @@ -11607,9 +11606,9 @@ starttls_sieve_dialog() { [[ -n "$1" ]] && starttls="$starttls\r\n$1" # this adds a payload if supplied debugme echo "=== starting sieve STARTTLS dialog ===" - starttls_full_read '^"' '^OK ' '"STARTTLS"' "received server capabilities and checked STARTTLS availability" && + starttls_full_read '^"' '^OK' '"STARTTLS"' "received server capabilities and checked STARTTLS availability" && starttls_just_send "$starttls" "initiated STARTTLS" && - starttls_full_read '^OK ' '^OK ' '' "received ack for STARTTLS" + starttls_full_read '^OK' '^OK' '' "received ack for STARTTLS" ret=$? debugme echo "=== finished sieve STARTTLS dialog with ${ret} ===" return $ret