From 4b23559937ccefd2df7d020219c7962568355a12 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Tue, 11 Mar 2014 09:17:08 +0100 Subject: [PATCH] Fix HMAC-MD5 in DHCPv6-reconfigure (thx rsmarples) --- src/dhcpv6-ia.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c index b1931ef..0d132af 100644 --- a/src/dhcpv6-ia.c +++ b/src/dhcpv6-ia.c @@ -162,8 +162,9 @@ static int send_reconf(struct interface *iface, struct dhcpv6_assignment *assign struct iovec iov = {&reconf_msg, sizeof(reconf_msg) - 128 + assign->clid_len}; md5_ctx_t md5; - uint8_t secretbytes[16]; - memcpy(secretbytes, assign->key, sizeof(secretbytes)); + uint8_t secretbytes[64]; + memset(secretbytes, 0, sizeof(secretbytes)); + memcpy(secretbytes, assign->key, sizeof(assign->key)); for (size_t i = 0; i < sizeof(secretbytes); ++i) secretbytes[i] ^= 0x36; -- 2.25.1