2017-05-01 20:22:36 +00:00
|
|
|
#!/usr/bin/env zsh
|
|
|
|
|
|
|
|
export test_description="Testing set key"
|
|
|
|
|
|
|
|
source ./setup
|
|
|
|
|
|
|
|
test_export "test" # Using already generated tomb
|
|
|
|
test_expect_success 'Testing set key' '
|
|
|
|
tt forge -k $tomb_key_new --tomb-pwd $DUMMYPASS \
|
2019-05-22 07:55:02 +00:00
|
|
|
--ignore-swap --unsafe --force &&
|
2017-05-01 20:22:36 +00:00
|
|
|
tt setkey -k $tomb_key_new $tomb_key $tomb \
|
|
|
|
--unsafe --tomb-pwd $DUMMYPASS --tomb-old-pwd $DUMMYPASS &&
|
|
|
|
tt open -k $tomb_key_new $tomb \
|
|
|
|
--unsafe --tomb-pwd $DUMMYPASS &&
|
|
|
|
print $DUMMYPASS \
|
|
|
|
| gpg --batch --passphrase-fd 0 --no-tty --no-options -d $tomb_key_new \
|
2022-04-13 13:21:46 +00:00
|
|
|
| xxd &&
|
2017-05-01 20:22:36 +00:00
|
|
|
tt_close
|
|
|
|
'
|
|
|
|
|
2022-04-13 14:12:11 +00:00
|
|
|
if test_have_prereq GPGRCPT; then
|
2017-05-01 20:22:36 +00:00
|
|
|
test_export "recipient" # Using already generated tomb
|
|
|
|
test_expect_success 'Testing tomb with GnuPG keys: setkey' '
|
2019-05-22 07:55:02 +00:00
|
|
|
tt forge $tomb_key_new -g -r $KEY2 --ignore-swap --unsafe &&
|
2017-05-01 20:22:36 +00:00
|
|
|
tt setkey -k $tomb_key_new $tomb_key $tomb -g -r $KEY2 &&
|
|
|
|
tt open -k $tomb_key_new $tomb -g &&
|
|
|
|
tt_close
|
|
|
|
'
|
2022-04-13 14:12:11 +00:00
|
|
|
fi
|
2017-05-01 20:22:36 +00:00
|
|
|
|
2019-03-03 16:56:26 +00:00
|
|
|
if test_have_prereq SPHINX ORACLE; then
|
|
|
|
test_export "sphinx_test" # Using already generated tomb
|
|
|
|
test_expect_success 'Testing set key (sphinx)' '
|
|
|
|
tt forge -k $tomb_key_new --tomb-pwd $DUMMYPASS \
|
2019-05-22 07:55:02 +00:00
|
|
|
--ignore-swap --unsafe --force \
|
2019-03-03 16:56:26 +00:00
|
|
|
--sphx-user $DUMMYUSER --sphx-host $DUMMYHOST &&
|
|
|
|
tt setkey -k $tomb_key_new $tomb_key $tomb \
|
|
|
|
--unsafe --tomb-pwd $DUMMYPASS --tomb-old-pwd $DUMMYPASS \
|
|
|
|
--sphx-user $DUMMYUSER --sphx-host $DUMMYHOST &&
|
|
|
|
tt open -k $tomb_key_new $tomb \
|
|
|
|
--unsafe --tomb-pwd $DUMMYPASS \
|
|
|
|
--sphx-user $DUMMYUSER --sphx-host $DUMMYHOST &&
|
|
|
|
print $DUMMYPASS \
|
|
|
|
| gpg --batch --passphrase-fd 0 --no-tty --no-options -d $tomb_key_new \
|
2022-04-13 13:21:46 +00:00
|
|
|
| xxd &&
|
2019-03-03 16:56:26 +00:00
|
|
|
tt_close
|
|
|
|
'
|
|
|
|
fi
|
|
|
|
|
2017-05-01 20:22:36 +00:00
|
|
|
test_done
|