On Sun, Jul 15, 2018 at 01:21:40AM +0200, Toke Høiland-Jørgensen wrote:
Martin Mares <mj@ucw.cz> writes:
Hi Toke,
just a random thought:
+ getrandom(n->hmac_nonce, BABEL_HMAC_NONCE_LEN, 0);
I think we cannot rely on getrandom() being available on all systems. It probably needs wrapping in sysdep code.
Yeah, figured I would probably have to look into something like that. Any idea if there is an interface that *is* available across systems?
Hi I would be surprised if there was portable syscall for that. There is getentropy() for OpenBSD and arc4rand() for FreeBSD. so all these could be wrapped in sysdep code to offer uniform interface for rest of BIRD. Also note that even getrandom() is relatively recent. We probably should handle somehow the case that none of these is available. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."