From 5d574ef412e1ad0474fd3918653b661e67deaec4 Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Tue, 31 Aug 2004 07:37:24 +0000 Subject: [PATCH] Remove *two* layers of S/MIME from messages before building the attachment tree. A generic solution would remove intransparent encodings all the way down the tree. --- recvattach.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/recvattach.c b/recvattach.c index 89ae956a..017927e6 100644 --- a/recvattach.c +++ b/recvattach.c @@ -913,18 +913,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); -- 2.40.0