mirror of
https://github.com/tailscale/tailscale.git
synced 2025-07-30 07:43:42 +00:00

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>
18 lines
363 B
Go
18 lines
363 B
Go
// Copyright (c) Tailscale Inc & AUTHORS
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
package tpm
|
|
|
|
import (
|
|
"github.com/google/go-tpm/tpm2/transport"
|
|
"github.com/google/go-tpm/tpm2/transport/linuxtpm"
|
|
)
|
|
|
|
func open() (transport.TPMCloser, error) {
|
|
tpm, err := linuxtpm.Open("/dev/tpmrm0")
|
|
if err == nil {
|
|
return tpm, nil
|
|
}
|
|
return linuxtpm.Open("/dev/tpm0")
|
|
}
|