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

Reuse MAC writing logic in s2n_record_read #4546

Open
goatgoose opened this issue May 7, 2024 · 1 comment
Open

Reuse MAC writing logic in s2n_record_read #4546

goatgoose opened this issue May 7, 2024 · 1 comment

Comments

@goatgoose
Copy link
Contributor

Problem:

#4539 added a new s2n_record_write_mac function which calculates the record MAC and writes it into a stuffer. This function was added to write the MAC into the record. However, a MAC also needs to be calculated when receiving stream and CBC records in order to compare the calculated MAC against the received MAC. s2n_record_write_mac can be reused for this purpose as well.

Solution:

Reuse s2n_record_write_mac when validating the record MAC:

@goatgoose
Copy link
Contributor Author

Unfortunately this change impacts the sidetrail proofs. When I attempted this it increased sidetrail's runtime by a lot. It might be difficult to implement this and work around all of the proofs.

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

No branches or pull requests

1 participant