Skip to content

Commit a8c8bfe

Browse files
authored
Fix decrypting TLS 1.3 server response
There is at least one server that includes a new session ticket in the same packet as the Finished message. This confuses check_tls_serverhellodone() since the new session ticket is encrypted under the application traffic keys rather than the handshake keys. check_tls_serverhellodone(), being unable to decrypt the new session ticket, reports a failure and does not return any of the decrypted data. This commit fixes the problem by having check_tls_serverhellodone() simply ignore any data that appears after the Finished message.
1 parent bac8cb7 commit a8c8bfe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

testssl.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11715,6 +11715,8 @@ check_tls_serverhellodone() {
1171511715
decrypted_response+="${tls_content_type}0301$(printf "%04X" $((plaintext_len/2)))${plaintext:0:plaintext_len}"
1171611716
if [[ "$tls_content_type" == 16 ]]; then
1171711717
tls_handshake_ascii+="${plaintext:0:plaintext_len}"
11718+
# Data after the Finished message is encrypted under a different key.
11719+
[[ "${plaintext:0:2}" == 14 ]] && break
1171811720
elif [[ "$tls_content_type" == 15 ]]; then
1171911721
tls_alert_ascii+="${plaintext:0:plaintext_len}"
1172011722
else

0 commit comments

Comments
 (0)