types/persist: add AttestationKey (#17281)
Extend Persist with AttestationKey to record a hardware-backed attestation key for the node's identity. Add a flag to tailscaled to allow users to control the use of hardware-backed keys to bind node identity to individual machines. Updates tailscale/corp#31269 Change-Id: Idcf40d730a448d85f07f1bebf387f086d4c58be3 Signed-off-by: Patrick O'Doherty <patrick@tailscale.com>
This commit is contained in:
committed by
GitHub
parent
a2dc517d7d
commit
e45557afc0
@@ -7030,6 +7030,27 @@ func TestDisplayMessageIPNBus(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestHardwareAttested(t *testing.T) {
|
||||
b := new(LocalBackend)
|
||||
|
||||
// default false
|
||||
if got := b.HardwareAttested(); got != false {
|
||||
t.Errorf("HardwareAttested() = %v, want false", got)
|
||||
}
|
||||
|
||||
// set true
|
||||
b.SetHardwareAttested()
|
||||
if got := b.HardwareAttested(); got != true {
|
||||
t.Errorf("HardwareAttested() = %v, want true after SetHardwareAttested()", got)
|
||||
}
|
||||
|
||||
// repeat calls are safe; still true
|
||||
b.SetHardwareAttested()
|
||||
if got := b.HardwareAttested(); got != true {
|
||||
t.Errorf("HardwareAttested() = %v, want true after second SetHardwareAttested()", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDeps(t *testing.T) {
|
||||
deptest.DepChecker{
|
||||
OnImport: func(pkg string) {
|
||||
|
||||
Reference in New Issue
Block a user