-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Exit with
ProtocolViolation
if a packet has no frames (#1779)
* fix: Exit with `ProtocolViolation` if a packet has no frames Fixes #1476 * Fix comment * Cleanup * Simplify * Address code review * Clippy
- Loading branch information
1 parent
94f8e68
commit 27a7250
Showing
3 changed files
with
75 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1552,6 +1552,10 @@ impl Connection { | |
packet: &DecryptedPacket, | ||
now: Instant, | ||
) -> Res<bool> { | ||
(!packet.is_empty()) | ||
.then_some(()) | ||
.ok_or(Error::ProtocolViolation)?; | ||
|
||
// TODO([email protected]): Have the server blow away the initial | ||
// crypto state if this fails? Otherwise, we will get a panic | ||
// on the assert for doesn't exist. | ||
|
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
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