Commit 450de463 authored by Kevin J. McCarthy's avatar Kevin J. McCarthy
Browse files

Handle improperly encoded pgp/mime octetstream part.

Some clients (or even mail servers) improperly encode the octetstream
part.

Thanks to Riccardo Schirone for the original merge request patch.
This commit also handles the attachment menu, and makes the decoding
conditional so it's not done if it isn't necessary.
parent f9a6082c
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2038,7 +2038,12 @@ int pgp_gpgme_decrypt_mime (FILE *fpin, FILE **fpout, BODY *b, BODY **cur)
  first_part->warnsig = 0;

  if (mutt_is_valid_multipart_pgp_encrypted (b))
  {
    b = b->parts->next;
    /* Some clients improperly encode the octetstream part. */
    if (b->encoding != ENC7BIT)
      need_decode = 1;
  }
  else if (mutt_is_malformed_multipart_pgp_encrypted (b))
  {
    b = b->parts->next->next;
+5 −1
Original line number Diff line number Diff line
@@ -1701,6 +1701,10 @@ static int valid_pgp_encrypted_handler (BODY *b, STATE *s)
  mutt_free_envelope (&b->mime_headers);
  mutt_free_envelope (&octetstream->mime_headers);

  /* Some clients improperly encode the octetstream part. */
  if (octetstream->encoding != ENC7BIT)
    rc = run_decode_and_handler (octetstream, s, crypt_pgp_encrypted_handler, 0);
  else
    rc = crypt_pgp_encrypted_handler (octetstream, s);
  b->goodsig |= octetstream->goodsig;

+5 −0
Original line number Diff line number Diff line
@@ -1044,7 +1044,12 @@ int pgp_decrypt_mime (FILE *fpin, FILE **fpout, BODY *b, BODY **cur)
  int rv = 0;

  if (mutt_is_valid_multipart_pgp_encrypted (b))
  {
    b = b->parts->next;
    /* Some clients improperly encode the octetstream part. */
    if (b->encoding != ENC7BIT)
      need_decode = 1;
  }
  else if (mutt_is_malformed_multipart_pgp_encrypted (b))
  {
    b = b->parts->next->next;