mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-01-05 12:51:03 -05:00
70 lines
2.7 KiB
Go
70 lines
2.7 KiB
Go
//go:build !enterprise
|
|
|
|
/*
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
package measurements
|
|
|
|
import (
|
|
"github.com/edgelesssys/constellation/v2/internal/variant"
|
|
)
|
|
|
|
// DefaultsFor provides the default measurements for given cloud provider.
|
|
func DefaultsFor(attestationVariant variant.Variant) M {
|
|
switch attestationVariant {
|
|
case variant.AWSNitroTPM{}:
|
|
return M{
|
|
4: PlaceHolderMeasurement(),
|
|
8: WithAllBytes(0x00, Enforce, PCRMeasurementLength),
|
|
9: PlaceHolderMeasurement(),
|
|
11: WithAllBytes(0x00, Enforce, PCRMeasurementLength),
|
|
12: PlaceHolderMeasurement(),
|
|
13: WithAllBytes(0x00, Enforce, PCRMeasurementLength),
|
|
uint32(PCRIndexClusterID): WithAllBytes(0x00, Enforce, PCRMeasurementLength),
|
|
}
|
|
case variant.AzureSEVSNP{}:
|
|
return M{
|
|
4: PlaceHolderMeasurement(),
|
|
8: WithAllBytes(0x00, Enforce, PCRMeasurementLength),
|
|
9: PlaceHolderMeasurement(),
|
|
11: WithAllBytes(0x00, Enforce, PCRMeasurementLength),
|
|
12: PlaceHolderMeasurement(),
|
|
13: WithAllBytes(0x00, Enforce, PCRMeasurementLength),
|
|
uint32(PCRIndexClusterID): WithAllBytes(0x00, Enforce, PCRMeasurementLength),
|
|
}
|
|
case variant.GCPSEVES{}:
|
|
return M{
|
|
4: PlaceHolderMeasurement(),
|
|
8: WithAllBytes(0x00, Enforce, PCRMeasurementLength),
|
|
9: PlaceHolderMeasurement(),
|
|
11: WithAllBytes(0x00, Enforce, PCRMeasurementLength),
|
|
12: PlaceHolderMeasurement(),
|
|
13: WithAllBytes(0x00, Enforce, PCRMeasurementLength),
|
|
uint32(PCRIndexClusterID): WithAllBytes(0x00, Enforce, PCRMeasurementLength),
|
|
}
|
|
case variant.QEMUTDX{}:
|
|
return M{
|
|
0: PlaceHolderMeasurement(),
|
|
1: PlaceHolderMeasurement(),
|
|
2: PlaceHolderMeasurement(),
|
|
3: PlaceHolderMeasurement(),
|
|
4: PlaceHolderMeasurement(),
|
|
}
|
|
case variant.QEMUVTPM{}:
|
|
return M{
|
|
4: PlaceHolderMeasurement(),
|
|
8: WithAllBytes(0x00, Enforce, PCRMeasurementLength),
|
|
9: PlaceHolderMeasurement(),
|
|
11: WithAllBytes(0x00, Enforce, PCRMeasurementLength),
|
|
12: PlaceHolderMeasurement(),
|
|
13: WithAllBytes(0x00, Enforce, PCRMeasurementLength),
|
|
uint32(PCRIndexClusterID): WithAllBytes(0x00, Enforce, PCRMeasurementLength),
|
|
}
|
|
default:
|
|
return nil
|
|
}
|
|
}
|