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 A45206DE138C for ; Sun, 19 May 2019 20:22:42 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.095 X-Spam-Level: X-Spam-Status: No, score=-0.095 tagged_above=-999 required=5 tests=[AWL=0.106, 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 wnBpGMTXf-44 for ; Sun, 19 May 2019 20:22:40 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id 8BE666DE0F4B for ; Sun, 19 May 2019 20:22:40 -0700 (PDT) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1558322557; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=PLQKd1vGqmxjgiykd8Gb9yJuQzBFD0ZxH/HHJYZe6E8=; b=T92DfdbwxPyHEqz9qRb16SOjYevZv9yfbDkq9TRXZJ0b800T5quMSrLT m5oC+hNG8JEDC36I61y46B3cFgbpDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1558322557; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=PLQKd1vGqmxjgiykd8Gb9yJuQzBFD0ZxH/HHJYZe6E8=; b=jQdgMwY94ZVNCjn41SomHXRhPOmGokr7JCdK1l1qLl+rboBP+UA32nUG 9HPs4l9qW4BcrFSwSOqlUbvmZ3exdnGv2zrZnJiKfkbtF1K/fRgaHzEp+9 OdQM6OeSPEAPyQ78whICKMsEtF0UYyy2EZPiqq1R9V9ZVhfiMAGB/y5pDO LAJcCAn+U+wM3qYXfmSjFgfBZGvqf6pUyhCvJ3EmVVz64zWqhMb0EQuSBC 564Hoeqbe1N4EIcgWfHLG61hWyaP2kB5SdwbJt4Q4cw7irsoYe7rUKHy7Z 46yw2DggLAN5mbFsUJcNN/BnX6KAgW6M04Si8bfzmXxcq95wGuLSHA== 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 8037AF9A0 for ; Sun, 19 May 2019 23:22:37 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id E28CC20507; Sun, 19 May 2019 23:22:33 -0400 (EDT) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH v2 2/4] cli: expose message-wide crypto status from mime-node Date: Sun, 19 May 2019 23:22:26 -0400 Message-Id: <20190520032228.27420-3-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190520032228.27420-1-dkg@fifthhorseman.net> References: <20190520032228.27420-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: Mon, 20 May 2019 03:22:42 -0000 The mime node context (a per-message context) gains a cryptographic status object, and the mime_node_t object itself can return a view on that status to an interested party. The status is not yet populated, and for now we can keep that view read-only, so that it can only be populated/modified during MIME tree traversal. --- mime-node.c | 7 +++++++ notmuch-client.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/mime-node.c b/mime-node.c index e33336bb..66ff7446 100644 --- a/mime-node.c +++ b/mime-node.c @@ -34,6 +34,7 @@ typedef struct mime_node_context { GMimeStream *stream; GMimeParser *parser; GMimeMessage *mime_message; + _notmuch_message_crypto_t *msg_crypto; /* Context provided by the caller. */ _notmuch_crypto_t *crypto; @@ -54,6 +55,12 @@ _mime_node_context_free (mime_node_context_t *res) return 0; } +const _notmuch_message_crypto_t* +mime_node_get_message_crypto_status (mime_node_t *node) +{ + return node->ctx->msg_crypto; +} + notmuch_status_t mime_node_open (const void *ctx, notmuch_message_t *message, _notmuch_crypto_t *crypto, mime_node_t **root_out) diff --git a/notmuch-client.h b/notmuch-client.h index d762d3cc..a82cb431 100644 --- a/notmuch-client.h +++ b/notmuch-client.h @@ -439,6 +439,9 @@ mime_node_child (mime_node_t *parent, int child); mime_node_t * mime_node_seek_dfs (mime_node_t *node, int n); +const _notmuch_message_crypto_t* +mime_node_get_message_crypto_status (mime_node_t *node); + typedef enum dump_formats { DUMP_FORMAT_AUTO, DUMP_FORMAT_BATCH_TAG, -- 2.20.1