summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Pujol <alexandre@pujol.io>2017-02-03 00:16:29 (GMT)
committer Alexandre Pujol <alexandre@pujol.io>2017-02-03 23:57:52 (GMT)
commit53b7460274e8478ed955aa6b3ccd95fd502ac417 (patch)
treef4a011e38c894ef0a4267f28696777d7c05a404a
parenta200448de2a3c51305cf039381866c278468b20d (diff)
Add tomb setkey support for GPG key
-rwxr-xr-xextras/test/runtests17
-rwxr-xr-xtomb2
2 files changed, 16 insertions, 3 deletions
diff --git a/extras/test/runtests b/extras/test/runtests
index ae271c4..a89c591 100755
--- a/extras/test/runtests
+++ b/extras/test/runtests
@@ -56,8 +56,9 @@ command -v qrencode > /dev/null || QRENCODE=0
typeset -A results
-tests=(dig forge lock badpass open close passwd chksum bind setkey
-recip-dig recip-forge recip-lock recip-open recip-close recip-passwd recip-resize)
+tests=(dig forge lock badpass open close passwd chksum bind setkey recip-dig
+recip-forge recip-lock recip-open recip-close recip-passwd recip-resize
+recip-setkey)
{ test $RESIZER = 1 } && { tests+=(resize) }
{ test $KDF = 1 } && { tests+=(kdforge kdfpass kdflock kdfopen) }
{ test $STEGHIDE = 1 } && { tests+=(stgin stgout stgopen stgpipe stgimpl
@@ -176,6 +177,18 @@ test-tomb-recip() {
tt resize -s 30 $tomb -k $tomb_key -r $gpgid_2
{ test $? = 0 } && { results+=(recip-resize SUCCESS) }
+ notice "Testing tomb with recipient setting a new key: setkey"
+ sudo rm -f /tmp/new.recip.tomb.key
+ res=0
+ tt forge /tmp/new.recip.tomb.key -r $gpgid_2 \
+ --ignore-swap --unsafe --use-urandom
+ { test $? = 0 } || { res=1 }
+ tt setkey -k /tmp/new.recip.tomb.key $tomb_key $tomb -r $gpgid_2
+ { test $? = 0 } || { res=1 }
+ tt open -k /tmp/new.recip.tomb.key $tomb -r $gpgid_2
+ { test $? = 0 } || { res=1 }
+ { test $res = 0 } && { results+=(recip-setkey SUCCESS) }
+ tt close recip
}
test-bind-hooks() {
diff --git a/tomb b/tomb
index be7aa9b..fc3f7c6 100755
--- a/tomb
+++ b/tomb
@@ -2671,7 +2671,7 @@ main() {
subcommands_opts[forge]="-ignore-swap k: -kdf: o: -tomb-pwd: -use-urandom r: "
subcommands_opts[dig]="-ignore-swap s: -size=s "
subcommands_opts[lock]="-ignore-swap k: -kdf: o: -tomb-pwd: r: "
- subcommands_opts[setkey]="k: -ignore-swap -kdf: -tomb-old-pwd: -tomb-pwd: "
+ subcommands_opts[setkey]="k: -ignore-swap -kdf: -tomb-old-pwd: -tomb-pwd: r: "
subcommands_opts[engrave]="k: "
subcommands_opts[passwd]="k: -ignore-swap -kdf: -tomb-old-pwd: -tomb-pwd: r: R: "