From ea14dcbc90372f18466d79f277c4ae6885b7df4b Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 18 Jan 2015 09:02:47 +0100 Subject: [PATCH] [Patch v4 5/5] test: add broken test for SMIME decryption with notmuch CLI --- 79/fb1f3e79bbac27ae201a61f887106bfd647b30 | 102 ++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 79/fb1f3e79bbac27ae201a61f887106bfd647b30 diff --git a/79/fb1f3e79bbac27ae201a61f887106bfd647b30 b/79/fb1f3e79bbac27ae201a61f887106bfd647b30 new file mode 100644 index 000000000..ca30bdb24 --- /dev/null +++ b/79/fb1f3e79bbac27ae201a61f887106bfd647b30 @@ -0,0 +1,102 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id D87D6429E26 + for ; Sun, 18 Jan 2015 00:03:44 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.438 +X-Spam-Level: ** +X-Spam-Status: No, score=2.438 tagged_above=-999 required=5 + tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id iiSv6PDHxqdn for ; + Sun, 18 Jan 2015 00:03:44 -0800 (PST) +Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 7EB8B431FC7 + for ; Sun, 18 Jan 2015 00:03:27 -0800 (PST) +Received: from remotemail by yantan.tethera.net with local (Exim 4.80) + (envelope-from ) + id 1YCkpT-0004rF-3q; Sun, 18 Jan 2015 04:03:27 -0400 +Received: (nullmailer pid 18929 invoked by uid 1000); Sun, 18 Jan 2015 + 08:02:54 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [Patch v4 5/5] test: add broken test for SMIME decryption with + notmuch CLI +Date: Sun, 18 Jan 2015 09:02:47 +0100 +Message-Id: <1421568167-18683-6-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.1.4 +In-Reply-To: <1421568167-18683-1-git-send-email-david@tethera.net> +References: <1421568167-18683-1-git-send-email-david@tethera.net> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 18 Jan 2015 08:03:45 -0000 + +The test JSON here is not correct, but the larger problem is thatit seems like no actual decryption is being done. +--- + test/T355-smime.sh | 36 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 36 insertions(+) + +diff --git a/test/T355-smime.sh b/test/T355-smime.sh +index caedf5e..95dbf8f 100755 +--- a/test/T355-smime.sh ++++ b/test/T355-smime.sh +@@ -99,4 +99,40 @@ Verification successful + EOF + test_expect_equal_file OUTPUT EXPECTED + ++test_begin_subtest "Decryption and signature verification (notmuch CLI)" ++test_subtest_known_broken ++output=$(notmuch show --format=json --decrypt subject:"test encrypted message 001" \ ++ | notmuch_json_show_sanitize \ ++ | sed -e 's|"created": [1234567890]*|"created": 946728000|' \ ++ -e 's|"expires": [1234567890]*|"expires": 424242424|' ) ++expected='[[[{"id": "XXXXX", ++ "match": true, ++ "excluded": false, ++ "filename": "YYYYY", ++ "timestamp": 946728000, ++ "date_relative": "2000-01-01", ++ "tags": ["inbox","signed"], ++ "headers": {"Subject": "test encrypted message 001", ++ "From": "Notmuch Test Suite ", ++ "To": "test_suite@notmuchmail.org", ++ "Date": "Sat, 01 Jan 2000 12:00:00 +0000"}, ++ "body": [{"id": 1, ++ "sigstatus": [{"status": "good", ++ "fingerprint": "'$FINGERPRINT'", ++ "expires": 424242424, ++ "created": 946728000}], ++ "content-type": "multipart/signed", ++ "content": [{"id": 2, ++ "content-type": "text/plain", ++ "content": "This is a test encrypted message.\n"}, ++ {"id": 3, ++ "content-length": 1930, ++ "content-transfer-encoding": "base64", ++ "content-type": "application/x-pkcs7-signature", ++ "filename": "smime.p7s"}]}]}, ++ []]]]' ++test_expect_equal_json \ ++ "$output" \ ++ "$expected" ++ + test_done +-- +2.1.4 + -- 2.26.2