]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ldpd: ldp_vty_neighbor_password(): fix auth.md5key_len calculation
authorG. Paul Ziemba <paulz@labn.net>
Wed, 15 Apr 2020 02:08:57 +0000 (19:08 -0700)
committerG. Paul Ziemba <paulz@labn.net>
Wed, 15 Apr 2020 02:08:57 +0000 (19:08 -0700)
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 <paulz@labn.net>
ldpd/ldp_vty_conf.c

index 05b896256320a5805356e1316a4397eeb839781b..84a5c0b1b26ce6c0b7dd7ebfca634d3ea3aa5036 100644 (file)
@@ -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;
        }