From d089900632771a2c1b79129ad91d3f1894e44172 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Tue, 20 Jan 2015 23:22:44 +0000 Subject: [PATCH] fix crypto --- router/crypto.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/router/crypto.go b/router/crypto.go index 0bb7dd14..c8cd1e8e 100644 --- a/router/crypto.go +++ b/router/crypto.go @@ -85,7 +85,8 @@ func EncodeNonce(df bool) (*[24]byte, []byte, error) { flags = flags | 1 } SetNonceLow15Bits(&nonce, flags) - return &nonce, nonce[:], nil + // NB: need to make a copy since callers may modify the array + return &nonce, Concat(nonce[:]), nil } func DecodeNonce(msg []byte) (bool, *[24]byte) {