From ed0388f62f72adf8665ee1a5813541c4ce87fd55 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sat, 3 Jul 2021 18:53:34 +0300 Subject: [PATCH] Restore nonce state before temporary file decryption --- doc/news.ru.texi | 4 ++++ doc/news.texi | 4 ++++ src/tx.go | 3 +++ 3 files changed, 11 insertions(+) diff --git a/doc/news.ru.texi b/doc/news.ru.texi index 3e0fe64..967f868 100644 --- a/doc/news.ru.texi +++ b/doc/news.ru.texi @@ -5,6 +5,10 @@ @subsection Релиз 7.1.0 @itemize +@item +Исправлена работоспособность @command{nncp-file} и @command{nncp-exec} +команд использующих временный файл (stdin и @option{-use-tmp}). + @item Исправлено некорректное генерирование @file{.hdr} при использовании транзитных пакетов. diff --git a/doc/news.texi b/doc/news.texi index cfa36c4..160fd39 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -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. diff --git a/src/tx.go b/src/tx.go index a90a49e..681f978 100644 --- 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 } -- 2.44.0