From e2fe8e508e49b270131ebfe1077bb6862203b3b2 Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Tue, 31 Jan 2017 16:01:42 +0000 Subject: [PATCH] Add unit tests for steganography feature using GPG key --- extras/test/runtests | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/extras/test/runtests b/extras/test/runtests index 9269d67..cdf9e18 100755 --- a/extras/test/runtests +++ b/extras/test/runtests @@ -60,7 +60,8 @@ tests=(dig forge lock badpass open close passwd chksum bind setkey recip-dig recip-forge recip-lock recip-open recip-close) { test $RESIZER = 1 } && { tests+=(resize) } { test $KDF = 1 } && { tests+=(kdforge kdfpass kdflock kdfopen) } -{ test $STEGHIDE = 1 } && { tests+=(stgin stgout stgopen stgpipe stgimpl) } +{ test $STEGHIDE = 1 } && { tests+=(stgin stgout stgopen stgpipe stgimpl +recip-stgin recip-stgout recip-stgopen recip-stgimpl) } { test $QRENCODE = 1 } && { tests+=(qrenc) } # GnuPG Conf. @@ -135,6 +136,33 @@ test-tomb-recip() { tt close recip { test $? = 0 } && { results+=(recip-close SUCCESS) } + { test $STEGHIDE = 1 } && { + notice "Testing tomb with recipient steganographic hiding of keys" + + cp -f arditi.jpg /tmp/recip.jpg + sudo rm -f /tmp/recip.steg.key + + # The implementation does not support "--unsafe --tomb-pwd ${dummypass}" yet + tt bury -k /tmp/recip.tomb.key \ + /tmp/recip.jpg -r "$gpgid_1" + { test $? = 0 } && { results+=(recip-stgin SUCCESS) } + + tt exhume -k /tmp/recip.steg.key \ + /tmp/recip.jpg + { test $? = 0 } && { results+=(recip-stgout SUCCESS) } + + tt open -k /tmp/recip.steg.key \ + /tmp/recip.tomb -r "$gpgid_1" + { test $? = 0 } && { results+=(recip-stgopen SUCCESS) } + ${T} close recip + + notice "test using open -k image.jpeg" + tt open -k /tmp/recip.jpg \ + /tmp/recip.tomb -r "$gpgid_1" + { test $? = 0 } && { results+=(recip-stgimpl SUCCESS) } + tt close recip + } + } test-bind-hooks() {