From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 31A826DE0F17 for ; Mon, 22 Apr 2019 10:18:23 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.144 X-Spam-Level: X-Spam-Status: No, score=-0.144 tagged_above=-999 required=5 tests=[AWL=0.057, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OZZSW5DBTOdy for ; Mon, 22 Apr 2019 10:18:21 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id D1EEC6DE0EED for ; Mon, 22 Apr 2019 10:18:20 -0700 (PDT) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1555953497; h=from : to : subject : date : message-id : mime-version : content-transfer-encoding : from; bh=/htVZiDSexOar9CHI5dQydTNQLWX0Mn7Z1sc+ptJ4f0=; b=4rg4a6xsZSuuTv430tsjXDBxqJ3m5zIJXCNBQyA1vbpm4vtnCpHij5SK KxJN3mVjN6m4waAi36g86W8Qb0WPDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1555953497; h=from : to : subject : date : message-id : mime-version : content-transfer-encoding : from; bh=/htVZiDSexOar9CHI5dQydTNQLWX0Mn7Z1sc+ptJ4f0=; b=XW2Gin1JwNIJYa+uwcqcezWEpA/LdELUjygGGRTWuo8rZ3YqrCYkNi9R iJbSt6SglY8caitiWDNQXUJQLnuDfP37fqoKBaFq2MM6G4ggvuCXNy68fM TletVg5vIb3gHKLym6j7Qr1ONvtsYPwkEWoZcBo8SoBJr+XXHJyJnNU7IT 82pzgcuJW4TPPEtKsEcZ5Hv5o05g+7rTzWcjCxeEUFdZQQlIiBngEI0sOI sXPF8sCDn4sDXEK1+LHaYhvTYzX8e9aNmFPWrjRGbuisMkpdTuJd6Ys+KT qx9YRugbEk8++CApQDf5qQ+FXI9kel7w84pfTkkaDHdMsXxvBVS2Sw== Received: from fifthhorseman.net (unknown [38.109.115.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id BBAE7F99F for ; Mon, 22 Apr 2019 13:18:17 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 24EF2200EC; Mon, 22 Apr 2019 13:18:14 -0400 (EDT) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH 1/3] emacs: test notmuch-show during message decryption Date: Mon, 22 Apr 2019 13:18:12 -0400 Message-Id: <20190422171814.16480-1-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Mon, 22 Apr 2019 17:18:23 -0000 We did not have a test showing what message decryption looks like within notmuch-emacs. This change gives us a baseline for future work on the notmuch-emacs interface. --- test/T450-emacs-show.sh | 15 ++++++++++ test/corpora/crypto/basic-encrypted.eml | 28 +++++++++++++++++++ .../notmuch-show-decrypted-message | 11 ++++++++ .../notmuch-show-undecryptable-message | 10 +++++++ 4 files changed, 64 insertions(+) create mode 100644 test/corpora/crypto/basic-encrypted.eml create mode 100644 test/emacs-show.expected-output/notmuch-show-decrypted-message create mode 100644 test/emacs-show.expected-output/notmuch-show-undecryptable-message diff --git a/test/T450-emacs-show.sh b/test/T450-emacs-show.sh index 3555a939..5d4df443 100755 --- a/test/T450-emacs-show.sh +++ b/test/T450-emacs-show.sh @@ -208,4 +208,19 @@ test_emacs '(notmuch-show "id:'$gen_msg_id'") output=$(head -1 OUTPUT.raw|cut -f1-4 -d' ') test_expect_equal "$output" "Notmuch Test Suite " + +# switching to the crypto corpus, using gpg from here on: +add_gnupg_home +add_email_corpus crypto + +test_begin_subtest "show decrypted message" +test_emacs '(notmuch-show "id:basic-encrypted@crypto.notmuchmail.org") + (test-visible-output)' +test_expect_equal_file $EXPECTED/notmuch-show-decrypted-message OUTPUT + +test_begin_subtest "show undecryptable message" +test_emacs '(notmuch-show "id:simple-encrypted@crypto.notmuchmail.org") + (test-visible-output)' +test_expect_equal_file $EXPECTED/notmuch-show-undecryptable-message OUTPUT + test_done diff --git a/test/corpora/crypto/basic-encrypted.eml b/test/corpora/crypto/basic-encrypted.eml new file mode 100644 index 00000000..1ba4698a --- /dev/null +++ b/test/corpora/crypto/basic-encrypted.eml @@ -0,0 +1,28 @@ +From: test_suite@notmuchmail.org +To: test_suite@notmuchmail.org +Subject: Here is the password +Date: Sat, 01 Jan 2000 12:00:00 +0000 +Message-ID: +MIME-Version: 1.0 +Content-Type: multipart/encrypted; boundary="=-=-="; + protocol="application/pgp-encrypted" + +--=-=-= +Content-Type: application/pgp-encrypted + +Version: 1 + +--=-=-= +Content-Type: application/octet-stream + +-----BEGIN PGP MESSAGE----- + +hIwDxE023q1UqxYBBACp70e7KPy9OYaheIrkLzmhq1lRqmy51aL1jBL0K/qN7rfK +BZEG1cR8jeLjTFdPKPLVKJI80r7FgKI0ywvWvl6R1aE1Ty5BnVXT9XzCrEH7fqCl +SKK82EvolXTohAZHUrh6K66eQQTTIAC1n7B0A8hErzkgaM4+seN3LlvezT6TLNKM +ATpqsEbM2MVrGgw0b3oUsGGAPEt2MmjNEYsriKnqwt6dJDZc//XyhjgMQayiD8da +N1gT3oqgu/gKCpBZDYzHf9OtVi2UnlFDWy6rrMZLjWDnIv4ve9Pn/qolwHVjzdJ1 +ZfjNC5t0z3XADKGrjN9wutr4qm7STW1rHAXHP68TQTxI0qgJKjPXNKWEw6g= +=pJG4 +-----END PGP MESSAGE----- +--=-=-=-- diff --git a/test/emacs-show.expected-output/notmuch-show-decrypted-message b/test/emacs-show.expected-output/notmuch-show-decrypted-message new file mode 100644 index 00000000..08a9e4f6 --- /dev/null +++ b/test/emacs-show.expected-output/notmuch-show-decrypted-message @@ -0,0 +1,11 @@ +test_suite@notmuchmail.org (2000-01-01) (encrypted inbox) +Subject: Here is the password +To: test_suite@notmuchmail.org +Date: Sat, 01 Jan 2000 12:00:00 +0000 + +[ multipart/encrypted ] +[ Decryption successful ] +[ Unknown signature status ] +[ application/pgp-encrypted ] +[ text/plain ] +The password is "abcd1234!", please do not tell anyone. diff --git a/test/emacs-show.expected-output/notmuch-show-undecryptable-message b/test/emacs-show.expected-output/notmuch-show-undecryptable-message new file mode 100644 index 00000000..530ff286 --- /dev/null +++ b/test/emacs-show.expected-output/notmuch-show-undecryptable-message @@ -0,0 +1,10 @@ +Daniel Kahn Gillmor (2016-12-22) (encrypted inbox) +Subject: encrypted message +To: dkg@fifthhorseman.net +Date: Thu, 22 Dec 2016 08:34:56 -0400 + +[ multipart/encrypted ] +[ Decryption error ] +[ Unknown signature status ] +[ application/pgp-encrypted ] +[ application/octet-stream ] -- 2.20.1