Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

allow unencrypted alerts just before encrypted messages #499

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

tomato42
Copy link
Member

@tomato42 tomato42 commented Aug 3, 2023

In some situations, the other side of the connection may send an unencrypted alert when we expect encrypted messages, that causes the decryption to fail instead of returning the alert to the calling application.

Fixes #344


This change is Reviewable

@tomato42 tomato42 added the bug unintented behaviour in tlslite-ng code label Aug 3, 2023
@tomato42 tomato42 self-assigned this Aug 3, 2023
@tomato42 tomato42 requested a review from ep69 August 3, 2023 13:04
Copy link
Collaborator

@ep69 ep69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about the change header.type != ContentType.change_cipher_spec -> header.type == ContentType.application_data. Could it perhaps run into some of the other ContentType that was not mentioned, like handshake or heartbeat?

@tomato42
Copy link
Member Author

tomato42 commented Aug 3, 2023

  1. all encrypted messages in TLS 1.3 have the external content type of application_data (and that's what we're checking there), so no, the change is correct
  2. no, heartbeat is not supported in TLS 1.3

@tomato42 tomato42 merged commit eace860 into master Aug 4, 2023
42 checks passed
@tomato42 tomato42 deleted the plain-text-alerts branch August 4, 2023 11:25
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug unintented behaviour in tlslite-ng code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plain text alert message handling in TLS1.3
2 participants