aboutgitcodebugslistschat
path: root/tcp_vu.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-11-14 14:33:08 +1100
committerStefano Brivio <sbrivio@redhat.com>2024-11-14 19:00:36 +0100
commit71d5deed5eed3949ee09c5f0a53b4de0b09b4afc (patch)
treee478a847033cabee0c8b378a42bc051d30bedbb3 /tcp_vu.c
parenta60703e89991d23345ed929328001e19f5bc47e0 (diff)
downloadpasst-71d5deed5eed3949ee09c5f0a53b4de0b09b4afc.tar
passt-71d5deed5eed3949ee09c5f0a53b4de0b09b4afc.tar.gz
passt-71d5deed5eed3949ee09c5f0a53b4de0b09b4afc.tar.bz2
passt-71d5deed5eed3949ee09c5f0a53b4de0b09b4afc.tar.lz
passt-71d5deed5eed3949ee09c5f0a53b4de0b09b4afc.tar.xz
passt-71d5deed5eed3949ee09c5f0a53b4de0b09b4afc.tar.zst
passt-71d5deed5eed3949ee09c5f0a53b4de0b09b4afc.zip
util: Add general low-level random bytes helper
Currently secret_init() open codes getting good quality random bytes from the OS, either via getrandom(2) or reading /dev/random. We're going to add at least one more place that needs random data in future, so make a general helper for getting random bytes. While we're there, fix a number of minor bugs: - getrandom() can theoretically return a "short read", so handle that case - getrandom() as well as read can return a transient EINTR - We would attempt to read data from /dev/random if we failed to open it (open() returns -1), but not if we opened it as fd 0 (unlikely, but ok) - More specific error reporting Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp_vu.c')
0 files changed, 0 insertions, 0 deletions