disable tpm simulator in coordinator release binary

Signed-off-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
Malte Poll 2022-04-29 13:21:29 +02:00 committed by Malte Poll
parent 673fec407f
commit 3817a57a83
3 changed files with 22 additions and 1 deletions

View File

@ -16,7 +16,7 @@ add_custom_target(disk-mapper ALL
# #
add_custom_target(coordinator ALL add_custom_target(coordinator ALL
go build -o ${CMAKE_BINARY_DIR} -tags=gcp -buildvcs=false -ldflags "-s -w -buildid='' -X main.version=${PROJECT_VERSION}" go build -o ${CMAKE_BINARY_DIR} -tags=gcp,disable_tpm_simulator -buildvcs=false -ldflags "-s -w -buildid='' -X main.version=${PROJECT_VERSION}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/coordinator/cmd/coordinator) WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/coordinator/cmd/coordinator)

View File

@ -1,3 +1,6 @@
//go:build !disable_tpm_simulator
// +build !disable_tpm_simulator
package simulator package simulator
import ( import (

View File

@ -0,0 +1,18 @@
//go:build disable_tpm_simulator
// +build disable_tpm_simulator
package simulator
import (
"io"
)
// OpenSimulatedTPM returns a simulated TPM device.
func OpenSimulatedTPM() (io.ReadWriteCloser, error) {
panic("simulator not enabled")
}
// NewSimulatedTPMOpenFunc returns a TPMOpenFunc that opens a simulated TPM.
func NewSimulatedTPMOpenFunc() (func() (io.ReadWriteCloser, error), io.Closer) {
panic("simulator not enabled")
}