The natlab tswg tests and the ML-KEM test built the kernel module (or
mlkem.c) everywhere, including on macOS and Windows, and on Linux
without the kernel build dependencies (gelf.h). Skip them unless
TSWG_TEST is set, as vmtest.sh now does. The lean tests were already
opt-in, with TSWG_LEAN.
Also rename the "l" variables that cmd/vet rejects, regenerate
tstest/integration's deps for the new packages, and bound or clean the
tswgbench agent's request parameters that CodeQL flagged.
Updates #426
Signed-off-by: Brad Fitzpatrick <[email protected]>
Change-Id: I7241799b24c97b63c30591a664dc1c30db48ccc4
Now that the tswg kernel module is under kernel/linux, the tests and
scripts that build it default to that tree rather than a separate
~/src/tslinux checkout, and the scripts find the tailscale.com
checkout they're in. TSWG_DIR and TAILSCALE_DIR still override them.
Also rename the module's COPYING to LICENSE, give the ML-KEM test the
repo's license header (and skip it without a C compiler, now that it
runs with the rest of the module's tests), and update DESIGN.md for
the new layout, which no longer has a pristine upstream/ copy.
Updates #426
Signed-off-by: Brad Fitzpatrick <[email protected]>
Change-Id: Ifcd99dd6d2197550d9c4abd13d4d4d80ed26dc60
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