]> Cypherpunks.ru repositories - nncp.git/commitdiff
Restore nonce state before temporary file decryption
authorSergey Matveev <stargrave@stargrave.org>
Sat, 3 Jul 2021 15:53:34 +0000 (18:53 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 4 Jul 2021 17:11:24 +0000 (20:11 +0300)
doc/news.ru.texi
doc/news.texi
src/tx.go

index 3e0fe647013658522db411a4843546b819ac97f7..967f8681781abefa105464874fb3df837fd300fb 100644 (file)
@@ -5,6 +5,10 @@
 @subsection Релиз 7.1.0
 @itemize
 
+@item
+Исправлена работоспособность @command{nncp-file} и @command{nncp-exec}
+команд использующих временный файл (stdin и @option{-use-tmp}).
+
 @item
 Исправлено некорректное генерирование @file{.hdr} при использовании
 транзитных пакетов.
index cfa36c4ddc42c97d6b58f9ffd3764796a8adf469..160fd39fee086c485619bd7a078d04729bfc12b9 100644 (file)
@@ -7,6 +7,10 @@ See also this page @ref{Новости, on russian}.
 @section Release 7.1.0
 @itemize
 
+@item
+Fixed workability of @command{nncp-file} and @command{nncp-exec}
+commands, that use temporary file (stdin and @option{-use-tmp}).
+
 @item
 Fixed invalid @file{.hdr} generation when transitional packets are used.
 
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
                }