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

Toke Høiland-Jørgensen toke at toke.dk
Wed Jul 18 20:29:36 CEST 2018


Ondrej Zajicek <santiago at crfreenet.org> writes:

> 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.

Right, I'll look into a sysdep function + compatibility.

-Toke



More information about the Bird-users mailing list