cryptsetup: allow customizing cache behavior
authorKamil Szczęk <kamil@szczek.dev>
Sat, 11 May 2024 08:42:14 +0000 (10:42 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 27 Jun 2024 11:00:49 +0000 (13:00 +0200)
commitfd8ed7f26b5e365c27599bb6b223caaaa20dd2ca
tree63418a8ef13502d79d9e1627d52231b52c7d082b
parent53b6c99018f918a5d2c9000ac5fe3a2440115ea7
cryptsetup: allow customizing cache behavior

The new "password-cache" option allows customizing behavior of the
ask-password module in regards to caching credentials in the kernel
keyring. There are 3 possible values for this option:
  * read-only - look for credentials in kernel keyring before asking
  * on - same as read-only, but also save credentials input by user
  * off - disable keyring credential cache

Currently the cache is forced upon the user and this can cause issues.
For example, if user wants to attach two volumes with two different
FIDO2 tokens in a quick succession, the attachment operation for the
second volume will use the PIN cached from the first FIDO2 token, which
of course will fail and since tokens are only attempted once, this will
cause fallback to a password prompt.
man/crypttab.xml
man/systemd-cryptsetup.xml
src/cryptsetup/cryptsetup.c
src/shared/cryptsetup-fido2.c
src/shared/cryptsetup-tpm2.c