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