notmuch/util
Daniel Kahn Gillmor a990585408 crypto: use stashed session-key properties for decryption, if available
When doing any decryption, if the notmuch database knows of any
session keys associated with the message in question, try them before
defaulting to using default symmetric crypto.

This changeset does the primary work in _notmuch_crypto_decrypt, which
grows some new parameters to handle it.

The primary advantage this patch offers is a significant speedup when
rendering large encrypted threads ("notmuch show") if session keys
happen to be cached.

Additionally, it permits message composition without access to
asymmetric secret keys ("notmuch reply"); and it permits recovering a
cleartext index when reindexing after a "notmuch restore" for those
messages that already have a session key stored.

Note that we may try multiple decryptions here (e.g. if there are
multiple session keys in the database), but we will ignore and throw
away all the GMime errors except for those that come from last
decryption attempt.  Since we don't necessarily know at the time of
the decryption that this *is* the last decryption attempt, we'll ask
for the errors each time anyway.

This does nothing if no session keys are stashed in the database,
which is fine.  Actually stashing session keys in the database will
come as a subsequent patch.
2017-12-04 21:48:31 -04:00
..
crypto.c crypto: use stashed session-key properties for decryption, if available 2017-12-04 21:48:31 -04:00
crypto.h crypto: use stashed session-key properties for decryption, if available 2017-12-04 21:48:31 -04:00
error_util.c cppcheck: call va_end in _internal_error 2017-08-30 07:12:13 -03:00
error_util.h Use https instead of http where possible 2016-06-05 08:32:17 -03:00
gmime-extra.c util: make g_mime_utils_header_decode_date_unix match prototype 2017-07-17 08:47:18 -03:00
gmime-extra.h gmime-extra: drop compat layer for g_mime_multipart_encrypted_decrypt 2017-10-14 10:57:06 -03:00
hex-escape.c Use https instead of http where possible 2016-06-05 08:32:17 -03:00
hex-escape.h hex-escape: (en|de)code strings to/from restricted character set 2012-12-02 09:14:59 -04:00
Makefile xutil.c: remove duplicate copies, create new library libutil.a to contain xutil. 2011-10-30 23:09:49 -03:00
Makefile.local crypto: move into libnotmuch_util 2017-10-20 07:58:10 -03:00
string-util.c database: move striping of trailing '/' into helper function 2017-08-22 18:47:51 -03:00
string-util.h database: move striping of trailing '/' into helper function 2017-08-22 18:47:51 -03:00
talloc-extra.c util: add talloc-extra.[ch] 2012-12-30 21:12:11 -04:00
talloc-extra.h util: add talloc-extra.[ch] 2012-12-30 21:12:11 -04:00
util.c util: add gz_readline 2014-04-12 07:59:44 -03:00
util.h util: add gz_readline 2014-04-12 07:59:44 -03:00
xutil.c Use https instead of http where possible 2016-06-05 08:32:17 -03:00
xutil.h Use https instead of http where possible 2016-06-05 08:32:17 -03:00
zlib-extra.c Use https instead of http where possible 2016-06-05 08:32:17 -03:00
zlib-extra.h util: add gz_readline 2014-04-12 07:59:44 -03:00