Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Right-to-left parsing #90

Open
treiher opened this issue Nov 7, 2019 · 0 comments
Open

Right-to-left parsing #90

treiher opened this issue Nov 7, 2019 · 0 comments

Comments

@treiher
Copy link
Collaborator

treiher commented Nov 7, 2019

One TLS 1.3 message needs to be parsed from right to left. An optional and variable number of zero bytes must be read until a marker (Content_Type) is found. All bytes left to the marker represent the content of the message.

We think the fields should be specified in the order in that the fields will be parsed (i.e. in reversed order of the actual message format):

   type TLS_Inner_Plaintext is
      message
         Zeros : Padding
            with Marker => Content_Type;
         Tag : Content_Type
            then Content
               with Length => Message'Length - Zeros'Length - Tag'Length
               if Tag = APPLICATION
                  or ((Tag = ALERT or Tag = HANDSHAKE)
                      and Message'Length - Zeros'Length - Tag'Length > 0)
         Content : Payload;
      end message
         with Order => Right_To_Left;

The shown example also depends on #61 and #62.

@treiher treiher changed the title Allow right-to-left parsing Right-to-left parsing May 28, 2020
@treiher treiher added the v0.4.1 label Jul 14, 2020
@treiher treiher added the v0.5.0 label Jul 9, 2021
treiher pushed a commit that referenced this issue Oct 5, 2022
treiher pushed a commit that referenced this issue Oct 5, 2022
Calculate TLS_Heartbeat message with TLS_Plaintext_Length
as defined in rfc6520.

ref #90
treiher pushed a commit that referenced this issue Oct 6, 2022
treiher pushed a commit that referenced this issue Oct 6, 2022
Calculate TLS_Heartbeat message with TLS_Plaintext_Length
as defined in rfc6520.

ref #90
treiher pushed a commit that referenced this issue Oct 6, 2022
treiher pushed a commit that referenced this issue Oct 6, 2022
Calculate TLS_Heartbeat message with TLS_Plaintext_Length
as defined in rfc6520.

ref #90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants