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>
This commit is contained in:
Andrew Lytvynov 2025-07-18 10:17:40 -07:00 committed by GitHub
parent d1ceb62e27
commit 6c206fab58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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")
} }