All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: peter garner <peter@petergarner.net>
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: Using OneRNG hardware RNG can I get wireguard to use /dev/random
Date: Fri, 24 Jul 2020 10:55:35 +0200	[thread overview]
Message-ID: <CAHmME9o+CZRBjNoGdBguNqap5nJP75YqdmO5Mbd=w636w+GZFg@mail.gmail.com> (raw)
In-Reply-To: <20200721155826.29f29036.peter@petergarner.net>

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.

      parent reply	other threads:[~2020-07-24  8:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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='CAHmME9o+CZRBjNoGdBguNqap5nJP75YqdmO5Mbd=w636w+GZFg@mail.gmail.com' \
    --to=jason@zx2c4.com \
    --cc=peter@petergarner.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.