From: Jameson Graef Rollins <jrollins@finestructure.net>
To: notmuch@notmuchmail.org
Subject: [PATCH] emacs: new crypto customization variable to control stashing of encryption session keys
Date: Tue, 19 Jun 2018 08:20:12 -0700 [thread overview]
Message-ID: <20180619152012.29128-1-jrollins@finestructure.net> (raw)
In-Reply-To: <20180618003138.2894-1-jrollins@finestructure.net>
Introduce notmuch-show-store-session-keys customization variable to
control stashing of session keys. If non-nil any session keys
recovered during decryption will be stored in the database.
This is just a switch to have --decrypt= use "stash" instead of
"true".
---
Gah forgot to update the commit message. Sorry.
emacs/notmuch-crypto.el | 15 +++++++++++++++
emacs/notmuch-query.el | 4 +++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index fc2b5301..26ce19b4 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -43,6 +43,21 @@ mode."
:package-version '(notmuch . "0.25")
:group 'notmuch-crypto)
+(defcustom notmuch-show-stash-session-keys nil
+ "Should session keys be stashed when decrypting messages for display?
+
+If this variable is non-nil session keys recovered while
+decrypting messages for display will be stored in the database.
+See description of --decrypt option in notmuch-show(1) for more
+information.
+
+NOTE: Stashing encryption session keys requires opening the
+notmuch database in read/write mode, which is not normally done
+when retrieving messages for display."
+ :type 'boolean
+ :package-version '(notmuch . "0.28")
+ :group 'notmuch-crypto)
+
(defface notmuch-crypto-part-header
'((((class color)
(background dark))
diff --git a/emacs/notmuch-query.el b/emacs/notmuch-query.el
index 563e4acf..e53c9489 100644
--- a/emacs/notmuch-query.el
+++ b/emacs/notmuch-query.el
@@ -32,7 +32,9 @@ is a possibly empty forest of replies.
"
(let ((args '("show" "--format=sexp" "--format-version=4")))
(if notmuch-show-process-crypto
- (setq args (append args '("--decrypt=true"))))
+ (if notmuch-show-stash-session-keys
+ (setq args (append args '("--decrypt=stash")))
+ (setq args (append args '("--decrypt=true")))))
(setq args (append args search-terms))
(apply #'notmuch-call-notmuch-sexp args)))
--
2.17.1
next prev parent reply other threads:[~2018-06-19 15:20 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-11 23:09 [PATCH] emacs: use new show --decrypt=stash feature in emacs UI Jameson Graef Rollins
2018-06-12 1:33 ` Jameson Graef Rollins
2018-06-12 14:00 ` Daniel Kahn Gillmor
2018-06-12 22:58 ` Daniel Kahn Gillmor
2018-06-13 6:07 ` Jameson Graef Rollins
2018-06-13 15:23 ` Daniel Kahn Gillmor
2018-06-13 16:25 ` David Bremner
2018-06-13 17:04 ` Daniel Kahn Gillmor
2018-06-13 18:15 ` Jameson Graef Rollins
2018-06-18 0:31 ` [PATCH] emacs: new crypto customization variable to control stashing of encryption session keys Jameson Graef Rollins
2018-06-18 22:19 ` Daniel Kahn Gillmor
2018-06-18 22:49 ` Jameson Graef Rollins
2018-06-19 3:06 ` Daniel Kahn Gillmor
2018-06-19 3:26 ` Jameson Graef Rollins
2018-06-19 10:14 ` David Bremner
2018-06-19 14:46 ` Jameson Graef Rollins
2018-06-19 15:18 ` Jameson Graef Rollins
2018-06-19 15:20 ` Jameson Graef Rollins [this message]
2018-06-19 16:42 ` Daniel Kahn Gillmor
2018-06-19 20:18 ` Jameson Graef Rollins
2018-06-19 17:50 ` Jameson Graef Rollins
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=20180619152012.29128-1-jrollins@finestructure.net \
--to=jrollins@finestructure.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).