All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] [PATCH net] mptcp: use rightmost 64 bits in ADD_ADDR HMAC
@ 2020-05-19 16:45 ` Todd Malsbary
  0 siblings, 0 replies; 4+ messages in thread
From: Todd Malsbary @ 2020-05-19 16:45 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 1290 bytes --]

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: 3df523ab582c ("mptcp: Add ADD_ADDR handling")
Signed-off-by: Todd Malsbary <todd.malsbary(a)linux.intel.com>
Acked-by: Christoph Paasch <cpaasch(a)apple.com>
Reviewed-by: Matthieu Baerts <matthieu.baerts(a)tessares.net>
---
 net/mptcp/options.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index ece6f92cf7d1..0e11fb3d908f 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -550,7 +550,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)
@@ -567,7 +567,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
 
-- 
2.25.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net] mptcp: use rightmost 64 bits in ADD_ADDR HMAC
@ 2020-05-19 16:45 ` Todd Malsbary
  0 siblings, 0 replies; 4+ messages in thread
From: Todd Malsbary @ 2020-05-19 16:45 UTC (permalink / raw)
  To: netdev; +Cc: mptcp, Christoph Paasch, Matthieu Baerts

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: 3df523ab582c ("mptcp: Add ADD_ADDR handling")
Signed-off-by: Todd Malsbary <todd.malsbary@linux.intel.com>
Acked-by: Christoph Paasch <cpaasch@apple.com>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---
 net/mptcp/options.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index ece6f92cf7d1..0e11fb3d908f 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -550,7 +550,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)
@@ -567,7 +567,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
 
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [MPTCP] Re: [PATCH net] mptcp: use rightmost 64 bits in ADD_ADDR HMAC
  2020-05-19 16:45 ` Todd Malsbary
@ 2020-05-19 19:39 ` David Miller
  -1 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-05-19 19:39 UTC (permalink / raw)
  To: mptcp

[-- Attachment #1: Type: text/plain, Size: 605 bytes --]

From: Todd Malsbary <todd.malsbary(a)linux.intel.com>
Date: Tue, 19 May 2020 09:45:34 -0700

> 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: 3df523ab582c ("mptcp: Add ADD_ADDR handling")
> Signed-off-by: Todd Malsbary <todd.malsbary(a)linux.intel.com>
> Acked-by: Christoph Paasch <cpaasch(a)apple.com>
> Reviewed-by: Matthieu Baerts <matthieu.baerts(a)tessares.net>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] mptcp: use rightmost 64 bits in ADD_ADDR HMAC
@ 2020-05-19 19:39 ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-05-19 19:39 UTC (permalink / raw)
  To: todd.malsbary; +Cc: netdev, mptcp, cpaasch, matthieu.baerts

From: Todd Malsbary <todd.malsbary@linux.intel.com>
Date: Tue, 19 May 2020 09:45:34 -0700

> 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: 3df523ab582c ("mptcp: Add ADD_ADDR handling")
> Signed-off-by: Todd Malsbary <todd.malsbary@linux.intel.com>
> Acked-by: Christoph Paasch <cpaasch@apple.com>
> Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-19 19:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-19 19:39 [MPTCP] Re: [PATCH net] mptcp: use rightmost 64 bits in ADD_ADDR HMAC David Miller
2020-05-19 19:39 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2020-05-19 16:45 [MPTCP] " Todd Malsbary
2020-05-19 16:45 ` Todd Malsbary

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.