From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 6DnwFe4xq170RQAA0tVLHw (envelope-from ) for ; Thu, 30 Apr 2020 20:15:42 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id oDx4Cvcxq15vKgAA1q6Kng (envelope-from ) for ; Thu, 30 Apr 2020 20:15:51 +0000 Received: from arlo.cworth.org (arlo.cworth.org [50.126.95.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 578A79432F9 for ; Thu, 30 Apr 2020 20:15:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 278DB6DE13F8; Thu, 30 Apr 2020 13:15:12 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org 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 ePqVh6Rb2KVg; Thu, 30 Apr 2020 13:15:11 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id B488C6DE1456; Thu, 30 Apr 2020 13:15:10 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 182096DE13BE for ; Thu, 30 Apr 2020 13:15:08 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org 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 cKhtGWDvCMqr for ; Thu, 30 Apr 2020 13:15:06 -0700 (PDT) Received: from che.mayfirst.org (unknown [162.247.75.117]) by arlo.cworth.org (Postfix) with ESMTPS id 1B8496DE1457 for ; Thu, 30 Apr 2020 13:14:29 -0700 (PDT) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1588277668; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=T2aqQTJPI+P/nkA7E1Iy/7rNmbMgtp0h+vE/eJ3UaSg=; b=LjsBfi35xjR/fQ7RWioXhW2Bf7uumdsb6FMMzqnRizUWv0eNj7nl+X4SWepS5SEpg5h0t W82lZkJiubp6vRFCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1588277668; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=T2aqQTJPI+P/nkA7E1Iy/7rNmbMgtp0h+vE/eJ3UaSg=; b=X3My85EjpXItSafDjbdMtwmdz+hzoJriv2FSG1DmjCROLiWncYRCS07yrSAKcYEjCTxI4 2ehS1PyiIah5X7+9nVIltbbApFTHqdYoNQzMnMvPPBH46kaQdByFgt9Y3nC7RECVt0NuBZt BEH8ZA2xQcVL+Hg+UnnNb7cKduH38NEXHp82ZmBuDWYzO50oK2JO7KDh24e4k42+AUbqOiG lkmmuLjINT5mLWzRHz6SAktnifURD0xMo489VTrgODzA70/IxyBLyGJf8Tl2AHRVvOyUvO3 15yV1J8KgRm4N/TITpZZPEz9Y2JF2qqa7Xp9+xrB4UByLCMRsWc6RY9YzLGw== Received: from fifthhorseman.net (unknown [IPv6:2001:470:1f07:60d:f2de:f1ff:fec3:d109]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id 324B7F9A5 for ; Thu, 30 Apr 2020 16:14:28 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 2CAAC203A9; Thu, 30 Apr 2020 16:13:35 -0400 (EDT) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH 2/9] smime: Identify encrypted S/MIME parts during indexing Date: Thu, 30 Apr 2020 16:13:21 -0400 Message-Id: <20200430201328.725651-3-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200430201328.725651-1-dkg@fifthhorseman.net> References: <20200430201328.725651-1-dkg@fifthhorseman.net> MIME-Version: 1.0 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: notmuch-bounces@notmuchmail.org Sender: "notmuch" X-Scanner: scn0 X-Spam-Score: 1.09 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=fifthhorseman.net header.s=2019 header.b=LjsBfi35; dkim=fail (body hash did not verify) header.d=fifthhorseman.net header.s=2019rsa header.b=X3My85Ej; dmarc=fail reason="SPF not aligned (relaxed)" header.from=fifthhorseman.net (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 50.126.95.6 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Scan-Result: default: False [1.09 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.46702822397576]; DWL_DNSWL_BLOCKED(0.00)[50.126.95.6:from]; R_SPF_ALLOW(-0.20)[+a:c]; R_DKIM_REJECT(1.00)[fifthhorseman.net:s=2019,fifthhorseman.net:s=2019rsa]; IP_REPUTATION_HAM(0.00)[asn: 27017(-0.18), country: US(-0.00), ip: 50.126.95.6(-0.47)]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[fifthhorseman.net:-]; MX_GOOD(-0.50)[cached: notmuchmail.org]; MAILLIST(-0.20)[mailman]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:27017, ipnet:50.126.64.0/18, country:US]; FROM_NEQ_ENVFROM(0.00)[dkg@fifthhorseman.net,notmuch-bounces@notmuchmail.org]; ARC_NA(0.00)[]; URIBL_BLOCKED(0.00)[fifthhorseman.net:email,notmuchmail.org:email]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[notmuch@notmuchmail.org]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; DNSWL_BLOCKED(0.00)[50.126.95.6:from]; MID_CONTAINS_FROM(1.00)[]; RCVD_COUNT_SEVEN(0.00)[8]; FORGED_SENDER_MAILLIST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[fifthhorseman.net : SPF not aligned (relaxed),none] X-TUID: gtCNLR/7X359 We don't handle them correctly yet, but we can at least mark them as being encrypted. Signed-off-by: Daniel Kahn Gillmor --- lib/index.cc | 4 ++++ test/T355-smime.sh | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/index.cc b/lib/index.cc index bbf13dc5..f029b334 100644 --- a/lib/index.cc +++ b/lib/index.cc @@ -654,6 +654,10 @@ _index_pkcs7_part (notmuch_message_t *message, notmuch_message_add_property (message, "index.repaired", "skip-protected-headers-legacy-display"); } _index_mime_part (message, indexopts, toindex, msg_crypto); + } else if (p7type == GMIME_SECURE_MIME_TYPE_ENVELOPED_DATA) { + _notmuch_message_add_term (message, "tag", "encrypted"); + if (notmuch_indexopts_get_decrypt_policy (indexopts) != NOTMUCH_DECRYPT_FALSE) + _notmuch_database_log (notmuch, "Cannot decrypt PKCS#7 envelopedData (S/MIME encrypted messages)\n"); } else { _notmuch_database_log (notmuch, "Cannot currently handle PKCS#7 smime-type '%s'\n", g_mime_object_get_content_type_parameter (part, "smime-type")); diff --git a/test/T355-smime.sh b/test/T355-smime.sh index 01e53e33..0d78f262 100755 --- a/test/T355-smime.sh +++ b/test/T355-smime.sh @@ -98,7 +98,6 @@ test_json_nodes <<<"$output" \ 'crypto_uid:[0][0][0]["crypto"]["signed"]["status"][0]["userid"]="CN=Notmuch Test Suite"' test_begin_subtest "encrypted+signed message is known to be encrypted, but signature is unknown" -test_subtest_known_broken output=$(notmuch search subject:"test encrypted message 001") test_expect_equal "$output" "thread:0000000000000002 2000-01-01 [1/1] Notmuch Test Suite; test encrypted message 001 (encrypted inbox)" -- 2.26.2