* Using OneRNG hardware RNG can I get wireguard to use /dev/random
@ 2020-07-21 14:58 peter garner
2020-07-24 8:32 ` Jeffrey Walton
2020-07-24 8:55 ` Jason A. Donenfeld
0 siblings, 2 replies; 4+ messages in thread
From: peter garner @ 2020-07-21 14:58 UTC (permalink / raw)
To: wireguard
Hi List,
Platform: Raspberry Pi4B, Raspbian Buster 10. This device dedicated to
wireguard. uname -a: Linux wireguard 4.19.118-v7l+ #1311 SMP Mon Apr 27
14:26:42 BST 2020 armv7l GNU/Linux. wg-quick is dated May 22 08:11
I've used my OneRNG v3.0 external device to recreate my SSH moduli and
am now looking to recreate my wireguard keys.
According to the Wireguard docs it uses /dev/urandom:
https://gist.github.com/rmoriz/58f1768218a4fbc4b318615bfb85111d
fd = open("/dev/urandom", O_RDONLY);
if (fd < 0)
return fd;
ret = read(fd, out, len);
close(fd);
The OneRNG utilises /dev/random though - is there any way I can get
wireguard to use /dev/random instead (without recompiling) ?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Using OneRNG hardware RNG can I get wireguard to use /dev/random
2020-07-21 14:58 Using OneRNG hardware RNG can I get wireguard to use /dev/random peter garner
@ 2020-07-24 8:32 ` Jeffrey Walton
2020-07-24 8:58 ` Ipad@petergarner.net
2020-07-24 8:55 ` Jason A. Donenfeld
1 sibling, 1 reply; 4+ messages in thread
From: Jeffrey Walton @ 2020-07-24 8:32 UTC (permalink / raw)
To: peter garner; +Cc: wireguard
On Fri, Jul 24, 2020 at 4:28 AM peter garner <peter@petergarner.net> wrote:
>
> I've used my OneRNG v3.0 external device to recreate my SSH moduli and
> am now looking to recreate my wireguard keys.
>
> According to the Wireguard docs it uses /dev/urandom:
> https://gist.github.com/rmoriz/58f1768218a4fbc4b318615bfb85111d
>
> fd = open("/dev/urandom", O_RDONLY);
> if (fd < 0)
> return fd;
> ret = read(fd, out, len);
> close(fd);
Unrelated, the kernel-crypto folks recommend using /dev/urandom.
Wiregaurd is following best practices. Also see
https://lkml.org/lkml/2017/7/20/993.
Jeff
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Using OneRNG hardware RNG can I get wireguard to use /dev/random
2020-07-24 8:32 ` Jeffrey Walton
@ 2020-07-24 8:58 ` Ipad@petergarner.net
0 siblings, 0 replies; 4+ messages in thread
From: Ipad@petergarner.net @ 2020-07-24 8:58 UTC (permalink / raw)
To: noloader; +Cc: peter garner, wireguard
>> On 24 Jul 2020, at 09:33, Jeffrey Walton <noloader@gmail.com> wrote:
>>
>> On Fri, Jul 24, 2020 at 4:28 AM peter garner <peter@petergarner.net> wrote:
>> I've used my OneRNG v3.0 external device to recreate my SSH moduli and
>> am now looking to recreate my wireguard keys.
>> According to the Wireguard docs it uses /dev/urandom:
>> https://gist.github.com/rmoriz/58f1768218a4fbc4b318615bfb85111d
>> fd = open("/dev/urandom", O_RDONLY);
>> if (fd < 0)
>> return fd;
>> ret = read(fd, out, len);
>> close(fd);
>
> Unrelated, the kernel-crypto folks recommend using /dev/urandom.
> Wiregaurd is following best practices. Also see
> https://lkml.org/lkml/2017/7/20/993.
>
> Jeff
Thanks Jeff - all is now clear (that link helped as well). I've been doing some additional research and everything makes sense.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Using OneRNG hardware RNG can I get wireguard to use /dev/random
2020-07-21 14:58 Using OneRNG hardware RNG can I get wireguard to use /dev/random peter garner
2020-07-24 8:32 ` Jeffrey Walton
@ 2020-07-24 8:55 ` Jason A. Donenfeld
1 sibling, 0 replies; 4+ messages in thread
From: Jason A. Donenfeld @ 2020-07-24 8:55 UTC (permalink / raw)
To: peter garner; +Cc: WireGuard mailing list
On Fri, Jul 24, 2020 at 10:27 AM peter garner <peter@petergarner.net> wrote:
>
> Hi List,
>
> Platform: Raspberry Pi4B, Raspbian Buster 10. This device dedicated to
> wireguard. uname -a: Linux wireguard 4.19.118-v7l+ #1311 SMP Mon Apr 27
> 14:26:42 BST 2020 armv7l GNU/Linux. wg-quick is dated May 22 08:11
>
> I've used my OneRNG v3.0 external device to recreate my SSH moduli and
> am now looking to recreate my wireguard keys.
>
> According to the Wireguard docs it uses /dev/urandom:
> https://gist.github.com/rmoriz/58f1768218a4fbc4b318615bfb85111d
>
> fd = open("/dev/urandom", O_RDONLY);
> if (fd < 0)
> return fd;
> ret = read(fd, out, len);
> close(fd);
>
> The OneRNG utilises /dev/random though - is there any way I can get
> wireguard to use /dev/random instead (without recompiling) ?
We're not going to change the wireguard-tools source for this.
But if you need to hijynx it, just use mknod to make /dev/urandom
point to the same device node as /dev/random. I'd recommend finding a
better solution, however, to whatever randomness situation you have
going on.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-07-24 21:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21 14:58 Using OneRNG hardware RNG can I get wireguard to use /dev/random peter garner
2020-07-24 8:32 ` Jeffrey Walton
2020-07-24 8:58 ` Ipad@petergarner.net
2020-07-24 8:55 ` Jason A. Donenfeld
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).