Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Laura Zelenku <laura.zelenku@wandera.com>
To: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: [PATCH] Lower log level of 'invalid state for keypair derivation'
Date: Wed, 16 Feb 2022 16:30:08 +0100	[thread overview]
Message-ID: <CAA-4Yo1nM98swVeFoJKZYAymq2B7qnvTLrEAqjOqQ=iHvyDgww@mail.gmail.com> (raw)

Error is caused by multiple handshakes processing in the same time for
the same peer.
Invalid state is not harmful for a peer and the other/faster handshake wins.

Signed-off-by: Laura Zelenku <laura.zelenku@wandera.com>
---
 device/receive.go | 3 +--
 device/send.go    | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/device/receive.go b/device/receive.go
index cc34498..25fb7d9 100644
--- a/device/receive.go
+++ b/device/receive.go
@@ -379,9 +379,8 @@ func (device *Device) RoutineHandshake(id int) {
                        // derive keypair

                        err = peer.BeginSymmetricSession()
-
                        if err != nil {
-                               device.log.Errorf("%v - Failed to
derive keypair: %v", peer, err)
+                               device.log.Verbosef("%v - Failed to
derive keypair: %v", peer, err)
                                goto skip
                        }

diff --git a/device/send.go b/device/send.go
index 0a7135f..9598bee 100644
--- a/device/send.go
+++ b/device/send.go
@@ -156,7 +156,7 @@ func (peer *Peer) SendHandshakeResponse() error {

        err = peer.BeginSymmetricSession()
        if err != nil {
-               peer.device.log.Errorf("%v - Failed to derive keypair:
%v", peer, err)
+               peer.device.log.Verbosef("%v - Failed to derive
keypair: %v", peer, err)
                return err
        }

-- 
2.30.1 (Apple Git-130)

-- 
*IMPORTANT NOTICE*: This email, its attachments and any rights attaching 
hereto are confidential and intended exclusively for the person to whom the 
email is addressed. If you are not the intended recipient, do not read, 
copy, disclose or use the contents in any way. Wandera accepts no liability 
for any loss, damage or consequence resulting directly or indirectly from 
the use of this email and attachments.

                 reply	other threads:[~2022-02-16 15:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAA-4Yo1nM98swVeFoJKZYAymq2B7qnvTLrEAqjOqQ=iHvyDgww@mail.gmail.com' \
    --to=laura.zelenku@wandera.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).