Closed Bug 456250 Opened 11 years ago Closed 11 years ago
Properly detect application/pkcs7-mime subtypes in libmime
Currently, libmime will feed all application/pkcs7-mime parts to mimeEncryptedCMSClass. There are certain subtypes which aren't handled properly by this class, however, and the net result is that the MIME part is not being displayed at all. For "certs-only" PKCS#7 files, this is especially unfortunate - these attachments can't be saved (since they're invisible). The attached patch adds more logic for determining whether an application/pkcs7-mime part should indeed be handed off to mimeEncryptedCMSClass, or whether it should simply be shown as an attachment (mimeExternalObjectClass/clickable link). It is based on this list from RFC 3851: MIME Type File Extension application/pkcs7-mime (SignedData, EnvelopedData) .p7m application/pkcs7-mime (degenerate SignedData .p7c certificate management message) application/pkcs7-mime (CompressedData) .p7z
In current versions of Thunderbird/Seamonkey, the "cert.p7c" attachment is invisible, unfortunately (i.e., can't be saved).
Comment on attachment 339641 [details] [diff] [review] Proposed patch thx for doing this. + char *ct = (hdrs ? MimeHeaders_get(hdrs, HEADER_CONTENT_TYPE, + PR_FALSE, PR_FALSE) + : 0); + char *st = (ct ? MimeHeaders_get_parameter(ct, "smime-type", NULL, NULL) + : 0); + can you use nsnull instead of 0 here? + PR_FREEIF(name); + } + PR_FREEIF(st); + PR_FREEIF(ct); + These can all be PR_Free - PR_Free checks for a null arg; the difference is that PR_FREEIF nulls the pointer when its done, and we don't care about that here since they're local vars. If you'll attach a patch addressing those nits, I'll try it out and land it (probably post b1)
(In reply to comment #2) > If you'll attach a patch addressing those nits, I'll try it out and land it > (probably post b1) Here it is - apparently I was using the wrong code as a model for my patch (just look at the previous #ifdef ENABLE_SMIME block in mimei.cpp... ;-) Thanks for landing this!
Comment on attachment 339673 [details] [diff] [review] Patch v2, addressing review comments thx for the patch. I'll try to land this for b1
fix checked in, changeset: 414:bf5ecaf12416, thx, Kaspar.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.