aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Kozina <okozina@redhat.com>2023-10-06 15:37:39 +0200
committerMilan Broz <gmazyland@gmail.com>2023-10-09 09:49:54 +0000
commit15c3a2a2a9571638ed0bc191207de5f41028ad32 (patch)
tree699f444f7b69977ae1d6892357e724a1ea0b80ee
parent717bd0665d8b627e54fc55b7feb9872bee484ce1 (diff)
downloadcryptsetup-15c3a2a2a9571638ed0bc191207de5f41028ad32.tar.gz
Check passphrase for user selected keyslot only.
When adding new keyslot we check if provided existing passphrase is correct first. Since user may now select specific existing keyslot (to extract volume key) it's no use to check any matching keyslot. Test passphrase only for user specified keyslot.
-rw-r--r--src/cryptsetup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cryptsetup.c b/src/cryptsetup.c
index 2f18c71d..5616d7d3 100644
--- a/src/cryptsetup.c
+++ b/src/cryptsetup.c
@@ -2216,7 +2216,7 @@ static int action_luksAddKey(void)
goto out;
/* Check password before asking for new one */
- r = crypt_activate_by_passphrase(cd, NULL, CRYPT_ANY_SLOT,
+ r = crypt_activate_by_passphrase(cd, NULL, keyslot_old,
password, password_size, 0);
check_signal(&r);
tools_passphrase_msg(r);