]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tpm2-util: Make sure structs/enums are named and add to forward.h
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 14 May 2025 20:27:28 +0000 (22:27 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 14 May 2025 20:34:02 +0000 (22:34 +0200)
We have to name structs/enums to be able to forward declare them, so
let's do that and add the missing ones to forward.h.

src/basic/forward.h
src/shared/tpm2-util.h

index 5f34874f33735ad87477a1d62597cc69642e3519..27d248ce9d14ec2229c5eeb6054a95b786f5fdfe 100644 (file)
@@ -244,6 +244,8 @@ typedef enum PagerFlags PagerFlags;
 typedef enum PatternCompileCase PatternCompileCase;
 typedef enum ResolveSupport ResolveSupport;
 typedef enum TPM2Flags TPM2Flags;
+typedef enum Tpm2Support Tpm2Support;
+typedef enum Tpm2UserspaceEventType Tpm2UserspaceEventType;
 typedef enum UnitFileFlags UnitFileFlags;
 typedef enum UnitFilePresetMode UnitFilePresetMode;
 typedef enum UnitFileState UnitFileState;
@@ -269,6 +271,8 @@ typedef struct MountOptions MountOptions;
 typedef struct OpenFile OpenFile;
 typedef struct Pkcs11EncryptedKey Pkcs11EncryptedKey;
 typedef struct Table Table;
+typedef struct Tpm2Context Tpm2Context;
+typedef struct Tpm2Handle Tpm2Handle;
 typedef struct Tpm2PCRValue Tpm2PCRValue;
 typedef struct UnitInfo UnitInfo;
 typedef struct UserRecord UserRecord;
index d6e5297ce9377a7559752f95dc981b12158e0d92..08c6bd45dd6d3ffe65f923cb5ac59634f48c9e16 100644 (file)
@@ -55,7 +55,7 @@ static inline bool TPM2_PCR_MASK_VALID(uint32_t pcr_mask) {
 
 int dlopen_tpm2(void);
 
-typedef struct {
+typedef struct Tpm2Context {
         unsigned n_ref;
 
         void *tcti_dl;
@@ -78,7 +78,7 @@ Tpm2Context *tpm2_context_ref(Tpm2Context *context);
 Tpm2Context *tpm2_context_unref(Tpm2Context *context);
 DEFINE_TRIVIAL_CLEANUP_FUNC(Tpm2Context*, tpm2_context_unref);
 
-typedef struct {
+typedef struct Tpm2Handle {
         Tpm2Context *tpm2_context;
         ESYS_TR esys_handle;
 
@@ -94,7 +94,7 @@ int tpm2_handle_new(Tpm2Context *context, Tpm2Handle **ret_handle);
 Tpm2Handle *tpm2_handle_free(Tpm2Handle *handle);
 DEFINE_TRIVIAL_CLEANUP_FUNC(Tpm2Handle*, tpm2_handle_free);
 
-typedef struct {
+typedef struct Tpm2PCRValue {
         unsigned index;
         TPMI_ALG_HASH hash;
         TPM2B_DIGEST value;
@@ -370,9 +370,9 @@ int tpm2_hmac_key_from_pin(Tpm2Context *c, const Tpm2Handle *session, const TPM2
         })
 
 #else /* HAVE_TPM2 */
-typedef struct {} Tpm2Context;
-typedef struct {} Tpm2Handle;
-typedef struct {} Tpm2PCRValue;
+typedef struct Tpm2Context {} Tpm2Context;
+typedef struct Tpm2Handle {} Tpm2Handle;
+typedef struct Tpm2PCRValue {} Tpm2PCRValue;
 
 #define TPM2_PCR_VALUE_MAKE(i, h, v) (Tpm2PCRValue) {}
 
@@ -440,7 +440,7 @@ char* tpm2_pcr_mask_to_string(uint32_t mask);
 
 extern const uint16_t tpm2_hash_algorithms[];
 
-typedef struct {
+typedef struct systemd_tpm2_plugin_params {
         uint32_t search_pcr_mask;
         const char *device;
         const char *signature_path;