X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT357-index-decryption.sh;h=c3730488f792c0863ea3d7a3214d2f7b3bd0635c;hp=7996ec67d07de396a4868292ed239f5aabe294ab;hb=a1260896f6b2beb82f46c41663f00cb42a4c5ce7;hpb=e4890b5bf9e2260b36bcc36ddb77d8e97e2abe7d diff --git a/test/T357-index-decryption.sh b/test/T357-index-decryption.sh index 7996ec67..c3730488 100755 --- a/test/T357-index-decryption.sh +++ b/test/T357-index-decryption.sh @@ -200,6 +200,33 @@ test_expect_equal \ "$output" \ "$expected" +test_begin_subtest "notmuch reply should show cleartext if session key is present" +output=$(notmuch reply id:simple-encrypted@crypto.notmuchmail.org | grep '^>') +expected='> This is a top sekrit message.' +if [ $NOTMUCH_HAVE_GMIME_SESSION_KEYS -eq 0 ]; then + test_subtest_known_broken +fi +test_expect_equal \ + "$output" \ + "$expected" + +test_begin_subtest "notmuch show should show cleartext if session key is present" +output=$(notmuch show id:simple-encrypted@crypto.notmuchmail.org | awk '/^\014part}/{ f=0 }; { if (f) { print $0 } } /^\014part{ ID: 3/{ f=1 }') +expected='This is a top sekrit message.' +if [ $NOTMUCH_HAVE_GMIME_SESSION_KEYS -eq 0 ]; then + test_subtest_known_broken +fi +test_expect_equal \ + "$output" \ + "$expected" + +test_begin_subtest "notmuch show should show nothing if decryption is explicitly disallowed" +output=$(notmuch show --decrypt=false id:simple-encrypted@crypto.notmuchmail.org | awk '/^\014part}/{ f=0 }; { if (f) { print $0 } } /^\014part{ ID: 3/{ f=1 }') +expected='Non-text part: application/octet-stream' +test_expect_equal \ + "$output" \ + "$expected" + # TODO: test removal of a message from the message store between # indexing and reindexing.