Merge pull request #2367 from drwetter/Improve_ServerHello_ErrorMessage

Make clear where the parsing error comes from: SSL or TLS
This commit is contained in:
Dirk Wetter 2023-06-05 12:45:28 +02:00 committed by GitHub
commit 7f49af1100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12126,7 +12126,7 @@ parse_sslv2_serverhello() {
[[ "$DEBUG" -ge 5 ]] && echo "$v2_hello_ascii" [[ "$DEBUG" -ge 5 ]] && echo "$v2_hello_ascii"
if [[ -z "$v2_hello_ascii" ]]; then if [[ -z "$v2_hello_ascii" ]]; then
ret=0 # 1 line without any blanks: no server hello received ret=0 # 1 line without any blanks: no server hello received
debugme echo "server hello empty" debugme echo "(SSLv2) ServerHello empty"
else else
# now scrape two bytes out of the reply per byte # now scrape two bytes out of the reply per byte
v2_hello_initbyte="${v2_hello_ascii:0:1}" # normally this belongs to the next, should be 8! v2_hello_initbyte="${v2_hello_ascii:0:1}" # normally this belongs to the next, should be 8!
@ -12156,7 +12156,7 @@ parse_sslv2_serverhello() {
elif [[ $v2_hello_initbyte != "8" ]] || [[ $v2_hello_handshake != "04" ]]; then elif [[ $v2_hello_initbyte != "8" ]] || [[ $v2_hello_handshake != "04" ]]; then
ret=1 ret=1
if [[ $DEBUG -ge 2 ]]; then if [[ $DEBUG -ge 2 ]]; then
echo "no correct server hello" echo "no correct (SSLv2) ServerHello"
echo "SSLv2 server init byte: 0x0$v2_hello_initbyte" echo "SSLv2 server init byte: 0x0$v2_hello_initbyte"
echo "SSLv2 hello handshake : 0x$v2_hello_handshake" echo "SSLv2 hello handshake : 0x$v2_hello_handshake"
fi fi
@ -14179,7 +14179,7 @@ parse_tls_serverhello() {
done done
if [[ $tls_serverhello_ascii_len -eq 0 ]]; then if [[ $tls_serverhello_ascii_len -eq 0 ]]; then
debugme echo "server hello empty, TCP connection closed" debugme echo "(TLS) ServerHello empty, TCP connection closed"
DETECTED_TLS_VERSION="closed TCP connection " DETECTED_TLS_VERSION="closed TCP connection "
[[ $DEBUG -ge 1 ]] && tmpfile_handle ${FUNCNAME[0]}.txt [[ $DEBUG -ge 1 ]] && tmpfile_handle ${FUNCNAME[0]}.txt
return 1 # no server hello received return 1 # no server hello received