Skip Menu |

This queue is for tickets about the Crypt-SMIME CPAN distribution.

Report information
The Basics
Id: 53620
Status: resolved
Priority: 0/
Queue: Crypt-SMIME

People
Owner: mikage [...] ymir.co.jp
Requestors: jukka.laaksola [...] netland.fi
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Bug in isEncrypted method
Date: Tue, 12 Jan 2010 16:06:38 +0200
To: bug-Crypt-SMIME [...] rt.cpan.org
From: Jukka Laaksola <jukka.laaksola [...] netland.fi>
Hi! There is a little bug in isEncrypted method. Version 0.09 of Crypt::SMIME. line 90 of SMIME.pm: ----8<---- && ($ctype !~ m!smime-type=! || $ctype =~ m!smime-type=enveloped-data!)) { ----8<---- should be like this: ----8<---- && ($ctype !~ m!smime-type=! || $ctype =~ m!smime-type="?enveloped-data"?!)) { ----8<---- Outlook sends SMIME encrypted emails with Content-type like this: ----8<---- Content-Type: application/x-pkcs7-mime; name="smime.p7m"; smime-type=enveloped-data ----8<---- And this is recognized correctly with Crypt::SMIME::isEncrypted. But the problem exists when email has been managed by MIME modules. After that MIME::Entity::as_string returns Content-type like this: ----8<---- Content-Type: application/x-pkcs7-mime; name="smime.p7m"; smime-type="enveloped-data" ----8<---- As i can see this is valid MIME header because the value of header attribute can be surrounded with quotes. So it would be nice that Crypt::SMIME::isEncrypted could recognize this version too. Sincerely Jukka -- Jukka Laaksola Netland Oy <mailto:jukka.laaksola@netland.fi>,
From: fschlich [...] zedat.fu-berlin.de
FYI and kind consideration: the Debian package of Crypt::SMIME ships with the attached patch Florian
Subject: allow_quoted_enveloped-data.patch
--- a/lib/SMIME.pm +++ b/lib/SMIME.pm @@ -87,7 +87,7 @@ my $ctype = $this->_getContentType($mime); if($ctype =~ m!^application/(?:x-)?pkcs7-mime! - && ($ctype !~ m!smime-type=! || $ctype =~ m!smime-type=enveloped-data!)) { + && ($ctype !~ m!smime-type=! || $ctype =~ m!smime-type="?enveloped-data"?!)) { # smime-typeが存在しないか、それがenveloped-dataである。 1; } else {
From: fschlich [...] zedat.fu-berlin.de
(I recognize the "correct" patch should probably be to ./SMIME.pl, cf #56025)
Fixed in 0.11. Thank you for your report.