Merge pull request #1483 from dcooper16/minor_code_cleanup

Minor code cleanup
This commit is contained in:
Dirk Wetter 2020-01-31 08:41:43 +01:00 committed by GitHub
commit 89fd902b18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 14 deletions

View File

@ -12217,8 +12217,10 @@ check_tls_serverhellodone() {
[[ $remaining -lt 10 ]] && return 1 [[ $remaining -lt 10 ]] && return 1
tls_content_type="${tls_hello_ascii:i:2}" tls_content_type="${tls_hello_ascii:i:2}"
[[ "$tls_content_type" != 14 ]] && [[ "$tls_content_type" != 15 ]] && \ case "$tls_content_type" in
[[ "$tls_content_type" != 16 ]] && [[ "$tls_content_type" != 17 ]] && return 2 14|15|16|17) ;;
*) return 2 ;;
esac
i=$i+2 i=$i+2
tls_protocol="${tls_hello_ascii:i:4}" tls_protocol="${tls_hello_ascii:i:4}"
[[ -z "$DETECTED_TLS_VERSION" ]] && DETECTED_TLS_VERSION="$tls_protocol" [[ -z "$DETECTED_TLS_VERSION" ]] && DETECTED_TLS_VERSION="$tls_protocol"
@ -12298,13 +12300,11 @@ check_tls_serverhellodone() {
done done
tls_content_type="${plaintext:plaintext_len:2}" tls_content_type="${plaintext:plaintext_len:2}"
decrypted_response+="${tls_content_type}0301$(printf "%04X" $((plaintext_len/2)))${plaintext:0:plaintext_len}" decrypted_response+="${tls_content_type}0301$(printf "%04X" $((plaintext_len/2)))${plaintext:0:plaintext_len}"
if [[ "$tls_content_type" == 16 ]]; then case "$tls_content_type" in
tls_handshake_ascii+="${plaintext:0:plaintext_len}" 15) tls_alert_ascii+="${plaintext:0:plaintext_len}" ;;
elif [[ "$tls_content_type" == 15 ]]; then 16) tls_handshake_ascii+="${plaintext:0:plaintext_len}" ;;
tls_alert_ascii+="${plaintext:0:plaintext_len}" *) return 2 ;;
else esac
return 2
fi
fi fi
done done
@ -12529,11 +12529,10 @@ parse_tls_serverhello() {
fi fi
fi fi
if [[ $tls_content_type == 16 ]]; then case "$tls_content_type" in
tls_handshake_ascii="$tls_handshake_ascii${tls_hello_ascii:i:msg_len}" 15) tls_alert_ascii="$tls_alert_ascii${tls_hello_ascii:i:msg_len}" ;;
elif [[ $tls_content_type == 15 ]]; then # TLS ALERT 16) tls_handshake_ascii="$tls_handshake_ascii${tls_hello_ascii:i:msg_len}" ;;
tls_alert_ascii="$tls_alert_ascii${tls_hello_ascii:i:msg_len}" esac
fi
done done
# Now check the alert messages. # Now check the alert messages.