From 25db1317e824aec01fca4bce29c0a090b099aab0 Mon Sep 17 00:00:00 2001 From: "G. Paul Ziemba" Date: Tue, 14 Apr 2020 19:08:57 -0700 Subject: [PATCH] ldpd: ldp_vty_neighbor_password(): fix auth.md5key_len calculation Per issue #6202 Very long passwords (>79 chars) get truncated: save truncated length in nbrp->auth.md5key_len instead of original length. Signed-off-by: G. Paul Ziemba --- ldpd/ldp_vty_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldpd/ldp_vty_conf.c b/ldpd/ldp_vty_conf.c index 05b8962563..84a5c0b1b2 100644 --- a/ldpd/ldp_vty_conf.c +++ b/ldpd/ldp_vty_conf.c @@ -1077,7 +1077,7 @@ ldp_vty_neighbor_password(struct vty *vty, const char *negate, struct in_addr ls if (password_len >= sizeof(nbrp->auth.md5key)) vty_out(vty, "%% password has been truncated to %zu " "characters.", sizeof(nbrp->auth.md5key) - 1); - nbrp->auth.md5key_len = password_len; + nbrp->auth.md5key_len = strlen(nbrp->auth.md5key); nbrp->auth.method = AUTH_MD5SIG; } -- 2.39.5