X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=recvattach.c;h=aaba8b82289a4efd6fe03d9769538e14d02997f7;hp=db4b5fda010d89d5feb262e8fa884eac9f9c430f;hb=ad29f4688c8a43e718f4cf25ab9337459fc472de;hpb=f353d90d89bbdaa8ff3f3c619384948ec8fe9c14 diff --git a/recvattach.c b/recvattach.c index db4b5fd..aaba8b8 100644 --- a/recvattach.c +++ b/recvattach.c @@ -861,7 +861,7 @@ mutt_attach_display_loop (MUTTMENU *menu, int op, FILE *fp, HEADER *hdr, break; /* functions which are passed through from the pager */ case OP_CHECK_TRADITIONAL: - if (!(WithCrypto & APPLICATION_PGP)) + if (!(WithCrypto & APPLICATION_PGP) || (hdr && hdr->security & PGP_TRADITIONAL_CHECKED)) { op = OP_NULL; break; @@ -958,18 +958,33 @@ void mutt_view_attachments (HEADER *hdr) mx_close_message (&msg); return; } - if ((WithCrypto & APPLICATION_SMIME) && hdr->security & APPLICATION_SMIME) + if ((WithCrypto & APPLICATION_SMIME) && (hdr->security & APPLICATION_SMIME)) { if (hdr->env) crypt_smime_getkeys (hdr->env); if (mutt_is_application_smime(hdr->content)) + { secured = ! crypt_smime_decrypt_mime (msg->fp, &fp, hdr->content, &cur); + + /* S/MIME nesting */ + if ((mutt_is_application_smime (cur) & SMIMEOPAQUE)) + { + BODY *_cur = cur; + FILE *_fp = fp; + + fp = NULL; cur = NULL; + secured = !crypt_smime_decrypt_mime (_fp, &fp, _cur, &cur); + + mutt_free_body (&_cur); + safe_fclose (&_fp); + } + } else need_secured = 0; } - if ((WithCrypto & APPLICATION_PGP) && hdr->security & APPLICATION_PGP) + if ((WithCrypto & APPLICATION_PGP) && (hdr->security & APPLICATION_PGP)) { if (mutt_is_multipart_encrypted(hdr->content)) secured = !crypt_pgp_decrypt_mime (msg->fp, &fp, hdr->content, &cur);