Skip to content
  • Kevin J. McCarthy's avatar
    Handle malformed ms-exchange pgp-encrypted block. (closes #3742) · 5360d1d5
    Kevin J. McCarthy authored
    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.
    5360d1d5