Hello,

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 1.1.1.1/32`

Observe:

The return code is 0.

`wg show wg` does not print any peer.


The same happens when using the wgctrl golang library.


Regards,

Vojtěch Káně

Reply via email to