From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: Notmuch Mail <notmuch@notmuchmail.org>
Subject: [PATCH 2/4] cli: expose message-wide crypto status from mime-node
Date: Wed, 24 Apr 2019 14:31:11 -0400 [thread overview]
Message-ID: <20190424183113.29242-3-dkg@fifthhorseman.net> (raw)
In-Reply-To: <20190424183113.29242-1-dkg@fifthhorseman.net>
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 1bfb479b..272d23fb 100644
--- a/mime-node.c
+++ b/mime-node.c
@@ -31,6 +31,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 6c84ecc0..3497e5b0 100644
--- a/notmuch-client.h
+++ b/notmuch-client.h
@@ -448,6 +448,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
next prev parent reply other threads:[~2019-04-24 18:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-24 18:31 Easing access to the cryptographic envelope Daniel Kahn Gillmor
2019-04-24 18:31 ` [PATCH 1/4] util/crypto: _notmuch_message_crypto: tracks message-wide crypto state Daniel Kahn Gillmor
2019-04-24 18:31 ` Daniel Kahn Gillmor [this message]
2019-04-24 18:31 ` [PATCH 3/4] mime-node: track whole-message crypto state while walking the tree Daniel Kahn Gillmor
2019-04-24 18:31 ` [PATCH 4/4] cli/show: emit new whole-message crypto status output Daniel Kahn Gillmor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190424183113.29242-3-dkg@fifthhorseman.net \
--to=dkg@fifthhorseman.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).