1 #pragma once
2 #include <nlohmann/json.hpp>
3 
4 namespace component_integrity
5 {
6 // clang-format off
7 
8 enum class ComponentIntegrityType{
9     Invalid,
10     SPDM,
11     TPM,
12     OEM,
13 };
14 
15 enum class MeasurementSpecification{
16     Invalid,
17     DMTF,
18 };
19 
20 enum class SPDMmeasurementSummaryType{
21     Invalid,
22     TCB,
23     All,
24 };
25 
26 enum class DMTFmeasurementTypes{
27     Invalid,
28     ImmutableROM,
29     MutableFirmware,
30     HardwareConfiguration,
31     FirmwareConfiguration,
32     MutableFirmwareVersion,
33     MutableFirmwareSecurityVersionNumber,
34     MeasurementManifest,
35 };
36 
37 enum class VerificationStatus{
38     Invalid,
39     Success,
40     Failed,
41 };
42 
43 enum class SecureSessionType{
44     Invalid,
45     Plain,
46     EncryptedAuthenticated,
47     AuthenticatedOnly,
48 };
49 
50 NLOHMANN_JSON_SERIALIZE_ENUM(ComponentIntegrityType, {
51     {ComponentIntegrityType::Invalid, "Invalid"},
52     {ComponentIntegrityType::SPDM, "SPDM"},
53     {ComponentIntegrityType::TPM, "TPM"},
54     {ComponentIntegrityType::OEM, "OEM"},
55 });
56 
57 NLOHMANN_JSON_SERIALIZE_ENUM(MeasurementSpecification, {
58     {MeasurementSpecification::Invalid, "Invalid"},
59     {MeasurementSpecification::DMTF, "DMTF"},
60 });
61 
62 NLOHMANN_JSON_SERIALIZE_ENUM(SPDMmeasurementSummaryType, {
63     {SPDMmeasurementSummaryType::Invalid, "Invalid"},
64     {SPDMmeasurementSummaryType::TCB, "TCB"},
65     {SPDMmeasurementSummaryType::All, "All"},
66 });
67 
68 NLOHMANN_JSON_SERIALIZE_ENUM(DMTFmeasurementTypes, {
69     {DMTFmeasurementTypes::Invalid, "Invalid"},
70     {DMTFmeasurementTypes::ImmutableROM, "ImmutableROM"},
71     {DMTFmeasurementTypes::MutableFirmware, "MutableFirmware"},
72     {DMTFmeasurementTypes::HardwareConfiguration, "HardwareConfiguration"},
73     {DMTFmeasurementTypes::FirmwareConfiguration, "FirmwareConfiguration"},
74     {DMTFmeasurementTypes::MutableFirmwareVersion, "MutableFirmwareVersion"},
75     {DMTFmeasurementTypes::MutableFirmwareSecurityVersionNumber, "MutableFirmwareSecurityVersionNumber"},
76     {DMTFmeasurementTypes::MeasurementManifest, "MeasurementManifest"},
77 });
78 
79 NLOHMANN_JSON_SERIALIZE_ENUM(VerificationStatus, {
80     {VerificationStatus::Invalid, "Invalid"},
81     {VerificationStatus::Success, "Success"},
82     {VerificationStatus::Failed, "Failed"},
83 });
84 
85 NLOHMANN_JSON_SERIALIZE_ENUM(SecureSessionType, {
86     {SecureSessionType::Invalid, "Invalid"},
87     {SecureSessionType::Plain, "Plain"},
88     {SecureSessionType::EncryptedAuthenticated, "EncryptedAuthenticated"},
89     {SecureSessionType::AuthenticatedOnly, "AuthenticatedOnly"},
90 });
91 
92 }
93 // clang-format on
94