unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* notmuch show --decrypt=stash
@ 2018-01-10  0:12 Daniel Kahn Gillmor
  2018-01-10  0:12 ` [PATCH v2 1/5] lib: expose notmuch_message_get_database() Daniel Kahn Gillmor
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Daniel Kahn Gillmor @ 2018-01-10  0:12 UTC (permalink / raw)
  To: Notmuch Mail

This is a revision of the series initially introduced in
id:20171212025225.11854-1-dkg@fifthhorseman.net, with minor updates to
accomodate the recent release of notmuch 0.26 (yay!)

This series allows "notmuch show" to index the cleartext and stash the
session keys of an encrypted message while displaying it.

Background
----------

As of notmuch 0.26, cleartext indexing and session-keys make working
with encrypted e-mail significantly easier in notmuch.  However, the
underlying requirement is that at the time of message ingestion (and
"notmuch new" in particular), the user is likely to have access to
their long-term secret keys.

In practice, many people using GnuPG today have their secret keys
locked behind a passphrase, or on a smartcard, and also run "notmuch
new" in some sort of scheduled, backgrounded process.

The result is that for users with this workflow, GnuPG prompts for
their passphrase (or wants to make use of their smartcard) at
unpredictable times, depending on when their mail delivery happens,
and on how many encrypted messages they receive.  This is both
unfriendly and bad for security (we should not train users to approve
random prompts for secret key access when nothing they're doing
interactively seems to warrant it).

Outline
-------

For a friendlier experience, some users may prefer incoming encrypted
mail to stay in their inbox *without* being decrypted, until they
choose to look at it.  At the moment that they're looking at it, their
MUA is in the foreground and they're interacting with it, so being
prompted for their password or smartcard interactively makes sense at
that time.

This series makes it possible for this interaction to to actually
decrypt the message, index it, and stash any session keys the first
time the user interacts with the message through "notmuch show".

This is not a workflow that every MUA will choose to use (e.g. users
whose decryption-capable secret key is already cheaply available
without hassling the user at "notmuch new" shouldn't use it), but it
is a sensible workflow for some users that notmuch should support.

Furthermore, it is a more efficient use of secret key material -- a
user that wants to stash session keys of a message, but whose
long-term decryption secret key is on a smartcard should only be obliged
to trigger the smartcard once per message, ever.

Implementation details
----------------------

The most controversial part of this series is that it makes "notmuch
show" potentially not a read-only operation on the database.  This is
a tradeoff that the users of this workflow will need to consider,
since they are explicitly asking "notmuch show" to potentially modify
their index.

Note that i've made this R/O-to-R/W switch fairly coarse.  If the user
requests --decrypt=stash, then "notmuch show" will operate on a
read/write database, regardless of whether the message is actually
encrypted.  I used this coarse approach because i couldn't figure out
a safe way to reopen an existing read-only database in read-write
mode.  If someone more clever with Xapian than me wants to suggest a
way to do this in a more fine-grained fashion, i'd welcome patches or
pointers.  That said, if users don't like the idea of "notmuch show"
using the db read/write, they can also just not use --decrypt=stash :)

I welcome review and feedback.

  --dkg

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-05-11  7:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-10  0:12 notmuch show --decrypt=stash Daniel Kahn Gillmor
2018-01-10  0:12 ` [PATCH v2 1/5] lib: expose notmuch_message_get_database() Daniel Kahn Gillmor
2018-01-10  0:12 ` [PATCH v2 2/5] properties: add notmuch_message_count_properties Daniel Kahn Gillmor
2018-01-10  0:12 ` [PATCH v2 3/5] cli: write session keys to database, if asked to do so Daniel Kahn Gillmor
2018-05-02  1:42   ` David Bremner
2018-01-10  0:12 ` [PATCH v2 4/5] cli/show: reindex when we learned new session keys about a message Daniel Kahn Gillmor
2018-05-02  1:36   ` David Bremner
2018-05-09 18:42     ` Daniel Kahn Gillmor
2018-05-11  7:04       ` Daniel Kahn Gillmor
2018-01-10  0:12 ` [PATCH v2 5/5] cli/show: enable --decrypt=stash Daniel Kahn Gillmor
2018-05-02  1:58   ` David Bremner
2018-04-29  8:49 ` notmuch show --decrypt=stash Daniel Kahn Gillmor

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).