MFC: r203486: Shortening a passphrase caused wrong authentication key

to be used.
This commit is contained in:
Ruslan Ermilov 2010-02-07 06:22:28 +00:00
parent 9ed7f3a23a
commit 2227955399
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/stable/8/; revision=203603

View File

@ -96,6 +96,7 @@ setcarp_passwd(const char *val, int d, int s, const struct afswtch *afp)
if (ioctl(s, SIOCGVH, (caddr_t)&ifr) == -1)
err(1, "SIOCGVH");
memset(carpr.carpr_key, 0, sizeof(carpr.carpr_key));
/* XXX Should hash the password into the key here, perhaps? */
strlcpy(carpr.carpr_key, val, CARP_KEY_LEN);