blob: 15c6ef47e16390f8afcf7b84066fc9c8eeca3597 [file] [log] [blame]
#pragma once
#include <cstdint>
#include <nlohmann/json.hpp>
namespace component_integrity
{
// clang-format off
enum class ComponentIntegrityType : std::uint8_t{
Invalid,
SPDM,
TPM,
OEM,
};
enum class MeasurementSpecification : std::uint8_t{
Invalid,
DMTF,
};
enum class SPDMmeasurementSummaryType : std::uint8_t{
Invalid,
TCB,
All,
};
enum class DMTFmeasurementTypes : std::uint8_t{
Invalid,
ImmutableROM,
MutableFirmware,
HardwareConfiguration,
FirmwareConfiguration,
MutableFirmwareVersion,
MutableFirmwareSecurityVersionNumber,
MeasurementManifest,
};
enum class VerificationStatus : std::uint8_t{
Invalid,
Success,
Failed,
};
enum class SecureSessionType : std::uint8_t{
Invalid,
Plain,
EncryptedAuthenticated,
AuthenticatedOnly,
};
NLOHMANN_JSON_SERIALIZE_ENUM(ComponentIntegrityType, {
{ComponentIntegrityType::Invalid, "Invalid"},
{ComponentIntegrityType::SPDM, "SPDM"},
{ComponentIntegrityType::TPM, "TPM"},
{ComponentIntegrityType::OEM, "OEM"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(MeasurementSpecification, {
{MeasurementSpecification::Invalid, "Invalid"},
{MeasurementSpecification::DMTF, "DMTF"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(SPDMmeasurementSummaryType, {
{SPDMmeasurementSummaryType::Invalid, "Invalid"},
{SPDMmeasurementSummaryType::TCB, "TCB"},
{SPDMmeasurementSummaryType::All, "All"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(DMTFmeasurementTypes, {
{DMTFmeasurementTypes::Invalid, "Invalid"},
{DMTFmeasurementTypes::ImmutableROM, "ImmutableROM"},
{DMTFmeasurementTypes::MutableFirmware, "MutableFirmware"},
{DMTFmeasurementTypes::HardwareConfiguration, "HardwareConfiguration"},
{DMTFmeasurementTypes::FirmwareConfiguration, "FirmwareConfiguration"},
{DMTFmeasurementTypes::MutableFirmwareVersion, "MutableFirmwareVersion"},
{DMTFmeasurementTypes::MutableFirmwareSecurityVersionNumber, "MutableFirmwareSecurityVersionNumber"},
{DMTFmeasurementTypes::MeasurementManifest, "MeasurementManifest"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(VerificationStatus, {
{VerificationStatus::Invalid, "Invalid"},
{VerificationStatus::Success, "Success"},
{VerificationStatus::Failed, "Failed"},
});
NLOHMANN_JSON_SERIALIZE_ENUM(SecureSessionType, {
{SecureSessionType::Invalid, "Invalid"},
{SecureSessionType::Plain, "Plain"},
{SecureSessionType::EncryptedAuthenticated, "EncryptedAuthenticated"},
{SecureSessionType::AuthenticatedOnly, "AuthenticatedOnly"},
});
} // namespace component_integrity
// clang-format on