feature/tpm: try opening /dev/tpmrm0 before /tmp/tpm0 on Linux (#16600)

The tpmrm0 is a kernel-managed version of tpm0 that multiplexes multiple
concurrent connections. The basic tpm0 can only be accessed by one
application at a time, which can be pretty unreliable.

Updates #15830

Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
pull/16316/head
Andrew Lytvynov 5 months ago committed by GitHub
parent d1ceb62e27
commit 6c206fab58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -9,5 +9,9 @@ import (
) )
func open() (transport.TPMCloser, error) { func open() (transport.TPMCloser, error) {
tpm, err := linuxtpm.Open("/dev/tpmrm0")
if err == nil {
return tpm, nil
}
return linuxtpm.Open("/dev/tpm0") return linuxtpm.Open("/dev/tpm0")
} }

Loading…
Cancel
Save