cmd/tailscaled: default --encrypt-state to true if TPM is available (#17376)

Whenever running on a platform that has a TPM (and tailscaled can access
it), default to encrypting the state. The user can still explicitly set
this flag to disable encryption.

Updates https://github.com/tailscale/corp/issues/32909

Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
This commit is contained in:
Andrew Lytvynov
2025-10-01 20:18:58 -07:00
committed by GitHub
parent 78af49dd1a
commit cca70ddbfc
7 changed files with 65 additions and 20 deletions
-9
View File
@@ -277,15 +277,6 @@ func TestMigrateStateToTPM(t *testing.T) {
}
}
func tpmSupported() bool {
tpm, err := open()
if err != nil {
return false
}
tpm.Close()
return true
}
type mockTPMSealProvider struct {
path string
data map[ipn.StateKey][]byte