Repository navigation
Conversation
Signed-off-by: Ym <173550318+MaxonT@users.noreply.github.com>
Author
|
Hi @akareddy04, could you please review this when you have a moment? In short: Allow frame sizes up to 2^32 - 1. I think this will be really valuable. You may want to take a look. Thanks! |
This branch has not been deployed
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.
Frame size in the message format is an unsigned 32-bit value, so this raises the limit from 2^31 - 1 to 2^32 - 1 as issue #130 asks; tell me if you would rather keep the old check.
Fixes #130
MAX_FRAME_SIZEis now2**32 - 1. The frame length is already written and read as>I(an unsigned 32-bit integer), so nothing else in serialization changes. With that limit, a header can no longer carry a frame length above the maximum, so the "frame length larger than allowed maximum" check indeserialize.pycould never fire and is removed along with its test and the test header that packedMAX_FRAME_SIZE + 1(which no longer fits in 32 bits).validate_frame_lengthstill rejects anything above the limit on the encrypt side.Tests:
test_defaults.pynow expects2**32 - 1, and a newtest_validate_frame_length_above_signed_32_bit_limitchecks that2**31and2**32 - 128are accepted. With the old constant that new test fails.What I ran:
pytest test/unit(4229 passed, 20 skipped) in a fresh venv on this branch. Not run: integration tests, and no test encrypts a message with a frame of more than 2 GiB, because that needs several GiB of memory.