2017-05-01 20:19:19 +00:00
|
|
|
#!/usr/bin/env zsh
|
|
|
|
|
2024-08-31 02:39:03 +00:00
|
|
|
export test_description="Testing tomb with KDF keys"
|
2017-05-01 20:19:19 +00:00
|
|
|
|
|
|
|
source ./setup
|
|
|
|
|
|
|
|
if test_have_prereq KDF; then
|
|
|
|
test_export "kdf"
|
|
|
|
test_expect_success 'Testing KDF: tomb creation' '
|
|
|
|
tt_dig -s 20 &&
|
|
|
|
tt_forge --tomb-pwd $DUMMYPASS --kdf 1 &&
|
|
|
|
print $DUMMYPASS \
|
|
|
|
| gpg --batch --passphrase-fd 0 --no-tty --no-options -d $tomb_key \
|
2022-04-13 13:21:46 +00:00
|
|
|
| xxd &&
|
2024-08-31 02:51:16 +00:00
|
|
|
tt_lock --tomb-pwd $DUMMYPASS
|
2017-05-01 20:19:19 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'Testing KDF: tomb passwd' '
|
2024-08-31 02:51:16 +00:00
|
|
|
tt passwd -k $tomb_key \
|
2017-05-01 20:19:19 +00:00
|
|
|
--unsafe --tomb-old-pwd $DUMMYPASS --tomb-pwd $DUMMYPASSNEW &&
|
2024-08-31 02:51:16 +00:00
|
|
|
tt passwd -k $tomb_key \
|
2017-05-01 20:19:19 +00:00
|
|
|
--unsafe --tomb-old-pwd $DUMMYPASSNEW --tomb-pwd $DUMMYPASS
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'Testing KDF: tomb open & close' '
|
2024-08-31 02:51:16 +00:00
|
|
|
tt_open --tomb-pwd $DUMMYPASS &&
|
2017-05-01 20:19:19 +00:00
|
|
|
tt_close
|
|
|
|
'
|
|
|
|
fi
|
|
|
|
|
2024-08-31 02:39:03 +00:00
|
|
|
# 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 &&
|
2024-08-31 02:51:16 +00:00
|
|
|
tt_lock --tomb-pwd $DUMMYPASS
|
2024-08-31 02:39:03 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'Testing KDF ARGON2: tomb passwd' '
|
2024-08-31 02:51:16 +00:00
|
|
|
tt passwd -k $tomb_key \
|
2024-08-31 02:39:03 +00:00
|
|
|
--unsafe --tomb-old-pwd $DUMMYPASS --tomb-pwd $DUMMYPASSNEW &&
|
2024-08-31 02:51:16 +00:00
|
|
|
tt passwd -k $tomb_key \
|
2024-08-31 02:39:03 +00:00
|
|
|
--unsafe --tomb-old-pwd $DUMMYPASSNEW --tomb-pwd $DUMMYPASS
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'Testing KDF ARGON2: tomb open & close' '
|
2024-08-31 02:51:16 +00:00
|
|
|
tt_open --tomb-pwd $DUMMYPASS &&
|
2024-08-31 02:39:03 +00:00
|
|
|
tt_close
|
|
|
|
'
|
|
|
|
fi
|
|
|
|
|
2017-05-01 20:19:19 +00:00
|
|
|
test_done
|