diff options
author | Kevin McCarthy <kevin@8t8.us> | 2018-12-11 14:11:30 -0800 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2018-12-17 13:30:53 -0800 |
commit | cac6705aa51f281f6eba22136f6ce51490c62dff (patch) | |
tree | fda22ce1f6b238407047a5304bfc3bd58dfe8133 /pgp.c | |
parent | 09dd4a5d7b69dc688c4a7f3c07b74b66bea7315f (diff) |
Add protected header received email support.
Add $crypt_protected_headers_read config variable to enable reading
and updating the index/header cache.
Print protected Subject header in the pager as parts are rendered.
Once opened, update the index, subject hash, and header cache.
Diffstat (limited to 'pgp.c')
-rw-r--r-- | pgp.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -1132,13 +1132,37 @@ int pgp_encrypted_handler (BODY *a, STATE *s) if ((tattach = pgp_decrypt_part (a, s, fpout, a)) != NULL) { if (s->flags & MUTT_DISPLAY) + { state_attach_puts (_("[-- The following data is PGP/MIME encrypted --]\n\n"), s); + mutt_protected_headers_handler (tattach, s); + } + + /* Store any protected headers in the parent so they can be + * accessed for index updates after the handler recursion is done. + * This is done before the handler to prevent a nested encrypted + * handler from freeing the headers. */ + mutt_free_envelope (&a->mime_headers); + a->mime_headers = tattach->mime_headers; + tattach->mime_headers = NULL; + fpin = s->fpin; s->fpin = fpout; rc = mutt_body_handler (tattach, s); s->fpin = fpin; + /* Embedded multipart signed protected headers override the + * encrypted headers. We need to do this after the handler so + * they can be printed in the pager. */ + if (mutt_is_multipart_signed (tattach) && + tattach->parts && + tattach->parts->mime_headers) + { + mutt_free_envelope (&a->mime_headers); + a->mime_headers = tattach->parts->mime_headers; + tattach->parts->mime_headers = NULL; + } + /* * if a multipart/signed is the _only_ sub-part of a * multipart/encrypted, cache signature verification |