[PATCH RFC 2/2] babel: Add HMAC support

Ondrej Zajicek santiago at crfreenet.org
Tue Jul 17 13:44:56 CEST 2018


On Sun, Jul 15, 2018 at 01:21:40AM +0200, Toke Høiland-Jørgensen wrote:
> Martin Mares <mj at 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 at 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."



More information about the Bird-users mailing list