2023-03-09 12:11:47 -05:00
|
|
|
/*
|
|
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Package tdx reads measurements from an Intel TDX guest.
|
|
|
|
package tdx
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/edgelesssys/constellation/v2/internal/attestation/tdx"
|
|
|
|
"github.com/edgelesssys/constellation/v2/measurement-reader/internal/sorted"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Measurements returns a sorted list of TDX runtime measurements.
|
|
|
|
func Measurements() ([]sorted.Measurement, error) {
|
|
|
|
m, err := tdx.GetSelectedMeasurements(tdx.Open, []int{0, 1, 2, 3, 4})
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
2023-03-09 12:55:05 -05:00
|
|
|
return sorted.SortMeasurements(m, sorted.TDX), nil
|
2023-03-09 12:11:47 -05:00
|
|
|
}
|