diff options
| author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2017-12-08 01:23:55 -0500 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2017-12-08 08:08:46 -0400 |
| commit | a1260896f6b2beb82f46c41663f00cb42a4c5ce7 (patch) | |
| tree | 58ee2b185f4c3fa98b865ceab204128827ec8ae9 /test | |
| parent | 6802b333eb356fdeafd97a4e4ed74999d055a852 (diff) | |
cli/show: use decryption policy "auto" by default.
When showing a message, if the user doesn't specify --decrypt= at all,
but a stashed session key is known to notmuch, notmuch should just go
ahead and try to decrypt the message with the session key (without
bothering the user for access to their asymmetric secret key).
The user can disable this at the command line with --decrypt=false if
they really don't want to look at the e-mail that they've asked
notmuch to show them.
and of course, "notmuch show --decrypt" still works for accessing the
user's secret keys if necessary.
Diffstat (limited to 'test')
| -rwxr-xr-x | test/T357-index-decryption.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/T357-index-decryption.sh b/test/T357-index-decryption.sh index 31991e22..c3730488 100755 --- a/test/T357-index-decryption.sh +++ b/test/T357-index-decryption.sh @@ -210,6 +210,23 @@ 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. |
