1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

OSPF: Use message authentication interface

Based on former commit from Pavel Tvrdik
This commit is contained in:
Ondrej Zajicek (work)
2016-10-27 20:58:21 +02:00
parent 390601f038
commit 29239ba2bb
4 changed files with 94 additions and 73 deletions

View File

@@ -42,6 +42,20 @@ ospf_iface_finish(void)
if ((ip->autype == OSPF_AUTH_NONE) && (ip->passwords != NULL))
log(L_WARN "Password option without authentication option does not make sense");
if (ip->passwords)
{
struct password_item *pass;
WALK_LIST(pass, *ip->passwords)
{
if (pass->alg && (ip->autype != OSPF_AUTH_CRYPT))
cf_error("Password algorithm option requires cryptographic authentication");
/* Set default OSPF crypto algorithms */
if (!pass->alg && (ip->autype == OSPF_AUTH_CRYPT))
pass->alg = ospf_cfg_is_v2() ? ALG_MD5 : ALG_HMAC_SHA256;
}
}
}
static void