ninjasource / embedded-websocket

A rust websocket library for embedded systems (no_std)
Apache License 2.0
98 stars 28 forks source link

Rotate mask_key in read_into_buffer to fix corruption in multi-part messages #8

Closed lhallam closed 2 years ago

lhallam commented 2 years ago

read_into_buffer always starts reading messages using the first byte of the mask. This is invalid for continuations of messages where the length of any of the previous parts isn't a multiple of four.

To fix this we rotate the mask key after reading so that future messages start reading from the next byte.

ninjasource commented 2 years ago

Hey thanks for your contribution. Looks good.