-
Notifications
You must be signed in to change notification settings - Fork 214
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
fix(dht/test): ban peers who send empty encrypted messages #5130
Merged
stringhandler
merged 1 commit into
tari-project:development
from
AaronFeickert:ban-test
Jan 31, 2023
Merged
fix(dht/test): ban peers who send empty encrypted messages #5130
stringhandler
merged 1 commit into
tari-project:development
from
AaronFeickert:ban-test
Jan 31, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Interestingly, prior to the earlier fix PR, the |
AaronFeickert
force-pushed
the
ban-test
branch
from
January 22, 2023 01:59
9faca81
to
ef7544b
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.
Nice addition. Just one comment below.
AaronFeickert
force-pushed
the
ban-test
branch
from
January 23, 2023 19:48
ef7544b
to
3141f5a
Compare
AaronFeickert
changed the title
test: ban peers who forward unsigned encrypted messages
fix & test: ban peers who send empty messages
Jan 23, 2023
AaronFeickert
changed the title
fix & test: ban peers who send empty messages
fix(dht/test): ban peers who send empty messages
Jan 23, 2023
AaronFeickert
force-pushed
the
ban-test
branch
from
January 23, 2023 20:13
3141f5a
to
fae912a
Compare
AaronFeickert
changed the title
fix(dht/test): ban peers who send empty messages
fix(dht/test): ban peers who send empty encrypted messages
Jan 24, 2023
AaronFeickert
force-pushed
the
ban-test
branch
from
January 24, 2023 14:26
fae912a
to
9f08fc8
Compare
AaronFeickert
force-pushed
the
ban-test
branch
from
January 25, 2023 17:58
0ac3c70
to
4be24c0
Compare
AaronFeickert
force-pushed
the
ban-test
branch
from
January 30, 2023 15:40
4be24c0
to
4f9528b
Compare
stringhandler
approved these changes
Jan 31, 2023
stringhandler
pushed a commit
to tari-project/rfcs
that referenced
this pull request
Jan 31, 2023
Description --- Clarifies empty body rules for EnvelopeBody Motivation and Context --- In the encrypted case, a valid node should discard a message if the encoded `EnvelopeBody` is zero-sized. A cleartext `EnvelopeBody` may be zero-sized as this is valid proto3 encoding. Ref tari-project/tari#5130
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Bans peers who send empty encrypted messages. Significantly updates tests to check for more failure modes and assert ban status for each.
Closes issue 5132.
Motivation and Context
An earlier PR introduces an error when a peer sends an empty encrypted message, which is not allowed. However, the peer was not banned.
Further, another PR updates the handling of unsigned encrypted messages to ensure that bans are done correctly, but does not update tests to check for the bug that led to it.
This PR updates the banning logic to ban a peer who forwards an empty encrypted message, which is always detectable.
It also significantly refactors and updates tests. For each relevant high-level message failure mode, we test for proper error detection. We also check for the proper ban status of the forwarding peer.
How Has This Been Tested?
Who tests the testers?