Fix spec compliant record size verification#5
Open
p1gp1g wants to merge 2 commits intotink-crypto:mainfrom
Open
Fix spec compliant record size verification#5p1gp1g wants to merge 2 commits intotink-crypto:mainfrom
p1gp1g wants to merge 2 commits intotink-crypto:mainfrom
Conversation
Spec compliant records were throwing issues during decryption due to a bug in record size verification
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
The recordSize is get from the encrypted payload. If we check against the exact value of this.recordSize, and the server sends non-constant RS values, then we need to parse the message twice: once to get the RS for the builder, and again during decryption. As of RFC8818, recordSize is used to set a maximum bound for the encrypted payload to parse. Therefore, there is no issues if the recordSize we receive is lower than the one we defined. As long as this recordSize is higher than the actual recode size. this.recordSize is always < MAX_CIPHERTEXT_SIZE.
Merged
4 tasks
9 tasks
Adeeq24
approved these changes
Mar 27, 2025
uxannah
approved these changes
May 26, 2025
uxannah
approved these changes
Dec 3, 2025
uxannah
approved these changes
Dec 10, 2025
uxannah
approved these changes
Dec 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spec compliant records were throwing issues during decryption due to a bug in record size verification: it was verified against the length of the record with the header which isn't what RFC8188 specify, leading to bugs with some push servers. For example: