fix: wrong trailerLen for HandshakeCookie message

* AWG3.1-related changes indroduced a new bug with HandshakeCookie
  buffer size. Instead of adding trailerLen to the final size, it is
getting provided as a capacity param leading to the wrong behavior and
runtime panic while RandomTrailers is used
* Must be the typo :_)
This commit is contained in:
Yaroslav Gurov authored and Yaroslav Gurov committed 2026-08-13 21:36:22 +02:00
1 parent 08271d00b3
commit 1b86b2ae0e
1 file changed
+1 -1
+1 -1
View File
@@ -263,7 +263,7 @@ func (device *Device) SendHandshakeCookie(initiatingElem *QueueHandshakeElement)
padding := int(device.paddings.cookie.Load())
trailerLen := max(device.randomTrailer(padding+MessageCookieReplySize), 0)
buf := make([]byte, padding+MessageCookieReplySize, trailerLen)
buf := make([]byte, padding+MessageCookieReplySize+trailerLen)
crypt := buf[:padding]
rand.Read(crypt)