summaryrefslogtreecommitdiff
path: root/proto/ospf/config.Y
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2016-11-08 19:27:58 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2016-11-08 19:27:58 +0100
commit8860e991f6650e47cfe6c1af595fe4fe92a4edfd (patch)
tree18f49bb3a21739a1a596b54d9f65e82cff4fc09f /proto/ospf/config.Y
parentcc5b93f72db80abd1262a0a5e1d8400ceef54385 (diff)
parentc8cafc8ebb5320ac7c6117c17e6460036f0fdf62 (diff)
Merge branch 'master' into int-new
Diffstat (limited to 'proto/ospf/config.Y')
-rw-r--r--proto/ospf/config.Y14
1 files changed, 14 insertions, 0 deletions
diff --git a/proto/ospf/config.Y b/proto/ospf/config.Y
index 297774b5..72928875 100644
--- a/proto/ospf/config.Y
+++ b/proto/ospf/config.Y
@@ -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