From: Sergey Matveev Date: Sat, 3 Jul 2021 15:53:34 +0000 (+0300) Subject: Restore nonce state before temporary file decryption X-Git-Tag: v7.1.0^2~5 X-Git-Url: http://www.git.cypherpunks.ru/?a=commitdiff_plain;h=ed0388f62f72adf8665ee1a5813541c4ce87fd55;hp=ab7c7eca0e53661f0ba904c2a6ba752990bea367;p=nncp.git Restore nonce state before temporary file decryption --- 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 }