Development discussion of WireGuard
 help / color / mirror / Atom feed
From: "Vojtěch Káně" <>
Subject: Strange behavior when a peer has the same key as the interface
Date: Fri, 3 Sep 2021 09:24:38 +0200	[thread overview]
Message-ID: <> (raw)


I would like to report a strange behavior of the Wireguard Linux kernel 
implementation — when you try to create a peer whose public key matches 
the public key of the interface, the call returns success, but nothing 
is done.

I don't have an opinion (and relevant deep understanding of the crypto 
involved) whether such a call should succeed or not. Especially since 
it's 99% not what you want. I came across this issue by mistake anyway. 
However I think an error should be returned when such a peer is rejected.

Steps to reproduce:

`wg genkey > priv`

`wg pubkey > pub < priv`

`ip link add wg type wireguard`

`wg set wg private-key priv`

`wg set wg peer $(cat pub) allowed-ips`


The return code is 0.

`wg show wg` does not print any peer.

The same happens when using the wgctrl golang library.


Vojtěch Káně

             reply	other threads:[~2021-09-05 11:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-03  7:24 Vojtěch Káně [this message]
2021-09-05 13:24 ` Jason A. Donenfeld
2021-09-05 20:27   ` Vojtěch Káně
2021-09-05 20:54     ` Jason A. Donenfeld

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:

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

  git send-email \ \ \ \

* 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).