-
Notifications
You must be signed in to change notification settings - Fork 329
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 validation of allowed CrdsValues in gossip #4764
base: master
Are you sure you want to change the base?
Conversation
Protocol enum variants can now be pruned better in Sanitize impl
4691581
to
d7dd5f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i know its just a draft pr rn. big question is if we can actually get rid of LegacyVersion
CrdsData::LegacyVersion(_) => { | ||
return Err(SanitizeError::InvalidValue); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@behzadnouri, do we still need to support LegacyVersion
? If not, maybe it makes sense to remove it from CrdsData
as well.
for v in val { | ||
match v.data() { | ||
CrdsData::LegacyVersion(_) => { | ||
return Err(SanitizeError::InvalidValue); | ||
} | ||
_ => { | ||
v.sanitize()?; | ||
} | ||
} | ||
} | ||
Ok(()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we are going to reject LegacyVersion
, I would just reject and return an error here:
Line 92 in 15a9d9c
CrdsData::LegacyVersion(version) => version.sanitize(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess so, yes. The question is what is the standard of proof to properly deprecate it for good.
Style change for PullRequest sanitize. Co-authored-by: Greg Cusack <[email protected]>
Protocol enum variants can now be pruned better in Sanitize impl
Problem
Sanitize implementation allowed certain invalid PullRequest variants to travel through the code
Summary of Changes