mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-23 00:56:20 +00:00
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:
@@ -40,3 +40,15 @@ var HookProxySetSelfProxy Hook[func(...string)]
|
||||
// HookProxySetTransportGetProxyConnectHeader is a hook for feature/useproxy to register
|
||||
// [tshttpproxy.SetTransportGetProxyConnectHeader].
|
||||
var HookProxySetTransportGetProxyConnectHeader Hook[func(*http.Transport)]
|
||||
|
||||
// HookTPMAvailable is a hook that reports whether a TPM device is supported
|
||||
// and available.
|
||||
var HookTPMAvailable Hook[func() bool]
|
||||
|
||||
// TPMAvailable reports whether a TPM device is supported and available.
|
||||
func TPMAvailable() bool {
|
||||
if f, ok := HookTPMAvailable.GetOk(); ok {
|
||||
return f()
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user