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 A2AE76DE146B for ; Sun, 26 May 2019 15:16:29 -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 T3joGb1P87zy for ; Sun, 26 May 2019 15:16:27 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id 734BB6DE13F3 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=YJDkcNT5Q4xxO16joN87RTi4pylwTPUNmn/zp0zkDUA=; b=2hhOAhvEats2TXxt+nnTaP3qMgGe5LT2Yhe2OwjHXXjWc3OAwrBE5DoO zAgMHI6w0XEgU5w3SDZ82AA5rF08AQ== 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=YJDkcNT5Q4xxO16joN87RTi4pylwTPUNmn/zp0zkDUA=; b=xOmaIsSBm60NLIJNynFyH7+tdKkjFi5LQaXMO0RcinoHGsG5Li1thYYz HA3ELeoBPA4FstyZbSBIOTxwlFyEU3EvkKdKZItVOG5v9AA+dNIYcZ+/zf z9D0+lS4ZMjW/l7pY/MFdzHXuysTxTE8bvU+UkeckaPQLyxyJBcowQ+4QU I6CLZTCFoQTwzSydd+j/axP1AFGOrby/wEYpx+LKyx0h352TsANdvyRUrV c0hdaVpKhMV/drdjeG7kiGsqn9Xh30kNTri6McoJ/+K/3VwWWir6YRaMbo fZ03mCJr+07b0b61eNwz6QvLUMewEiOidR+IPQ/4sy7NxBO8yOGNbw== 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 7391AF9A9 for ; Sun, 26 May 2019 18:16:18 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 8421921320; Sun, 26 May 2019 18:16:14 -0400 (EDT) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH v2 13/17] test: try indexing nested messages and protected headers Date: Sun, 26 May 2019 18:16:06 -0400 Message-Id: <20190526221610.2833-14-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:29 -0000 We want to make sure that internally-forwarded messages don't end up "bubbling up" when they aren't actually the cryptographic payload. Signed-off-by: Daniel Kahn Gillmor --- test/T356-protected-headers.sh | 6 ++++ ...pted-message-with-forwarded-attachment.eml | 33 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 test/corpora/protected-headers/encrypted-message-with-forwarded-attachment.eml diff --git a/test/T356-protected-headers.sh b/test/T356-protected-headers.sh index 0c562c18..cbed3781 100755 --- a/test/T356-protected-headers.sh +++ b/test/T356-protected-headers.sh @@ -99,6 +99,12 @@ output=$(notmuch search --format=json 'id:protected-header@crypto.notmuchmail.or test_json_nodes <<<"$output" \ 'subject:[0]["subject"]="This is a protected header"' +test_begin_subtest "verify correct protected header when submessage exists" +output=$(notmuch show --decrypt=true --format=json id:encrypted-message-with-forwarded-attachment@crypto.notmuchmail.org) +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 the cryptographic envelope subject"' + test_begin_subtest "verify protected header is both signed and encrypted" output=$(notmuch show --decrypt=true --format=json id:encrypted-signed@crypto.notmuchmail.org) test_json_nodes <<<"$output" \ diff --git a/test/corpora/protected-headers/encrypted-message-with-forwarded-attachment.eml b/test/corpora/protected-headers/encrypted-message-with-forwarded-attachment.eml new file mode 100644 index 00000000..eea66a94 --- /dev/null +++ b/test/corpora/protected-headers/encrypted-message-with-forwarded-attachment.eml @@ -0,0 +1,33 @@ +From: test_suite@notmuchmail.org +To: test_suite@notmuchmail.org +Date: Sat, 01 Jan 2000 12:00:00 +0000 +Message-ID: +Subject: Subject Unavailable +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----- + +hIwDxE023q1UqxYBBAC9RgjF0vsqVqHMB8fauhazs2XoTMKkANrDS6ECANm0wcvO +tU1huRepG8ezoow/OgZ0Yd9y/zw6w+Frrx1PhVEr01lQsUdRq7INq2FRia015Q6Q +eOgSv9Q8wg4Vcy9XD1wI2Un71nDvbNwqx+hiR9m8vhiWfXH1MvxVQUWcUocUMtLA +uAEB+fx5ag3Qr42VAgyymvNrHJKtuhdj7CvdT/a5oVbZV7ilflFlYms7Wq0jSex+ +Jrb+/CnNLow4LehrOpf+IfgPumo0nBbseB17rAM9vtjNy+tHEqPsB0YFIpVR9FOp +zJITbWeFyGbOd5vMk9xbEFbw58JR8PPqsYJK41RleU2QoPEO69hoV0tXzjby5JQZ +2G/SrH+m9tggi3rWxHx9XuNKJP4iK9wZnO4k5DFaUXq6PGCYkgDi/K1RuUcJjcv7 +ob6Yp/cTLxHMmIS9VNNjUnnoaD71ndzYsZoaI6MTMX7/4eu5roeE3887NU5af/wS +ep6POG8WFJzKwc4dvAPd0NBVojdrftJkYKONsYL5KN8TY8SqUPxiXReGwg2evQqb +aGEU02zdRGYtmNSneGl20dJ39cHoW7B66ek9OQkgilSHQq4adPleq07r3HSv87jk +xNYoQ7xH2fahqbosW8N5uI9L2sdGVmTBNZgejiNyZoUn47tFEt4Uocg= +=/ZB1 +-----END PGP MESSAGE----- +--=-=-=-- -- 2.20.1