mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-18 17:26:19 +00:00
proto: Reject RetryToken with extra bytes
This probably won't affect much, but is slightly more defensive.
This commit is contained in:
@@ -119,6 +119,11 @@ impl RetryToken {
|
||||
let orig_dst_cid = ConnectionId::decode_long(&mut reader)?;
|
||||
let issued = decode_unix_secs(&mut reader)?;
|
||||
|
||||
if !reader.is_empty() {
|
||||
// Consider extra bytes a decoding error (it may be from an incompatible endpoint)
|
||||
return None;
|
||||
}
|
||||
|
||||
Some(Self {
|
||||
address,
|
||||
orig_dst_cid,
|
||||
|
||||
Reference in New Issue
Block a user