[Babel-users] MAC auth. for Babel in babeld

Antonin Décimo antonin.decimo at gmail.com
Mon Sep 28 14:31:29 BST 2020


> Well, I did test an earlier version of your code against an earlier
> version of me, so not quite first try ;)

Second first try, then.

> >> - You don't enforce a minimum key length.
> >
> > This was on purpose, but maybe it was a bad idea.
> >
> >> For blake2s this means the key will effectively be zero-padded up to
> >> the block size of 32 bytes (not sure what hmac-sha256 does).
> >
> > hmac-sha256 is the same. Under the block size, the key is padded with
> > zeroes, above, the key is pre-hashed.
>
> Yeah, that's what the Bird implementation is doing too. I'm also
> limiting the *max* length of keys to avoid the pre-hashing as I figured
> that would be an interoperability issue. But if it's standard practice
> maybe that is not necessary?

It is standard. If the key length is smaller than the output (block)
size, then the key is padded with zeroes. If the key length is bigger,
then it is pre-hashed. See https://tools.ietf.org/html/rfc2104#section-2

Right know, babeld requires keys to be of the exact output size of the
hash.

> The obvious thing would be to assign keys to a "default" keyset if no
> explicit keyset is configured, and assign that default keyset to all
> interfaces that don't specify one?

I want to use the 'default' pseudo interface so that each keyset that
is added to the default interface is automatically added to each
interface.

> I think that would be safer anyway, as right now it's quite easy to
> think you've configured authentication, but it's not actually enabled
> because there was not key assigned. So I think the interface config
> should be bailing out if 'mac true' is set but no key is available...

It’s not clear when this check should be, because keys could be added
from another channel, for instance a local socket but not the
babeld.conf file.
I can add warnings when signing and verifying packets if there are no
key available.

-- Antonin



More information about the Babel-users mailing list