What changed, and why it matters
This commit only adds a new constant named maxMessageSize in the brontide/noise.go file. It defines the largest allowed encrypted message size as 65,535 bytes of payload plus 16 bytes of authentication data. The constant is declared but not used anywhere in the visible diff, so it does not change any runtime behavior by itself.
No action needed for this commit alone. Monitor subsequent commits to see how maxMessageSize is used; if it is later wired into message parsing or allocation paths, review that change for correct enforcement and integer handling.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff introduces a single new constant: maxMessageSize = math.MaxUint16 + macSize (65535 + 16). It is grouped with other size-related constants in brontide/noise.go. No logic is modified and the new constant is not referenced in the changed file. It appears to be preparatory or cleanup work for later enforcement of message-size limits.
Changed components
brontide/noise.goInspect captured patch +4 / −0
diff --git a/brontide/noise.go b/brontide/noise.go
index a558063..53f951a 100644
--- a/brontide/noise.go
+++ b/brontide/noise.go
@@ -35,6 +35,10 @@ const (
// header and it's MAC.
encHeaderSize = lengthHeaderSize + macSize
+ // maxMessageSize is the maximum size of an encrypted message including
+ // the MAC. This is the max payload (65535) plus the MAC size (16).
+ maxMessageSize = math.MaxUint16 + macSize
+
// keyRotationInterval is the number of messages sent on a single
// cipher stream before the keys are rotated forwards.
keyRotationInterval = 1000
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.