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 82E1B6DE0236 for ; Tue, 19 Jun 2018 08:20:14 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -2.255 X-Spam-Level: X-Spam-Status: No, score=-2.255 tagged_above=-999 required=5 tests=[AWL=0.045, RCVD_IN_DNSWL_MED=-2.3] 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 NJFWTKCcgGkn for ; Tue, 19 Jun 2018 08:20:13 -0700 (PDT) Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu [131.215.239.19]) by arlo.cworth.org (Postfix) with ESMTPS id DA4426DE0230 for ; Tue, 19 Jun 2018 08:20:13 -0700 (PDT) Received: from smtp01.caltech.edu (localhost [127.0.0.1]) by smtp02.caltech.edu (Postfix) with ESMTP id A10C56C020E for ; Tue, 19 Jun 2018 08:20:13 -0700 (PDT) X-Spam-Scanned: at Caltech-IMSS on smtp01.caltech.edu by amavisd-new Received: from finestructure.net (cpe-76-91-54-61.socal.res.rr.com [76.91.54.61]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jrollins) by smtp-server.its.caltech.edu (Postfix) with ESMTPSA id 4A6B46C015F for ; Tue, 19 Jun 2018 08:20:13 -0700 (PDT) Received: by finestructure.net (Postfix, from userid 1000) id 0389661986; Tue, 19 Jun 2018 08:20:12 -0700 (PDT) From: Jameson Graef Rollins 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 Message-Id: <20180619152012.29128-1-jrollins@finestructure.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618003138.2894-1-jrollins@finestructure.net> References: <20180618003138.2894-1-jrollins@finestructure.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 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: Tue, 19 Jun 2018 15:20:14 -0000 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