add argon2 kdf test

This commit is contained in:
Jaromil 2024-08-31 04:39:03 +02:00
parent ef1541f7a2
commit 11a5776456
2 changed files with 29 additions and 1 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/env zsh
export test_description="Testing tomb with KDF key"
export test_description="Testing tomb with KDF keys"
source ./setup
@ -28,4 +28,31 @@ if test_have_prereq KDF; then
'
fi
# clean to avoid overwrite errors
# rm -f "$tomb_key" "$tomb"
if test_have_prereq ARGON2; then
test_export "argon2"
test_expect_success 'Testing KDF ARGON2: tomb creation' '
tt_dig -s 20 &&
tt_forge --tomb-pwd $DUMMYPASS --kdftype argon2 --kdfmem 18 --kdf 1 &&
print $DUMMYPASS \
| gpg --batch --passphrase-fd 0 --no-tty --no-options -d $tomb_key \
| xxd &&
tt_lock --tomb-pwd $DUMMYPASS --kdf 1
'
test_expect_success 'Testing KDF ARGON2: tomb passwd' '
tt passwd -k $tomb_key --kdf 1 \
--unsafe --tomb-old-pwd $DUMMYPASS --tomb-pwd $DUMMYPASSNEW &&
tt passwd -k $tomb_key --kdf 1 \
--unsafe --tomb-old-pwd $DUMMYPASSNEW --tomb-pwd $DUMMYPASS
'
test_expect_success 'Testing KDF ARGON2: tomb open & close' '
tt_open --tomb-pwd $DUMMYPASS --kdf 1 &&
tt_close
'
fi
test_done

View File

@ -58,6 +58,7 @@ command -v decloakify > /dev/null && test_set_prereq DECLOAKIFY
command -v sphinx > /dev/null && test_set_prereq SPHINX
command -v oracle > /dev/null && test_set_prereq ORACLE
command -v doas > /dev/null && test_set_prereq DOAS
command -v argon2 > /dev/null && test_set_prereq ARGON2
# GnuPG config