Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionVitaly Kuznetsov
2022-11-09 16:38:33 UTC
systemd-cryptsetup volume unlock with a key sealed to TPM doesn't work by default:
# systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0 /dev/vdb2
New TPM2 token enrolled as key slot 0.
# /usr/lib/systemd/systemd-cryptsetup attach encroot /dev/vdb2 - tpm2-device=/dev/tpm0
Set cipher aes, mode xts-plain64, key size 512 bits for device /dev/vdb2.
🔐 Please enter passphrase for disk encroot:
(no password request is expected at this point!)
and it isn't clear what's wrong. strace gives the answer:
2423 openat(AT_FDCWD, "/usr/lib64/cryptsetup/libcryptsetup-token-systemd-tpm2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
the plugin is found in 'devel' subpackage and after installing it everything works as expected:
# /usr/lib/systemd/systemd-cryptsetup attach encroot /dev/vdb2 - tpm2-device=/dev/tpm0
# (no password request)
This library, however, has nothing to do with 'development', it's a normal production thing. Please consider moving it from '-devel' to '-udev' (where /usr/lib/systemd/systemd-cryptsetup is currently located)
P.S. Fedora seems to package cryptsetup tokens correctly, i.e:
$ rpm -qpl systemd-udev-251.8-586.fc37.aarch64.rpm | grep cryptsetup-token
/usr/lib64/cryptsetup/libcryptsetup-token-systemd-fido2.so
/usr/lib64/cryptsetup/libcryptsetup-token-systemd-pkcs11.so
/usr/lib64/cryptsetup/libcryptsetup-token-systemd-tpm2.so