]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commitdiff
go test: put nonce at correct location
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 7 Jul 2016 00:32:40 +0000 (02:32 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Thu, 7 Jul 2016 00:33:29 +0000 (02:33 +0200)
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
contrib/external-tests/go/main.go

index 86fe192c8880ca463970a3fd7731667deb0f186f..a06b565eedb1d4313d764a9097fb37a3364a6b28 100644 (file)
@@ -80,7 +80,7 @@ func main() {
        keepalivePacket := make([]byte, 13)
        keepalivePacket[0] = 4 // Type: Data
        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)
        if _, err := conn.Write(keepalivePacket); err != nil {
                log.Fatalf("error writing keepalive packet: %s", err)