kdf iterations need only to be specified when forging a key

the key header saves the key iteration set when forging
This commit is contained in:
Jaromil 2024-08-31 04:51:16 +02:00
parent 11a5776456
commit 32eab3beec

View File

@ -12,18 +12,18 @@ if test_have_prereq KDF; then
print $DUMMYPASS \ print $DUMMYPASS \
| gpg --batch --passphrase-fd 0 --no-tty --no-options -d $tomb_key \ | gpg --batch --passphrase-fd 0 --no-tty --no-options -d $tomb_key \
| xxd && | xxd &&
tt_lock --tomb-pwd $DUMMYPASS --kdf 1 tt_lock --tomb-pwd $DUMMYPASS
' '
test_expect_success 'Testing KDF: tomb passwd' ' test_expect_success 'Testing KDF: tomb passwd' '
tt passwd -k $tomb_key --kdf 1 \ tt passwd -k $tomb_key \
--unsafe --tomb-old-pwd $DUMMYPASS --tomb-pwd $DUMMYPASSNEW && --unsafe --tomb-old-pwd $DUMMYPASS --tomb-pwd $DUMMYPASSNEW &&
tt passwd -k $tomb_key --kdf 1 \ tt passwd -k $tomb_key \
--unsafe --tomb-old-pwd $DUMMYPASSNEW --tomb-pwd $DUMMYPASS --unsafe --tomb-old-pwd $DUMMYPASSNEW --tomb-pwd $DUMMYPASS
' '
test_expect_success 'Testing KDF: tomb open & close' ' test_expect_success 'Testing KDF: tomb open & close' '
tt_open --tomb-pwd $DUMMYPASS --kdf 1 && tt_open --tomb-pwd $DUMMYPASS &&
tt_close tt_close
' '
fi fi
@ -39,18 +39,18 @@ if test_have_prereq ARGON2; then
print $DUMMYPASS \ print $DUMMYPASS \
| gpg --batch --passphrase-fd 0 --no-tty --no-options -d $tomb_key \ | gpg --batch --passphrase-fd 0 --no-tty --no-options -d $tomb_key \
| xxd && | xxd &&
tt_lock --tomb-pwd $DUMMYPASS --kdf 1 tt_lock --tomb-pwd $DUMMYPASS
' '
test_expect_success 'Testing KDF ARGON2: tomb passwd' ' test_expect_success 'Testing KDF ARGON2: tomb passwd' '
tt passwd -k $tomb_key --kdf 1 \ tt passwd -k $tomb_key \
--unsafe --tomb-old-pwd $DUMMYPASS --tomb-pwd $DUMMYPASSNEW && --unsafe --tomb-old-pwd $DUMMYPASS --tomb-pwd $DUMMYPASSNEW &&
tt passwd -k $tomb_key --kdf 1 \ tt passwd -k $tomb_key \
--unsafe --tomb-old-pwd $DUMMYPASSNEW --tomb-pwd $DUMMYPASS --unsafe --tomb-old-pwd $DUMMYPASSNEW --tomb-pwd $DUMMYPASS
' '
test_expect_success 'Testing KDF ARGON2: tomb open & close' ' test_expect_success 'Testing KDF ARGON2: tomb open & close' '
tt_open --tomb-pwd $DUMMYPASS --kdf 1 && tt_open --tomb-pwd $DUMMYPASS &&
tt_close tt_close
' '
fi fi