go test: put nonce at correct location
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
85a14af6b0
commit
5a427c7024
|
@ -80,7 +80,7 @@ func main() {
|
||||||
keepalivePacket := make([]byte, 13)
|
keepalivePacket := make([]byte, 13)
|
||||||
keepalivePacket[0] = 4 // Type: Data
|
keepalivePacket[0] = 4 // Type: Data
|
||||||
binary.LittleEndian.PutUint32(keepalivePacket[1:], theirIndex)
|
binary.LittleEndian.PutUint32(keepalivePacket[1:], theirIndex)
|
||||||
binary.LittleEndian.PutUint64(keepalivePacket[3:], 0) // Nonce
|
binary.LittleEndian.PutUint64(keepalivePacket[5:], 0) // Nonce
|
||||||
keepalivePacket = sendCipher.Encrypt(keepalivePacket, nil, nil)
|
keepalivePacket = sendCipher.Encrypt(keepalivePacket, nil, nil)
|
||||||
if _, err := conn.Write(keepalivePacket); err != nil {
|
if _, err := conn.Write(keepalivePacket); err != nil {
|
||||||
log.Fatalf("error writing keepalive packet: %s", err)
|
log.Fatalf("error writing keepalive packet: %s", err)
|
||||||
|
|
Loading…
Reference in a new issue