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

bwtester: fix incompatibility in PRG packet data #217

Merged
merged 1 commit into from
Jan 7, 2022
Merged

Conversation

matzf
Copy link
Contributor

@matzf matzf commented Jan 7, 2022

In #209, we introduced a reusable internal buffer for filling the
packets with PRG data. This buffer was not fully reset for each packet,
resulting in a different output and thus an incompatibility with the
older implementation. Only for the first packet, we would get the
"correct" result, all subsequent packets are rejected.

Fix by resetting buffer on each Fill call.

Looking at this code, I've noticed that the packet data is not actually
filled with PRG data. Only the first 16 bytes, plus a few bytes at the
end, are ever filled with the PRG output. We should just simplify this
anyway.


This change is Reviewable

In #209, we introduced a reusable internal buffer for filling the
packets with PRG data. This buffer was not fully reset for each packet,
resulting in a different output and thus an incompatibility with the
older implementation. Only for the first packet, we would get the
"correct" result, all subsequent packets are rejected.

Fix by resetting buffer on each Fill call.

Looking at this code, I've noticed that the packet data is not actually
filled with PRG data. Only the first 16 bytes, plus a few bytes at the
end, are ever filled with the PRG output. We should just simplify this
anyway.
Copy link
Member

@marcfrei marcfrei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@matzf matzf merged commit 055d401 into master Jan 7, 2022
@matzf matzf deleted the matzf/bwtest-fix branch January 7, 2022 12:44
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

Successfully merging this pull request may close these issues.

2 participants