X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT357-index-decryption.sh;fp=test%2FT357-index-decryption.sh;h=1ac2836a6e31e9cab1b8c37444038fc6162bce29;hp=8a2d4c0265a6f9b1c98b10b5727db1c87d02b0ce;hb=bc396c967c7cd8e7a109858e428d7bf97173f7a7;hpb=5f22d16273ef0d42fc42303087a588efeeb6d7c1 diff --git a/test/T357-index-decryption.sh b/test/T357-index-decryption.sh index 8a2d4c02..1ac2836a 100755 --- a/test/T357-index-decryption.sh +++ b/test/T357-index-decryption.sh @@ -226,6 +226,7 @@ output=$(notmuch dump | LC_ALL=C sort) expected='#= simple-encrypted@crypto.notmuchmail.org index.decryption=failure #notmuch-dump batch-tag:3 config,properties,tags +encrypted +inbox +unread -- id:basic-encrypted@crypto.notmuchmail.org ++encrypted +inbox +unread -- id:encrypted-signed@crypto.notmuchmail.org +encrypted +inbox +unread -- id:simple-encrypted@crypto.notmuchmail.org' test_expect_equal \ "$output" \ @@ -288,6 +289,24 @@ test_expect_equal \ "$output" \ "$expected" +goodsig='good_sig:[0][0][0]["crypto"]["signed"]["status"][0]["status"]="good"' +nosig='no_sig:[0][0][0]["crypto"]!"signed"' + +test_begin_subtest "verify signature without a session key stashed when --decrypt=true" +output=$(notmuch show --format=json --decrypt=true id:encrypted-signed@crypto.notmuchmail.org) +test_json_nodes <<<"$output" "$goodsig" + +test_begin_subtest "do not verify sig without a session key stashed if --decrypt=auto" +output=$(notmuch show --format=json id:encrypted-signed@crypto.notmuchmail.org) +test_json_nodes <<<"$output" "$nosig" + +test_begin_subtest "verify signature when --decrypt=stash" +output=$(notmuch show --format=json --decrypt=stash id:encrypted-signed@crypto.notmuchmail.org) +test_json_nodes <<<"$output" "$goodsig" + +test_begin_subtest "verify signature with stashed session key" +output=$(notmuch show --format=json id:encrypted-signed@crypto.notmuchmail.org) +test_json_nodes <<<"$output" "$goodsig" # TODO: test removal of a message from the message store between # indexing and reindexing.