Add TDX bazel files

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2023-03-20 11:15:57 +01:00 committed by Malte Poll
parent bda999d54e
commit c478df36fa
10 changed files with 30 additions and 23 deletions

View file

@ -1,8 +1,20 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("//bazel/go:go_test.bzl", "go_test")
go_library(
name = "sorted",
srcs = ["sorted.go"],
importpath = "github.com/edgelesssys/constellation/v2/measurement-reader/internal/sorted",
visibility = ["//measurement-reader:__subpackages__"],
deps = ["//internal/attestation/measurements"],
)
go_test(
name = "sorted_test",
srcs = ["sorted_test.go"],
embed = [":sorted"],
deps = [
"//internal/attestation/measurements",
"@com_github_stretchr_testify//assert",
],
)

View file

@ -23,6 +23,7 @@ type Measurement struct {
// MeasurementType are the supported attestation types we can sort.
type MeasurementType uint32
// Available measurement types.
const (
TPM MeasurementType = iota
TDX

View file

@ -0,0 +1,12 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "tdx",
srcs = ["tdx.go"],
importpath = "github.com/edgelesssys/constellation/v2/measurement-reader/internal/tdx",
visibility = ["//measurement-reader:__subpackages__"],
deps = [
"//internal/attestation/tdx",
"//measurement-reader/internal/sorted",
],
)

View file

@ -1,5 +1,4 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("//bazel/go:go_test.bzl", "go_test")
go_library(
name = "tpm",
@ -7,21 +6,9 @@ go_library(
importpath = "github.com/edgelesssys/constellation/v2/measurement-reader/internal/tpm",
visibility = ["//measurement-reader:__subpackages__"],
deps = [
"//internal/attestation/measurements",
"//internal/attestation/vtpm",
"//measurement-reader/internal/sorted",
"@com_github_google_go_tpm//tpm2",
"@com_github_google_go_tpm_tools//client",
],
)
go_test(
name = "tpm_test",
srcs = ["tpm_test.go"],
embed = [":tpm"],
deps = [
"//internal/attestation/measurements",
"//measurement-reader/internal/sorted",
"@com_github_stretchr_testify//assert",
],
)