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 963F06DE1326 for ; Sun, 26 May 2019 15:16:25 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.177 X-Spam-Level: X-Spam-Status: No, score=-0.177 tagged_above=-999 required=5 tests=[AWL=0.024, 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 4xdLCYLGmV3Q for ; Sun, 26 May 2019 15:16:24 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id 3EC9D6DE13BA for ; Sun, 26 May 2019 15:16: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=1558908978; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=PusN/0DiLaBBnM3d3l1U0wqzh+jZdDZL2unnyYrXgxI=; b=EqhJHkJ8JDtu9YSIpxndV8j00KKlHEr8x9Jxu6D9JqdrQei/l0cxdcXI uhbc6yYRwnPI/J5ZVHPD6+KY2PuaBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1558908978; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=PusN/0DiLaBBnM3d3l1U0wqzh+jZdDZL2unnyYrXgxI=; b=ZhxfbCVbauosoLMCQfX8lIVnDtK0EafdiqrVz5n36M3VEQ1cR1UO4/KF zbN72ZeOjMQ58OWu0r+jyGXf1FJ2oGxVbnHWpmIi5KUMYXrokEtBPYTipC CT2e0/O0DTYnycOjOI8hB5kDQAfLwIlhHo6dwMNAWwSMmNdcYOFTUJE5VS uKtYEB+48SdE0S4o0EgoDXR7b3nhOFDit3IV7jq0Id0aHnT8Pzb/vU/2PL h8U4A+AjXF/ry04KTT0Cu4EDY4b9lTKvP3csXJAPa7HoB3jKTH5gKzbuDD F9WlDsEvYqh0QmbTjO8579+/ZJ7P/OUzUNIJbwbZHdmTuiQBDhZcgQ== Received: from fifthhorseman.net (cpe-74-71-53-242.nyc.res.rr.com [74.71.53.242]) (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 084A0F9A5 for ; Sun, 26 May 2019 18:16:17 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 6764C21005; Sun, 26 May 2019 18:16:14 -0400 (EDT) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH v2 08/17] test: show cryptographic envelope information for signed mails Date: Sun, 26 May 2019 18:16:01 -0400 Message-Id: <20190526221610.2833-9-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190526221610.2833-1-dkg@fifthhorseman.net> References: <20190526221610.2833-1-dkg@fifthhorseman.net> 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: Sun, 26 May 2019 22:16:25 -0000 Make sure that we emit the correct cryptographic envelope status for cleartext signed messages. Signed-off-by: Daniel Kahn Gillmor --- test/T356-protected-headers.sh | 11 ++++++- .../signed-protected-header.eml | 29 +++++++++++++++++++ .../protected-headers/simple-signed-mail.eml | 28 ++++++++++++++++++ 3 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 test/corpora/protected-headers/signed-protected-header.eml create mode 100644 test/corpora/protected-headers/simple-signed-mail.eml diff --git a/test/T356-protected-headers.sh b/test/T356-protected-headers.sh index 59ab58d7..62d7e210 100755 --- a/test/T356-protected-headers.sh +++ b/test/T356-protected-headers.sh @@ -2,7 +2,6 @@ # TODO: # * check S/MIME as well as PGP/MIME -# * process headers protected by signature test_description='Message decryption with protected headers' . $(dirname "$0")/test-lib.sh || exit 1 @@ -67,4 +66,14 @@ test_json_nodes <<<"$output" \ 'crypto:[0][0][0]["crypto"]={"decrypted": {"status": "full", "header-mask": {"Subject": "Subject Unavailable"}}}' \ 'subject:[0][0][0]["headers"]["Subject"]="This is a message using draft-melnikov-smime-header-signing"' +test_begin_subtest "show cryptographic envelope on signed mail" +output=$(notmuch show --verify --format=json id:simple-signed-mail@crypto.notmuchmail.org) +test_json_nodes <<<"$output" \ + 'crypto:[0][0][0]["crypto"]={"signed": {"status": [{"created": 1525609971, "fingerprint": "'$FINGERPRINT'", "userid": "'"$SELF_USERID"'", "status": "good"}]}}' + +test_begin_subtest "verify signed protected header" +output=$(notmuch show --verify --format=json id:signed-protected-header@crypto.notmuchmail.org) +test_json_nodes <<<"$output" \ + 'crypto:[0][0][0]["crypto"]={"signed": {"status": [{"created": 1525350527, "fingerprint": "'$FINGERPRINT'", "userid": "'"$SELF_USERID"'", "status": "good"}], "headers": ["Subject"]}}' + test_done diff --git a/test/corpora/protected-headers/signed-protected-header.eml b/test/corpora/protected-headers/signed-protected-header.eml new file mode 100644 index 00000000..c3a21b85 --- /dev/null +++ b/test/corpora/protected-headers/signed-protected-header.eml @@ -0,0 +1,29 @@ +From: test_suite@notmuchmail.org +To: test_suite@notmuchmail.org +Subject: This is a signed message +Date: Sat, 01 Jan 2000 12:00:00 +0000 +Message-ID: +MIME-Version: 1.0 +Content-Type: multipart/signed; boundary="=-=-="; + protocol="application/pgp-signature"; + micalg=pgp-sha512 + +--=-=-= +Content-Type: text/plain; protected-headers="v1" +Subject: This is a signed message + +Here is the signed message body. + +--=-=-= +Content-Disposition: attachment; filename=signature.asc +Content-Type: application/pgp-signature + +-----BEGIN PGP SIGNATURE----- + +iLMEAQEKAB0WIQRa6rEfXjPc6HXdt1ttkmEtlORjgQUCWusAfwAKCRBtkmEtlORj +geIJA/0WcyxlwDfXRMbiGE/crLBYhLpXK6ZMzjEn6HQDntMIk3Kr61rAwL8edKGx +gbxr1+XlMYRt+PJDhi8iI0odDI1YjiBjjc0bXUoDn60UcjL2MPGshI3426CA7cqB +cMaoRHajfdxYjSzzfh8duVgi0vmUnsyoePBhANRbDIVmCQS11g== +=c4cq +-----END PGP SIGNATURE----- +--=-=-=-- diff --git a/test/corpora/protected-headers/simple-signed-mail.eml b/test/corpora/protected-headers/simple-signed-mail.eml new file mode 100644 index 00000000..ebf4b786 --- /dev/null +++ b/test/corpora/protected-headers/simple-signed-mail.eml @@ -0,0 +1,28 @@ +From: test_suite@notmuchmail.org +To: test_suite@notmuchmail.org +Subject: This is a signed message +Date: Sat, 01 Jan 2000 12:00:00 +0000 +Message-ID: +MIME-Version: 1.0 +Content-Type: multipart/signed; boundary="=-=-="; + protocol="application/pgp-signature"; + micalg=pgp-sha512 + +--=-=-= +Content-Type: text/plain + +Here is the signed message body. + +--=-=-= +Content-Disposition: attachment; filename=signature.asc +Content-Type: application/pgp-signature + +-----BEGIN PGP SIGNATURE----- + +iLMEAQEKAB0WIQRa6rEfXjPc6HXdt1ttkmEtlORjgQUCWu718wAKCRBtkmEtlORj +gUXaA/4/m6CPRgC9JODRKRWo3Szi5D3zg7uf29DIJu9m2vVRw5o0ZeHcxLb26UPe +qdjPq6GBclkXdeTH9Nv2TW5cToJmMA9UvESeRRzbe6ytvswNEYdSbiYAsv/k9t6K +KQO2ZSbsbVlkh8xVYC3ORiUS775YrPxVT6QlPkMKAXw3l3Zwcg== +=jnDO +-----END PGP SIGNATURE----- +--=-=-=-- -- 2.20.1