mirror of
https://passt.top/passt
synced 2025-05-24 18:15:36 +02:00
tcp: "TCP" hash secret doesn't need to be TCP specific
The TCP state structure includes a 128-bit hash_secret which we use for SipHash calculations to mitigate attacks on the TCP hash table and initial sequence number. We have plans to use SipHash in places that aren't TCP related, and there's no particular reason they'd need their own secret. So move the hash_secret to the general context structure. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
cf83988e96
commit
e21b6d69b1
4 changed files with 44 additions and 35 deletions
2
passt.h
2
passt.h
|
@ -211,6 +211,7 @@ struct ip6_ctx {
|
|||
* @fd_tap: AF_UNIX socket, tuntap device, or pre-opened socket
|
||||
* @mac: Host MAC address
|
||||
* @mac_guest: MAC address of guest or namespace, seen or configured
|
||||
* @hash_secret: 128-bit secret for siphash functions
|
||||
* @ifi4: Index of template interface for IPv4, 0 if IPv4 disabled
|
||||
* @ip: IPv4 configuration
|
||||
* @dns_search: DNS search list
|
||||
|
@ -265,6 +266,7 @@ struct ctx {
|
|||
int fd_tap;
|
||||
unsigned char mac[ETH_ALEN];
|
||||
unsigned char mac_guest[ETH_ALEN];
|
||||
uint64_t hash_secret[2];
|
||||
|
||||
unsigned int ifi4;
|
||||
struct ip4_ctx ip4;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue