]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/tx.go
Restore nonce state before temporary file decryption
[nncp.git] / src / tx.go
index a90a49e42d05f0f96e3639e3740099f15a40c29c..681f9786038ec6fc8ed38960c6bbd3caab18d687 100644 (file)
--- a/src/tx.go
+++ b/src/tx.go
@@ -316,6 +316,9 @@ func throughTmpFile(r io.Reader) (
        }
        r, w := io.Pipe()
        go func() {
+               for i := 0; i < aead.NonceSize(); i++ {
+                       nonce[i] = 0
+               }
                if _, err := aeadProcess(aead, nonce, nil, false, bufio.NewReader(src), w); err != nil {
                        w.CloseWithError(err) // #nosec G104
                }