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) {