mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-26 11:36:26 -08:00
kernel/linux/src: implement wireguard-go's hybrid post-quantum handshake
Tailscale's wireguard-go has a hybrid handshake, Noise_IKhfs+psk2_25519+MLKEM768, which both peers must agree to use, with no fallback to the classic one. A kernel-mode node without it would be cut off from any peer that asked for it. The initiation now may carry an ephemeral ML-KEM-768 encapsulation key, sealed under the es key (with the static key then using nonce 1), and the response a ciphertext for it, sealed under the ee key, whose shared secret is mixed into the chaining key before se. That's per peer, with the new TSWGPEER_F_HYBRID flag. Hybrid retries carry wireguard-go's retry bit (bit 31 of the type), which we accept, set and echo, and which the socket's message classifier now allows. Linux has no ML-KEM, and its SHA-3 is too new for the kernels we build for, so src/mlkem.c is a FIPS 203 ML-KEM-768 with its own Keccak. tests/mlkem checks it against Go's crypto/mlkem: the same keys from the same seeds, each decapsulating the other's ciphertexts, and the same implicit rejection. The natlab tests in tailscale.com check the handshake against wireguard-go, in both roles. Updates #426 Signed-off-by: Brad Fitzpatrick <[email protected]> Change-Id: Ic524483d6cd27d36900a730553e1b21e4530c399
This commit is contained in:
1 parent
c306c02b44
commit
ee627ef16e
25 files changed
+1423
-72
No files matched your search
@@ -26,7 +26,7 @@ const struct nla_policy wireguard_wgallowedip_nl_policy[WGALLOWEDIP_A_FLAGS + 1]
|
||||
* attribute; see the TODO in DESIGN.md about forking the YNL spec.
|
||||
*/
|
||||
const struct nla_policy tswg_peer_nl_policy[TSWGPEER_A_MAX + 1] = {
|
||||
[TSWGPEER_A_FLAGS] = NLA_POLICY_MASK(NLA_U32, TSWGPEER_F_NO_ROAM),
|
||||
[TSWGPEER_A_FLAGS] = NLA_POLICY_MASK(NLA_U32, TSWGPEER_F_NO_ROAM | TSWGPEER_F_HYBRID),
|
||||
[TSWGPEER_A_CLEAR_SESSION] = { .type = NLA_FLAG, },
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user