Commit Graph
4 Commits
Author SHA1 Message Date
James Tucker ec75c026e4 ssh/tailssh: add pure ML-DSA-44 host key support
Go 1.27 (crypto/mldsa, crypto/x509) and golang.org/x/crypto v0.59.0
already implement pure ML-DSA SSH host keys (ssh-mldsa-44, per
draft-sfluhrer-ssh-mldsa-08) and PKCS#8 private key serialization.

Filter host key specs against ssh.SupportedAlgorithms().HostKeys so
builds without ML-DSA support (such as GOFIPS140=v1.0.0) continue to
skip unsupported key types cleanly, and add mldsa44 host key
generation, system key lookup, and handshake/integration test coverage.

Updates #22864
Updates #22807

Change-Id: I191e62a9a3d439db0c999172b283d00d501e1bcc
Signed-off-by: James Tucker <[email protected]>
2026-12-03 14:01:37 -08:00
Brad Fitzpatrick bf353f9754 ssh/tailssh: don't switch host keys when OpenSSH creates new ones
On macOS, launchd's sshd-keygen-wrapper recreates missing system host
keys on any TCP connection to port 22. tailssh preferred system keys
and re-read them on every connection, but only advertised its keys in
Hostinfo at startup or on prefs changes, so peers then failed host key
verification. Keep using host keys tailssh previously generated even
if system keys appear later, and load the keys once per process.

Fixes tailscale/corp#52474

Change-Id: I3ab9d27ecb246b91d184700ca6aabbb366f11023
Signed-off-by: Brad Fitzpatrick <[email protected]>
2026-12-03 11:54:26 -08:00
James Tucker 3c13466645 ssh/tailssh: write private host keys with 0600 permissions
Private host keys are only ever read by tailscaled itself; writing them
0700 needlessly allows group/other to walk into the key directory.
Use 0600, and pin it in TestSSHKeyGen.

Updates tailscale/corp#50380

Signed-off-by: James Tucker <[email protected]>
2026-10-24 13:30:41 -07:00
Brad Fitzpatrick f905871fb1 ipn/ipnlocal, feature/ssh: move SSH code out of LocalBackend to feature
This makes tsnet apps not depend on x/crypto/ssh and locks that in with a test.

It also paves the wave for tsnet apps to opt-in to SSH support via a
blank feature import in the future.

Updates #12614

Change-Id: Ica85628f89c8f015413b074f5001b82b27c953a9
Signed-off-by: Brad Fitzpatrick <[email protected]>
2026-03-10 17:27:17 -07:00