From: Sergey Matveev Date: Fri, 13 Dec 2019 15:11:49 +0000 (+0300) Subject: Correct identification during authentication procedure X-Git-Tag: v5.1.2^2~3 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8bb2e96513381ab5abe78d9eafcd494a7f123a00;p=nncp.git Correct identification during authentication procedure --- diff --git a/doc/news.ru.texi b/doc/news.ru.texi index 54dbe00..237af0f 100644 --- a/doc/news.ru.texi +++ b/doc/news.ru.texi @@ -5,6 +5,11 @@ @subsection Релиз 5.1.2 @itemize +@item +Исправлена @strong{критичная} уязвимость: аутентификация online нод +могла приводить к некорректной идентификации удалённой стороны, позволяя +скачивать чужие зашифрованные пакеты. + @item Исправлена ошибка: в новосозданных конфигурационных файлах, приватный публичный ключ Noise были поменяны местами, что приводило к diff --git a/doc/news.texi b/doc/news.texi index 85095ba..6275980 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -7,6 +7,11 @@ See also this page @ref{Новости, on russian}. @section Release 5.1.2 @itemize +@item +@strong{Critical} vulnerability: remote peers authentication could lead +to incorrect identification of remote side, allowing foreign encrypted +packets downloading. + @item Bugfix: private and public Noise keys were swapped in newly created configuration files, that lead to inability to authenticate online peers. diff --git a/src/sp.go b/src/sp.go index b6e49b4..c5cfb07 100644 --- a/src/sp.go +++ b/src/sp.go @@ -415,8 +415,9 @@ func (state *SPState) StartR(conn ConnDeadlined) error { } var node *Node - for _, node = range state.Ctx.Neigh { - if subtle.ConstantTimeCompare(state.hs.PeerStatic(), node.NoisePub[:]) == 1 { + for _, n := range state.Ctx.Neigh { + if subtle.ConstantTimeCompare(state.hs.PeerStatic(), n.NoisePub[:]) == 1 { + node = n break } }