From 440ff1b90d73aac1528d216c7be23119e1d089de Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Thu, 4 Feb 2010 11:43:22 +0000 Subject: [PATCH] Shortening a passphrase caused wrong authentication key to be used. Fix this in a FreeBSD and OpenBSD compatible way. MFC after: 3 days --- sbin/ifconfig/ifcarp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/ifconfig/ifcarp.c b/sbin/ifconfig/ifcarp.c index 36f1bb6a47b7..2306717e63b8 100644 --- a/sbin/ifconfig/ifcarp.c +++ b/sbin/ifconfig/ifcarp.c @@ -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);