You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Boundary condition error in VerifyStream (#509)
Fixes: #507
Tests exist that push a single byte at a time.
This will hit every boundary condition.
However this is not complete enough.
State can be reset as the code transitions
from one boundary condition to another.
The prime example of this problem
the `VerifyStream`.
It has 4 boundary in the `_transform` function.
The body header, the body, the auth tag, and signature.
By sending 1 byte
as the code transitions from the body header
to the body
the code handling the exiting
of the body header has no way to interact
with the body,
because the 1 byte of data
completely isolates these code branches.
In this case the code was buffering
the body header in `frameBuffer`
but when exiting this section
and passing control to
the actual content section,
it used the `chunk` to form the tail.
When passing a single byte,
this tail would _always_ be empty,
because it would have been incorporated
into the frame header.
Adding tests to span
the boundary conditions
to verify both this fix
and that there are not other lurking.
0 commit comments