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

Avoid clearing sequential bits in a loop #59

Merged
merged 1 commit into from
Apr 1, 2019
Merged

Conversation

vkrasnov
Copy link
Contributor

@vkrasnov vkrasnov commented Apr 1, 2019

Fixes #54

@vkrasnov vkrasnov requested a review from Lekensteyn April 1, 2019 14:01
Copy link

@Lekensteyn Lekensteyn left a comment

Choose a reason for hiding this comment

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

See inline comment for one issue.

Another missing thing to fully address #54 is an explicit check against reaching message limits. That would also remove any concern for integer overflows.

src/noise/session.rs Outdated Show resolved Hide resolved
src/noise/session.rs Show resolved Hide resolved
@Lekensteyn
Copy link

LGTM. Would you consider adding a check for counters past the limits in #54 though? As you said it won't happen in practice, but since it is not permitted by the spec it should not hurt to block it either.

@vkrasnov
Copy link
Contributor Author

vkrasnov commented Apr 1, 2019

I think the implementation (or did I see it somewhere else?) says that the numbers are a placeholder in case a realistic limit is needed. But since those are hardcoded, the value can only change with the implementation anyway

@Lekensteyn
Copy link

At least the Linux kernel implementation does have an explicit check for those insanely large numbers. In the protocol spec (whitepaper), the counter starts at 0 and increases for every data packet. So it seems reasonable to me to check the counter against the REJECT-AFTER-MESSAGES limit.

@vkrasnov vkrasnov merged commit b9d72f7 into master Apr 1, 2019
@vkrasnov vkrasnov deleted the replay_counter branch April 1, 2019 23:03
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.

None yet

2 participants