Shortening a passphrase caused wrong authentication key to be used.

Fix this in a FreeBSD and OpenBSD compatible way.

MFC after:	3 days
This commit is contained in:
Ruslan Ermilov 2010-02-04 11:43:22 +00:00
parent 2eeaf93408
commit 440ff1b90d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=203486

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);