]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tpm2: make PcrIndex an anonymous enum
authorLennart Poettering <lennart@poettering.net>
Tue, 27 Jun 2023 16:46:07 +0000 (18:46 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 27 Jun 2023 20:14:09 +0000 (22:14 +0200)
It just gives names for things generally just handled as numeric
indexes, hence drop the type name, and make the enum anonymous. Nothing
is using the type name anyway.

src/shared/tpm2-util.h

index 5fa64563796e8b28f938b440d68b53460c6f782c..953e936c75f38b166feca24c68e70b6782fb9ad4 100644 (file)
@@ -181,17 +181,19 @@ typedef enum Tpm2Support {
         TPM2_SUPPORT_FULL      = TPM2_SUPPORT_FIRMWARE|TPM2_SUPPORT_DRIVER|TPM2_SUPPORT_SYSTEM|TPM2_SUPPORT_SUBSYSTEM,
 } Tpm2Support;
 
-typedef enum PcrIndex {
-/* The following names for PCRs 0…7 are based on the names in the "TCG PC Client Specific Platform Firmware Profile Specification" (https://trustedcomputinggroup.org/resource/pc-client-specific-platform-firmware-profile-specification/) */
-   PCR_PLATFORM_CODE       = 0,
+enum {
+        /* The following names for PCRs 0…7 are based on the names in the "TCG PC Client Specific Platform
+         * Firmware Profile Specification"
+         * (https://trustedcomputinggroup.org/resource/pc-client-specific-platform-firmware-profile-specification/) */
+        PCR_PLATFORM_CODE       = 0,
         PCR_PLATFORM_CONFIG     = 1,
         PCR_EXTERNAL_CODE       = 2,
         PCR_EXTERNAL_CONFIG     = 3,
         PCR_BOOT_LOADER_CODE    = 4,
         PCR_BOOT_LOADER_CONFIG  = 5,
         PCR_SECURE_BOOT_POLICY  = 7,
-/* The following names for PCRs 9…15 are based on the "Linux TPM PCR Registry"
-(https://uapi-group.org/specifications/specs/linux_tpm_pcr_registry/) */
+        /* The following names for PCRs 9…15 are based on the "Linux TPM PCR Registry"
+        (https://uapi-group.org/specifications/specs/linux_tpm_pcr_registry/) */
         PCR_KERNEL_INITRD       = 9,
         PCR_IMA                 = 10,
         PCR_KERNEL_BOOT         = 11,
@@ -199,12 +201,12 @@ typedef enum PcrIndex {
         PCR_SYSEXTS             = 13,
         PCR_SHIM_POLICY         = 14,
         PCR_SYSTEM_IDENTITY     = 15,
-/* As per "TCG PC Client Specific Platform Firmware Profile Specification" again, see above */
+        /* As per "TCG PC Client Specific Platform Firmware Profile Specification" again, see above */
         PCR_DEBUG               = 16,
         PCR_APPLICATION_SUPPORT = 23,
         _PCR_INDEX_MAX_DEFINED  = TPM2_PCRS_MAX,
         _PCR_INDEX_INVALID      = -EINVAL,
-} PcrIndex;
+};
 
 Tpm2Support tpm2_support(void);