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

Add tests for unusual payload lengths #108

Open
1tgr opened this issue Jun 29, 2020 · 0 comments
Open

Add tests for unusual payload lengths #108

1tgr opened this issue Jun 29, 2020 · 0 comments

Comments

@1tgr
Copy link

1tgr commented Jun 29, 2020

From the RFC: https://tools.ietf.org/html/rfc6455

Note that in all cases, the minimal number of bytes MUST be used to encode the length, for example, the length of a 124-byte-long string can't be encoded as the sequence 126, 0, 124.

Implementations must reject:

  • Lengths < 126 encoded using 16 bits or 64 bits
  • Lengths < 65536 encoded using 64 bits

Also:

If 127, the following 8 bytes interpreted as a 64-bit unsigned integer (the most significant bit MUST be 0) are the payload length.

and:

frame-payload-length-63 = %x0000000000000000-7FFFFFFFFFFFFFFF
                        ; 64 bits in length

So any frames with a payload length >= 0x80000000_00000000 must be rejected.

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

1 participant