]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commit
wg: genkey: account for short reads of /dev/urandom
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 28 Feb 2019 22:37:24 +0000 (23:37 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Thu, 28 Feb 2019 22:53:00 +0000 (23:53 +0100)
commit74a6f97b7ae3efec010148ed990880400c27c722
tree53d5c1cf337aca4830942637890c7c361e5aa4bf
parent2c6cabd73dfb23990c245250ef2e502bdb33d189
wg: genkey: account for short reads of /dev/urandom

Apparently Haiku has a misbehaving /dev/urandom.

While we're at it, simplify the function signature to completely succeed
or completely fail and make sure the caller checks the result.

Reported-by: Alexander von Gluck IV <kallisti5@unixzen.com>
Nitpicked-by: Aaron Jones <aaronmdjones@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
contrib/embeddable-wg-library/wireguard.c
src/genkey.c