Fix HMAC-MD5 in DHCPv6-reconfigure (thx rsmarples)
authorSteven Barth <steven@midlink.org>
Tue, 11 Mar 2014 08:17:08 +0000 (09:17 +0100)
committerSteven Barth <steven@midlink.org>
Tue, 11 Mar 2014 08:17:08 +0000 (09:17 +0100)
src/dhcpv6-ia.c

index b1931ef5f55ba225fe344826f08edc55defa6b55..0d132afeccba779e474e79d90a0486a10cfeaa82 100644 (file)
@@ -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;