mirror of
https://github.com/drwetter/testssl.sh.git
synced 2024-12-29 04:49:44 +01:00
Merge pull request #1781 from drwetter/fix_1779_3.1dev
Fix reading SSLv2 socket
This commit is contained in:
commit
21d0910b50
@ -14300,7 +14300,7 @@ sslv2_sockets() {
|
||||
local cipher_suites="$1"
|
||||
local client_hello len_client_hello
|
||||
local len_ciph_suites_byte len_ciph_suites
|
||||
local server_hello sock_reply_file2
|
||||
local server_hello sock_reply_file2 foo
|
||||
local -i response_len server_hello_len
|
||||
local parse_complete=false
|
||||
|
||||
@ -14355,7 +14355,8 @@ sslv2_sockets() {
|
||||
if [[ -s "$SOCK_REPLY_FILE" ]]; then
|
||||
server_hello=$(hexdump -v -e '16/1 "%02X"' "$SOCK_REPLY_FILE")
|
||||
server_hello_len=$((2 + $(hex2dec "${server_hello:1:3}") ))
|
||||
response_len=$(count_chars "$SOCK_REPLY_FILE")
|
||||
foo="$(wc -c "$SOCK_REPLY_FILE")"
|
||||
response_len="${foo% *}"
|
||||
for (( 1; response_len < server_hello_len; 1 )); do
|
||||
sock_reply_file2=${SOCK_REPLY_FILE}.2
|
||||
mv "$SOCK_REPLY_FILE" "$sock_reply_file2"
|
||||
@ -14367,10 +14368,12 @@ sslv2_sockets() {
|
||||
[[ ! -s "$SOCK_REPLY_FILE" ]] && break
|
||||
cat "$SOCK_REPLY_FILE" >> "$sock_reply_file2"
|
||||
mv "$sock_reply_file2" "$SOCK_REPLY_FILE"
|
||||
response_len=$(count_chars "$SOCK_REPLY_FILE")
|
||||
foo="$(wc -c "$SOCK_REPLY_FILE")"
|
||||
response_len="${foo% *}"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
debugme echo "reading server hello... "
|
||||
if [[ "$DEBUG" -ge 4 ]]; then
|
||||
hexdump -C "$SOCK_REPLY_FILE" | head -6
|
||||
|
Loading…
Reference in New Issue
Block a user