提交 12555a2d 编写于 作者: T Todd Malsbary 提交者: David S. Miller

mptcp: use rightmost 64 bits in ADD_ADDR HMAC

This changes the HMAC used in the ADD_ADDR option from the leftmost 64
bits to the rightmost 64 bits as described in RFC 8684, section 3.4.1.

This issue was discovered while adding support to packetdrill for the
ADD_ADDR v1 option.

Fixes: 3df523ab ("mptcp: Add ADD_ADDR handling")
Signed-off-by: NTodd Malsbary <todd.malsbary@linux.intel.com>
Acked-by: NChristoph Paasch <cpaasch@apple.com>
Reviewed-by: NMatthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f25641c0
......@@ -545,7 +545,7 @@ static u64 add_addr_generate_hmac(u64 key1, u64 key2, u8 addr_id,
mptcp_crypto_hmac_sha(key1, key2, msg, 7, hmac);
return get_unaligned_be64(hmac);
return get_unaligned_be64(&hmac[MPTCP_ADDR_HMAC_LEN - sizeof(u64)]);
}
#if IS_ENABLED(CONFIG_MPTCP_IPV6)
......@@ -562,7 +562,7 @@ static u64 add_addr6_generate_hmac(u64 key1, u64 key2, u8 addr_id,
mptcp_crypto_hmac_sha(key1, key2, msg, 19, hmac);
return get_unaligned_be64(hmac);
return get_unaligned_be64(&hmac[MPTCP_ADDR_HMAC_LEN - sizeof(u64)]);
}
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册