]> granicus.if.org Git - neomutt/commit
Handle malformed ms-exchange pgp-encrypted block. (closes #3742)
authorKevin McCarthy <kevin@8t8.us>
Sun, 26 Jul 2015 21:48:53 +0000 (14:48 -0700)
committerKevin McCarthy <kevin@8t8.us>
Sun, 26 Jul 2015 21:48:53 +0000 (14:48 -0700)
commit8c279adb494487f821412d65b4d5fd63cff2a31d
tree2249ed73b6f64f66fc2aaaafdd33881edc00b7a4
parent1e09ae3e434281700ba0c04323a0aeb487f13d20
Handle malformed ms-exchange pgp-encrypted block. (closes #3742)

In certain circumstances, Exchange corrupts a multipart/encrypted block
into:
  <multipart/mixed>
    <text/plain>
    <application/pgp-encrypted> [BASE64-encoded]
    <application/octet-stream> [BASE64-encoded]

This patch pulls the full detection of valid/invalid multiparts
into mutt_body_handler().  It extracts a run_decode_and_handler()
function, which is reused by new intermediate handlers to decode
the application/octet-stream part before passing it directly to
crypt_pgp_encrypted_handler.  These intermediate handlers then check
and set any GOODSIG flags back into the parent part.

This change may result in less error messages for invalid
multipart/encrypted parts.  Instead, mutt will default to the
multipart_handler if it isn't fully "correct".

Viewing attachments uses crypt_pgp_decrypt_mime() which bypasses the
handler mechanism.  Add decoding to the decrypt_mime() functions for pgp
and gpgme.

Thanks to Vincent Brillault for his analysis and initial patch.
crypt-gpgme.c
crypt.c
handler.c
mutt_crypt.h
pgp.c
recvattach.c