X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=recvattach.c;h=aaba8b82289a4efd6fe03d9769538e14d02997f7;hp=4157649e4790d00e7780e1f259e8762ad9e0492a;hb=3d937534e7b1ee723f86594b5e4c64c95158a933;hpb=bf05934822fabedece8fb66c9bbea5d392b3c5be diff --git a/recvattach.c b/recvattach.c index 4157649..aaba8b8 100644 --- a/recvattach.c +++ b/recvattach.c @@ -419,7 +419,7 @@ static int mutt_query_save_attachment (FILE *fp, BODY *body, HEADER *hdr, char * prompt = _("Save to file: "); while (prompt) { - ret = mutt_get_field (_("Save to file ('.' for last used folder): ") + ret = mutt_get_field_att (_("Save to file ('.' for last used folder): ") , buf, sizeof (buf), M_FILE | M_CLEAR); if (((ret != 0) && (ret != 2)) || (!buf[0])) return -1; @@ -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);