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>,