]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
creds: normalize definition of "tpm2-absent" legacy key type 39239/head
authorLennart Poettering <lennart@poettering.net>
Wed, 8 Oct 2025 07:16:42 +0000 (09:16 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 8 Oct 2025 07:18:59 +0000 (09:18 +0200)
This is just an alias, say so and clean up the name of the enum to match
the name of the string representation.

src/creds/creds.c

index 98206f719df3e383de668b8e274b6e45e33bac26..e861225dbe7cc8f5120d54a0468b335ce2bdb6f8 100644 (file)
@@ -99,7 +99,7 @@ typedef enum CredKeyType {
         CRED_KEY_TYPE_HOST_TPM2_PUBLIC,
         CRED_KEY_TYPE_TPM2_PUBLIC_HOST,
         CRED_KEY_TYPE_NULL,
-        CRED_KEY_TYPE_ABSENT,
+        CRED_KEY_TYPE_TPM2_ABSENT,
         _CRED_KEY_TYPE_MAX,
         _CRED_KEY_TYPE_INVALID = -EINVAL,
 } CredKeyType;
@@ -115,7 +115,7 @@ static const char* cred_key_type_table[_CRED_KEY_TYPE_MAX] = {
         [CRED_KEY_TYPE_HOST_TPM2_PUBLIC] = "host+tpm2-with-public-key",
         [CRED_KEY_TYPE_TPM2_PUBLIC_HOST] = "tpm2-with-public-key+host",
         [CRED_KEY_TYPE_NULL]             = "null",
-        [CRED_KEY_TYPE_ABSENT]           = "tpm2-absent",
+        [CRED_KEY_TYPE_TPM2_ABSENT]      = "tpm2-absent",  /* legacy alias */
 };
 
 DEFINE_PRIVATE_STRING_TABLE_LOOKUP(cred_key_type, CredKeyType);
@@ -131,7 +131,7 @@ static sd_id128_t cred_key_id[_CRED_KEY_TYPE_MAX] = {
         [CRED_KEY_TYPE_HOST_TPM2_PUBLIC] = CRED_AES256_GCM_BY_HOST_AND_TPM2_HMAC_WITH_PK,
         [CRED_KEY_TYPE_TPM2_PUBLIC_HOST] = CRED_AES256_GCM_BY_HOST_AND_TPM2_HMAC_WITH_PK,
         [CRED_KEY_TYPE_NULL]             = CRED_AES256_GCM_BY_NULL,
-        [CRED_KEY_TYPE_ABSENT]           = CRED_AES256_GCM_BY_NULL,
+        [CRED_KEY_TYPE_TPM2_ABSENT]      = CRED_AES256_GCM_BY_NULL,
 };
 
 static int open_credential_directory(