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     TCM,
13     TPCM,
14     OEM,
15 };
16 
17 enum class MeasurementSpecification{
18     Invalid,
19     DMTF,
20 };
21 
22 enum class SPDMmeasurementSummaryType{
23     Invalid,
24     TCB,
25     All,
26 };
27 
28 enum class DMTFmeasurementTypes{
29     Invalid,
30     ImmutableROM,
31     MutableFirmware,
32     HardwareConfiguration,
33     FirmwareConfiguration,
34     MutableFirmwareVersion,
35     MutableFirmwareSecurityVersionNumber,
36     MeasurementManifest,
37 };
38 
39 enum class VerificationStatus{
40     Invalid,
41     Success,
42     Failed,
43 };
44 
45 enum class SecureSessionType{
46     Invalid,
47     Plain,
48     EncryptedAuthenticated,
49     AuthenticatedOnly,
50 };
51 
52 NLOHMANN_JSON_SERIALIZE_ENUM(ComponentIntegrityType, {
53     {ComponentIntegrityType::Invalid, "Invalid"},
54     {ComponentIntegrityType::SPDM, "SPDM"},
55     {ComponentIntegrityType::TPM, "TPM"},
56     {ComponentIntegrityType::TCM, "TCM"},
57     {ComponentIntegrityType::TPCM, "TPCM"},
58     {ComponentIntegrityType::OEM, "OEM"},
59 });
60 
61 NLOHMANN_JSON_SERIALIZE_ENUM(MeasurementSpecification, {
62     {MeasurementSpecification::Invalid, "Invalid"},
63     {MeasurementSpecification::DMTF, "DMTF"},
64 });
65 
66 NLOHMANN_JSON_SERIALIZE_ENUM(SPDMmeasurementSummaryType, {
67     {SPDMmeasurementSummaryType::Invalid, "Invalid"},
68     {SPDMmeasurementSummaryType::TCB, "TCB"},
69     {SPDMmeasurementSummaryType::All, "All"},
70 });
71 
72 NLOHMANN_JSON_SERIALIZE_ENUM(DMTFmeasurementTypes, {
73     {DMTFmeasurementTypes::Invalid, "Invalid"},
74     {DMTFmeasurementTypes::ImmutableROM, "ImmutableROM"},
75     {DMTFmeasurementTypes::MutableFirmware, "MutableFirmware"},
76     {DMTFmeasurementTypes::HardwareConfiguration, "HardwareConfiguration"},
77     {DMTFmeasurementTypes::FirmwareConfiguration, "FirmwareConfiguration"},
78     {DMTFmeasurementTypes::MutableFirmwareVersion, "MutableFirmwareVersion"},
79     {DMTFmeasurementTypes::MutableFirmwareSecurityVersionNumber, "MutableFirmwareSecurityVersionNumber"},
80     {DMTFmeasurementTypes::MeasurementManifest, "MeasurementManifest"},
81 });
82 
83 NLOHMANN_JSON_SERIALIZE_ENUM(VerificationStatus, {
84     {VerificationStatus::Invalid, "Invalid"},
85     {VerificationStatus::Success, "Success"},
86     {VerificationStatus::Failed, "Failed"},
87 });
88 
89 NLOHMANN_JSON_SERIALIZE_ENUM(SecureSessionType, {
90     {SecureSessionType::Invalid, "Invalid"},
91     {SecureSessionType::Plain, "Plain"},
92     {SecureSessionType::EncryptedAuthenticated, "EncryptedAuthenticated"},
93     {SecureSessionType::AuthenticatedOnly, "AuthenticatedOnly"},
94 });
95 
96 }
97 // clang-format on
98