Development discussion of WireGuard
 help / color / mirror / Atom feed
* How to verify a wireguard public key?
@ 2020-12-24 16:00 Nico Schottelius
  2020-12-24 23:30 ` Jason A. Donenfeld
  2020-12-24 23:42 ` Adam Stiles
  0 siblings, 2 replies; 9+ messages in thread
From: Nico Schottelius @ 2020-12-24 16:00 UTC (permalink / raw)
  To: wireguard


Good morning,

I am currently extending uncloud [0] to support wireguard tunnels and
keys. At the moment it is not entirely clear how to verify that a
certain string is a valid wireguard key.

I first tried checking that it is valid base64, but not all base64
strings are valid wireguard keys.

Then I tried using `echo $key | wg pubkey && echo ok` - which seems to
check the key format, however the intended behaviour here is misused.

Does anyone have a pointer on how to reliably identify wireguard public
keys?

Is the wireguard key always 32 bytes when decoded from base64? Tests
with a number of public keys seems to indicate that.

Best regards,

Nico


[0] https://code.ungleich.ch/uncloud/uncloud

--
Modern, affordable, Swiss Virtual Machines. Visit www.datacenterlight.ch

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-12-26  9:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-24 16:00 How to verify a wireguard public key? Nico Schottelius
2020-12-24 23:30 ` Jason A. Donenfeld
2020-12-24 23:42 ` Adam Stiles
2020-12-25  9:10   ` Nico Schottelius
2020-12-25 23:37     ` Matthias May
2020-12-25 23:47       ` Jason A. Donenfeld
2020-12-25 22:16   ` Matthias Urlichs
2020-12-26  8:09     ` Nico Schottelius
2020-12-26  9:03       ` Matthias Urlichs

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