@@ -117,7 +117,7 @@ trap "child_error" USR1
117117
118118########### Internal definitions
119119#
120- declare -r VERSION="3.0.3 "
120+ declare -r VERSION="3.0.4 "
121121declare -r SWCONTACT="dirk aet testssl dot sh"
122122grep -E -q "dev|rc|beta" <<< "$VERSION" && \
123123 SWURL="https://testssl.sh/dev/" ||
@@ -1250,10 +1250,6 @@ strip_inconsistent_ciphers() {
12501250 return 0
12511251}
12521252
1253- count_chars() {
1254- echo $(wc -c <<< "$1")
1255- }
1256-
12571253newline_to_spaces() {
12581254 tr '\n' ' ' <<< "$1" | sed 's/ $//'
12591255}
@@ -12776,7 +12772,7 @@ sslv2_sockets() {
1277612772 local cipher_suites="$1"
1277712773 local client_hello len_client_hello
1277812774 local len_ciph_suites_byte len_ciph_suites
12779- local server_hello sock_reply_file2
12775+ local server_hello sock_reply_file2 foo
1278012776 local -i response_len server_hello_len
1278112777 local parse_complete=false
1278212778
@@ -12830,7 +12826,8 @@ sslv2_sockets() {
1283012826 if [[ -s "$SOCK_REPLY_FILE" ]]; then
1283112827 server_hello=$(hexdump -v -e '16/1 "%02X"' "$SOCK_REPLY_FILE")
1283212828 server_hello_len=$((2 + $(hex2dec "${server_hello:1:3}") ))
12833- response_len=$(count_chars "$SOCK_REPLY_FILE")
12829+ foo="$(wc -c "$SOCK_REPLY_FILE")"
12830+ response_len="${foo% *}"
1283412831 for (( 1; response_len < server_hello_len; 1 )); do
1283512832 sock_reply_file2=${SOCK_REPLY_FILE}.2
1283612833 mv "$SOCK_REPLY_FILE" "$sock_reply_file2"
@@ -12842,10 +12839,12 @@ sslv2_sockets() {
1284212839 [[ ! -s "$SOCK_REPLY_FILE" ]] && break
1284312840 cat "$SOCK_REPLY_FILE" >> "$sock_reply_file2"
1284412841 mv "$sock_reply_file2" "$SOCK_REPLY_FILE"
12845- response_len=$(count_chars "$SOCK_REPLY_FILE")
12842+ foo="$(wc -c "$SOCK_REPLY_FILE")"
12843+ response_len="${foo% *}"
1284612844 done
1284712845 fi
1284812846 fi
12847+
1284912848 debugme echo "reading server hello... "
1285012849 if [[ "$DEBUG" -ge 4 ]]; then
1285112850 hexdump -C "$SOCK_REPLY_FILE" | head -6
0 commit comments