]> git.ipfire.org Git - thirdparty/systemd.git/commit
cryptsetup-tokens: Print tpm2-primary-alg: only when it is known 40872/head
authorVitaly Kuznetsov <vkuznets@redhat.com>
Fri, 27 Feb 2026 13:20:20 +0000 (14:20 +0100)
committerVitaly Kuznetsov <vkuznets@redhat.com>
Fri, 27 Feb 2026 13:22:22 +0000 (14:22 +0100)
commit4883ef8aae80b0c1e69047c83b3830b9675db8e3
treef29fcb12ca8429cb1622b7f3d78c0d8435dff871
parent295affa3f7b74fb8bc680db2d7539e110e6d9130
cryptsetup-tokens: Print tpm2-primary-alg: only when it is known

When 'tpm2-primary-alg' is missing in LUKS JSON token, the output of
'cryptsetup luksDump' is always:

tpm2-primary-alg: ecc

because tpm2_parse_luks2_json() returns the default (TPM2_ALG_ECC). This can be
misleading and wrong. Make tpm2_parse_luks2_json() return the reality and move
the default to tpm2_unseal().
src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-tpm2.c
src/shared/tpm2-util.c