Expect success for argon2 cryptomount test
cover Expect success for argon2 cryptomount test
Patch #1 fixes a fialing test caused by argon2 integration (which is expected because it was written to verify that GRUB could not open LUKS2 volumes using an Argon2 keyslot).
The second patch, fixes potential issues with having spaces in the builddir path and puts the builddir autoconf macro into a variable so it only gets expanded once.
Glenn
Glenn Washburn (2):
tests/grub_cmd_cryptomount: Expect test success, now that GRUB
supports Argon2
tests/grub_cmd_cryptomount: Use builddir shell variable and quote
tests/grub_cmd_cryptomount.in | 50 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-)
Signature · 7 lines
2.34.1 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
PATCH 1/2 tests/grub_cmd_cryptomount: Expect test success, now that GRUB supports Argon2
This test was included to verify that, while GRUB did not have Argon2 support, trying to open a LUKS2 volume with an Argon2 keyslot would fail Now that Argon2 support is included, the test is failing because it expected a failure, but is now getting success. Change the test to expect success.
--- tests/grub_cmd_cryptomount.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tests/grub_cmd_cryptomount.in +1 -2
@@ -178,8 +178,7 @@ eval testcase "'LUKS2 test with different metadata size:'" \ @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ "--cs-opts='--luks2-metadata-size 512k'" -# TODO: Expect a failure with LUKS2 volumes with argon2 key derivation -eval testcase_fail "'LUKS2 test with argon2 pbkdf:'" \ +eval testcase "'LUKS2 test with argon2 pbkdf:'" \ @builddir@/grub-shell-luks-tester --luks=2 $COMMON_OPTS \ "--cs-opts='--pbkdf-memory 32'" "--cs-opts='--pbkdf-parallel 1'"
Signature · 7 lines
2.34.1 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [PATCH 1/2] tests/grub_cmd_cryptomount: Expect test success, now that GRUB supports Argon2
Quoted 11 lines · Glenn Washburn
This test was included to verify that, while GRUB did not have Argon2 support, trying to open a LUKS2 volume with an Argon2 keyslot would fail Now that Argon2 support is included, the test is failing because it expected a failure, but is now getting success. Change the test to expect success.
Signed-off-by Glenn Washburn <[email protected]>
Thanks,
Sudhakar
Quoted 26 lines
---
tests/grub_cmd_cryptomount.in | 3 +--1 file changed, 1 insertion(+), 2 deletions(-)tests/grub_cmd_cryptomount.in +1
-2@@ -178,8 +178,7 @@ eval testcase "'LUKS2 test with different metadata size:'" \ @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ "--cs-opts='--luks2-metadata-size 512k'" -# TODO: Expect a failure with LUKS2 volumes with argon2 key derivation -eval testcase_fail "'LUKS2 test with argon2 pbkdf:'" \ +eval testcase "'LUKS2 test with argon2 pbkdf:'" \ @builddir@/grub-shell-luks-tester --luks=2 $COMMON_OPTS \ "--cs-opts='--pbkdf-memory 32'" "--cs-opts='--pbkdf-parallel 1'"Signature · 7 lines
2.34.1 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
PATCH 2/2 tests/grub_cmd_cryptomount: Use builddir shell variable and quote
In reply to Glenn WashburnUsing a shell variable instead of an autoconf macro creates less changes to the file, which can be desirable when modifying by hand later and then diffing with the unexpanded file. It also makes it simpler to change the builddir after expansion, which may need to happen when moving the build dir to a different path and not being able to rerun the autoconf expansion.
Also, add quoting around the builddir variable as there may be spaces in the path.
--- tests/grub_cmd_cryptomount.in | 47 ++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 23 deletions(-)
tests/grub_cmd_cryptomount.in +24 -23
@@ -38,6 +38,7 @@ fi COMMON_OPTS='${V:+--debug=$V} --cs-opts="--pbkdf-force-iterations 1000"' debug=${GRUB_SHELL_DEFAULT_DEBUG:-$GRUB_TEST_DEFAULT_DEBUG} +builddir="@builddir@" _testcase() { local EXPECTEDRES=$1
@@ -92,94 +93,94 @@ testcase_fail() { _testcase 1 "$@"; } ### LUKS1 tests eval testcase "'LUKS1 test cryptsetup defaults:'" \ - @builddir@/grub-shell-luks-tester --luks=1 $COMMON_OPTS + "$builddir/grub-shell-luks-tester" --luks=1 $COMMON_OPTS eval testcase "'LUKS1 test with twofish cipher:'" \ - @builddir@/grub-shell-luks-tester --luks=1 $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" --luks=1 $COMMON_OPTS \ "--cs-opts='--cipher twofish-xts-plain64'" eval testcase "'LUKS1 test key file support:'" \ - @builddir@/grub-shell-luks-tester --luks=1 $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" --luks=1 $COMMON_OPTS \ --keyfile eval testcase "'LUKS1 test key file with offset:'" \ - @builddir@/grub-shell-luks-tester --luks=1 $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" --luks=1 $COMMON_OPTS \ --keyfile --cs-opts="--keyfile-offset=237" eval testcase "'LUKS1 test key file with offset and size:'" \ - @builddir@/grub-shell-luks-tester --luks=1 $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" --luks=1 $COMMON_OPTS \ --keyfile "--cs-opts='--keyfile-offset=237 --keyfile-size=1023'" eval testcase "'LUKS1 test detached header support:'" \ - @builddir@/grub-shell-luks-tester --luks=1 $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" --luks=1 $COMMON_OPTS \ --detached-header eval testcase "'LUKS1 test both detached header and key file:'" \ - @builddir@/grub-shell-luks-tester --luks=1 $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" --luks=1 $COMMON_OPTS \ --keyfile --detached-header ### LUKS2 tests (mirroring the LUKS1 tests above) LUKS2_COMMON_OPTS="--luks=2 --cs-opts=--pbkdf=pbkdf2" eval testcase "'LUKS2 test cryptsetup defaults:'" \ - @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS eval testcase "'LUKS2 test with twofish cipher:'" \ - @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ "--cs-opts='--cipher twofish-xts-plain64'" eval testcase "'LUKS2 test key file support:'" \ - @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ --keyfile eval testcase "'LUKS2 test key file with offset:'" \ - @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ --keyfile --cs-opts="--keyfile-offset=237" eval testcase "'LUKS2 test key file with offset and size:'" \ - @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ --keyfile "--cs-opts='--keyfile-offset=237 --keyfile-size=1023'" eval testcase "'LUKS2 test detached header support:'" \ - @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ --detached-header eval testcase "'LUKS2 test both detached header and key file:'" \ - @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ --keyfile --detached-header ### LUKS1 specific tests # Tests for xts-plain and xts-plain64 modes eval testcase "'LUKS1 test cryptsetup xts-plain:'" \ - @builddir@/grub-shell-luks-tester --luks=1 $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" --luks=1 $COMMON_OPTS \ "--cs-opts='--cipher aes-xts-plain'" eval testcase "'LUKS1 test cryptsetup xts-plain64:'" \ - @builddir@/grub-shell-luks-tester --luks=1 $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" --luks=1 $COMMON_OPTS \ "--cs-opts='--cipher aes-xts-plain64'" ### LUKS2 specific tests eval testcase "'LUKS2 test with 1k sector size:'" \ - @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ "--cs-opts='--sector-size 1024'" eval testcase "'LUKS2 test with 2k sector size:'" \ - @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ "--cs-opts='--sector-size 2048'" eval testcase "'LUKS2 test with 4k sector size:'" \ - @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ "--cs-opts='--sector-size 4096'" eval testcase "'LUKS2 test with non-default key slot:'" \ - @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ "--cs-opts='--key-slot 5'" eval testcase "'LUKS2 test with different metadata size:'" \ - @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ "--cs-opts='--luks2-metadata-size 512k'" eval testcase "'LUKS2 test with argon2 pbkdf:'" \ - @builddir@/grub-shell-luks-tester --luks=2 $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" --luks=2 $COMMON_OPTS \ "--cs-opts='--pbkdf-memory 32'" "--cs-opts='--pbkdf-parallel 1'" # Add good password to second slot and change first slot to unchecked password
@@ -191,7 +192,7 @@ cat >$csscript <<'EOF' EOF eval testcase "'LUKS2 test with second key slot and first slot using different password:'" \ - @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ "--cs-script='$csscript'" test -n "$debug" || rm "$csscript"
Signature · 7 lines
2.34.1 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
Re: [PATCH 2/2] tests/grub_cmd_cryptomount: Use builddir shell variable and quote
Quoted 11 lines · Glenn Washburn
Using a shell variable instead of an autoconf macro creates less changes to the file, which can be desirable when modifying by hand later and then diffing with the unexpanded file. It also makes it simpler to change the builddir after expansion, which may need to happen when moving the build dir to a different path and not being able to rerun the autoconf expansion.
Quoted 4 lines
Also, add quoting around the builddir variable as there may be spaces in the path.
Signed-off-by Glenn Washburn <[email protected]>
Thanks,
Sudhakar
Quoted 141 lines
---
tests/grub_cmd_cryptomount.in | 47 ++++++++++++++++++-----------------1 file changed, 24 insertions(+), 23 deletions(-)tests/grub_cmd_cryptomount.in +0
-0@@ -38,6 +38,7 @@ fiCOMMON_OPTS='${V:+--debug=$V} --cs-opts="--pbkdf-force-iterations 1000"'
debug=${GRUB_SHELL_DEFAULT_DEBUG:-$GRUB_TEST_DEFAULT_DEBUG} +builddir="@builddir@"
_testcase(){
local EXPECTEDRES=$1tests/grub_cmd_cryptomount.in +7
-7@@ -92,94 +93,94 @@ testcase_fail() { _testcase 1 "$@"; } ### LUKS1 tests eval testcase "'LUKS1 test cryptsetup defaults:'" \ - @builddir@/grub-shell-luks-tester --luks=1 $COMMON_OPTS + "$builddir/grub-shell-luks-tester" --luks=1 $COMMON_OPTS eval testcase "'LUKS1 test with twofish cipher:'" \ - @builddir@/grub-shell-luks-tester --luks=1 $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" --luks=1 $COMMON_OPTS \ "--cs-opts='--cipher twofish-xts-plain64'" eval testcase "'LUKS1 test key file support:'" \ - @builddir@/grub-shell-luks-tester --luks=1 $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" --luks=1 $COMMON_OPTS \ --keyfile eval testcase "'LUKS1 test key file with offset:'" \ - @builddir@/grub-shell-luks-tester --luks=1 $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" --luks=1 $COMMON_OPTS \ --keyfile --cs-opts="--keyfile-offset=237" eval testcase "'LUKS1 test key file with offset and size:'" \ - @builddir@/grub-shell-luks-tester --luks=1 $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" --luks=1 $COMMON_OPTS \ --keyfile "--cs-opts='--keyfile-offset=237 --keyfile-size=1023'" eval testcase "'LUKS1 test detached header support:'" \ - @builddir@/grub-shell-luks-tester --luks=1 $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" --luks=1 $COMMON_OPTS \ --detached-header eval testcase "'LUKS1 test both detached header and key file:'" \ - @builddir@/grub-shell-luks-tester --luks=1 $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" --luks=1 $COMMON_OPTS \ --keyfile --detached-header ### LUKS2 tests (mirroring the LUKS1 tests above)LUKS2_COMMON_OPTS="--luks=2 --cs-opts=--pbkdf=pbkdf2" eval testcase "'LUKS2 test cryptsetup defaults:'" \
tests/grub_cmd_cryptomount.in +1
-1- @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTSeval testcase "'LUKS2 test with twofish cipher:'" \
tests/grub_cmd_cryptomount.in +1
-1- @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ "--cs-opts='--cipher twofish-xts-plain64'"eval testcase "'LUKS2 test key file support:'" \
tests/grub_cmd_cryptomount.in +1
-1- @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ --keyfileeval testcase "'LUKS2 test key file with offset:'" \
tests/grub_cmd_cryptomount.in +1
-1- @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ --keyfile --cs-opts="--keyfile-offset=237"eval testcase "'LUKS2 test key file with offset and size:'" \
tests/grub_cmd_cryptomount.in +1
-1- @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ --keyfile "--cs-opts='--keyfile-offset=237 --keyfile-size=1023'"eval testcase "'LUKS2 test detached header support:'" \
tests/grub_cmd_cryptomount.in +1
-1- @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ --detached-headereval testcase "'LUKS2 test both detached header and key file:'" \
tests/grub_cmd_cryptomount.in +1
-1- @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ --keyfile --detached-header### LUKS1 specific tests
# Tests for xts-plain and xts-plain64 modes eval testcase "'LUKS1 test cryptsetup xts-plain:'" \tests/grub_cmd_cryptomount.in +1
-1- @builddir@/grub-shell-luks-tester --luks=1 $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" --luks=1 $COMMON_OPTS \ "--cs-opts='--cipher aes-xts-plain'"eval testcase "'LUKS1 test cryptsetup xts-plain64:'" \
tests/grub_cmd_cryptomount.in +1
-1- @builddir@/grub-shell-luks-tester --luks=1 $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" --luks=1 $COMMON_OPTS \ "--cs-opts='--cipher aes-xts-plain64'"### LUKS2 specific tests
eval testcase "'LUKS2 test with 1k sector size:'" \tests/grub_cmd_cryptomount.in +1
-1- @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ "--cs-opts='--sector-size 1024'"eval testcase "'LUKS2 test with 2k sector size:'" \
tests/grub_cmd_cryptomount.in +1
-1- @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ "--cs-opts='--sector-size 2048'"eval testcase "'LUKS2 test with 4k sector size:'" \
tests/grub_cmd_cryptomount.in +1
-1- @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ "--cs-opts='--sector-size 4096'"eval testcase "'LUKS2 test with non-default key slot:'" \
tests/grub_cmd_cryptomount.in +1
-1- @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ "--cs-opts='--key-slot 5'"eval testcase "'LUKS2 test with different metadata size:'" \
tests/grub_cmd_cryptomount.in +1
-1- @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ "--cs-opts='--luks2-metadata-size 512k'"eval testcase "'LUKS2 test with argon2 pbkdf:'" \
tests/grub_cmd_cryptomount.in +1
-1- @builddir@/grub-shell-luks-tester --luks=2 $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" --luks=2 $COMMON_OPTS \ "--cs-opts='--pbkdf-memory 32'" "--cs-opts='--pbkdf-parallel 1'"# Add good password to second slot and change first slot to unchecked password
tests/grub_cmd_cryptomount.in +0
-0@@ -191,7 +192,7 @@ cat >$csscript <<'EOF'EOF
eval testcase "'LUKS2 test with second key slot and first slot using different password:'" \
tests/grub_cmd_cryptomount.in +1
-1- @builddir@/grub-shell-luks-tester $LUKS2_COMMON_OPTS $COMMON_OPTS \ + "$builddir/grub-shell-luks-tester" $LUKS2_COMMON_OPTS $COMMON_OPTS \ "--cs-script='$csscript'"
Quoted 9 lines
test -n "$debug" || rm "$csscript"
Signature · 7 lines
2.34.1 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 8 lines · Glenn Washburn
Patch #1 fixes a fialing test caused by argon2 integration (which is expected because it was written to verify that GRUB could not open LUKS2 volumes using an Argon2 keyslot).
The second patch, fixes potential issues with having spaces in the builddir path and puts the builddir autoconf macro into a variable so it only gets expanded once.
Quoted 6 lines
Glenn
Glenn Washburn (2):
tests/grub_cmd_cryptomount: Expect test success, now that GRUB
supports Argon2
tests/grub_cmd_cryptomount: Use builddir shell variable and quote
For both patches Reviewed-by: Daniel Kiper <[email protected]>...
Daniel
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel