mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2026-10-02 21:36:06 +03:00
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:
1 parent
08271d00b3
commit
1b86b2ae0e
1 file changed
+1
-1
+1
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user