Skip to contentSkip to conversation

tests: switch password quality check off for luks2 test

PATCH In review Gary Lin via Grub-devel 3 participants 3 messages Dec 29, 2023 – Jan 23, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: switch password quality check off for luks2 test

When adding/changing the password for the luks2 partition, cryptsetup may reject the command due to the weak password. Since this is only for testing, add '--force-password' to switch password quality check off to avoid the unexpected failure.

---
 tests/grub_cmd_cryptomount.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/grub_cmd_cryptomount.in +1 -1
index 4578ab709..f4d8f3547 100644
@@ -173,7 +173,7 @@ eval testcase_fail "'LUKS2 test with argon2 pbkdf:'" \
 # Add good password to second slot and change first slot to unchecked password
 csscript=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 99
 cat >$csscript <<'EOF'
-    CSOPTS="--pbkdf-force-iterations 1000 --pbkdf=pbkdf2"
+    CSOPTS="--pbkdf-force-iterations 1000 --pbkdf=pbkdf2 --force-password"
     cryptsetup $CSOPTS --key-file $lukskeyfile luksAddKey $luksdiskfile $lukskeyfile
     echo "newpass" | cryptsetup $CSOPTS --key-file $lukskeyfile --key-slot 0 luksChangeKey $luksdiskfile
 EOF
Signature · 7 lines
2.35.3


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · On Fri, 29 Dec 2023 17:08:20 +0800 Gary Lin <[email protected]> wrote:

When adding/changing the password for the luks2 partition, cryptsetup may reject the command due to the weak password. Since this is only for testing, add '--force-password' to switch password quality check off to avoid the unexpected failure.

This was caught in the fs tests but not added here. Thanks.

Glenn

Quoted 10 lines
---
 tests/grub_cmd_cryptomount.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/grub_cmd_cryptomount.in +0 -0
index 4578ab709..f4d8f3547 100644

tests/grub_cmd_cryptomount.in eval testcase_fail "'LUKS2 test with argon2 pbkdf:'" \ · line 179

Quoted 8 lines
tests/grub_cmd_cryptomount.in +1 -1
@@ -173,7 +173,7 @@ eval testcase_fail "'LUKS2 test with argon2 pbkdf:'" \
 # Add good password to second slot and change first slot to unchecked password
 csscript=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 99
 cat >$csscript <<'EOF'
-    CSOPTS="--pbkdf-force-iterations 1000 --pbkdf=pbkdf2"
+    CSOPTS="--pbkdf-force-iterations 1000 --pbkdf=pbkdf2 --force-password"
     cryptsetup $CSOPTS --key-file $lukskeyfile luksAddKey $luksdiskfile $lukskeyfile
     echo "newpass" | cryptsetup $CSOPTS --key-file $lukskeyfile --key-slot 0 luksChangeKey $luksdiskfile
 EOF

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Reviewed-by
#2 lore raw
Quoted 11 lines · Glenn Washburn
Quoted 4 lines · On Fri, 29 Dec 2023 17:08:20 +0800 Gary Lin <[email protected]> wrote:

When adding/changing the password for the luks2 partition, cryptsetup may reject the command due to the weak password. Since this is only for testing, add '--force-password' to switch password quality check off to avoid the unexpected failure.

This was caught in the fs tests but not added here. Thanks.

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel