]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/cryptsetup/cryptsetup.c
cryptsetup-pkcs11: also plug credential name to use to credential plugin
[thirdparty/systemd.git] / src / cryptsetup / cryptsetup.c
index e96686cff329955b78adc2a55131458f32f7c813..63f8cdb81f1fdc87c0c60e94a28fd4d9d4f2c76d 100644 (file)
@@ -1492,6 +1492,7 @@ static int attach_luks2_by_pkcs11_via_plugin(
                 const char *friendly_name,
                 usec_t until,
                 bool headless,
+                const char *askpw_credential,
                 uint32_t flags) {
 
 #if HAVE_LIBCRYPTSETUP_PLUGINS
@@ -1504,6 +1505,7 @@ static int attach_luks2_by_pkcs11_via_plugin(
                 .friendly_name = friendly_name,
                 .until = until,
                 .headless = headless,
+                .askpw_credential = askpw_credential,
                 .askpw_flags = arg_ask_password_flags,
         };
 
@@ -1567,7 +1569,14 @@ static int attach_luks_or_plain_or_bitlk_by_pkcs11(
 
         for (;;) {
                 if (use_libcryptsetup_plugin && arg_pkcs11_uri_auto)
-                        r = attach_luks2_by_pkcs11_via_plugin(cd, name, friendly, until, arg_headless, flags);
+                        r = attach_luks2_by_pkcs11_via_plugin(
+                                        cd,
+                                        name,
+                                        friendly,
+                                        until,
+                                        arg_headless,
+                                        "cryptsetup.pkcs11-pin",
+                                        flags);
                 else {
                         r = decrypt_pkcs11_key(
                                         name,