summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2010-02-04 11:43:22 +0000
committerru <ru@FreeBSD.org>2010-02-04 11:43:22 +0000
commit08df417ac832a540851517c772784efefcfce418 (patch)
tree31ce790842d7bdfb2fe1d706c7c245d80a127cc9 /sbin
parent8923df5c26ddfa9cd69e14f78a412c20be8e053b (diff)
downloadFreeBSD-src-08df417ac832a540851517c772784efefcfce418.zip
FreeBSD-src-08df417ac832a540851517c772784efefcfce418.tar.gz
Shortening a passphrase caused wrong authentication key to be used.
Fix this in a FreeBSD and OpenBSD compatible way. MFC after: 3 days
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/ifcarp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sbin/ifconfig/ifcarp.c b/sbin/ifconfig/ifcarp.c
index 36f1bb6..2306717 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);
OpenPOWER on IntegriCloud