]> git.ipfire.org Git - thirdparty/systemd.git/commit
cryptsetup-tokens: Print tpm2-primary-alg: only when it is known
authorVitaly Kuznetsov <vkuznets@redhat.com>
Fri, 27 Feb 2026 13:20:20 +0000 (14:20 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 12 Mar 2026 20:13:23 +0000 (20:13 +0000)
commit5c6aad945e1a914e7902030c2c2f8ad4d856b3e9
tree6944f10cd8830f752eb769a732e65e1d1b62d2cb
parent58d9979911cd1472f2369acefb4805d8107b8270
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().

(cherry picked from commit 4883ef8aae80b0c1e69047c83b3830b9675db8e3)
(cherry picked from commit 0b4f049ecc8c69ef8b0671e762e9cbe3cd6284ab)
(cherry picked from commit b69a842e11fd70f9b6a31d6d42e09b5d434c114c)
src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-tpm2.c
src/shared/tpm2-util.c