Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit ec1c46b4 authored by Martin Koller's avatar Martin Koller

Detect also application/x-pkcs7-mime as encryption content type

REVIEW: 122222
parent 115ffc4d
......@@ -934,6 +934,7 @@ static bool isCryptoPart( Content* content )
( lowerSubType == "pgp-encrypted" ||
lowerSubType == "pgp-signature" ||
lowerSubType == "pkcs7-mime" ||
lowerSubType == "x-pkcs7-mime" ||
lowerSubType == "pkcs7-signature" ||
lowerSubType == "x-pkcs7-signature" ||
( lowerSubType == "octet-stream" &&
......@@ -1004,9 +1005,11 @@ bool isEncrypted( Message *message )
if ( contentType->isSubtype( "encrypted" ) ||
contentType->isSubtype( "pgp-encrypted" ) ||
contentType->isSubtype( "pkcs7-mime" ) ||
contentType->isSubtype( "x-pkcs7-mime" ) ||
message->mainBodyPart( "multipart/encrypted" ) ||
message->mainBodyPart( "application/pgp-encrypted" ) ||
message->mainBodyPart( "application/pkcs7-mime" ) ) {
message->mainBodyPart( "application/pkcs7-mime" ) ||
message->mainBodyPart( "application/x-pkcs7-mime" ) ) {
return true;
}
......
......@@ -585,6 +585,16 @@ void MessageTest::testOutlookAttachmentNaming()
KMime::setUseOutlookAttachmentEncoding( false );
}
void MessageTest::testEncryptedMails()
{
KMime::Message::Ptr msg = readAndParseMail("x-pkcs7.mbox");
QVERIFY(msg->attachments().count() == 1);
QVERIFY(KMime::isEncrypted(msg.get()) == true);
QVERIFY(KMime::isInvitation(msg.get()) == false);
QVERIFY(KMime::isSigned(msg.get()) == false);
}
KMime::Message::Ptr MessageTest::readAndParseMail( const QString &mailFile ) const
{
QFile file( TEST_DATA_DIR"/mails/" + mailFile );
......
......@@ -45,6 +45,7 @@ class MessageTest : public QObject
void testBug223509();
void testEncapsulatedMessages();
void testOutlookAttachmentNaming();
void testEncryptedMails();
private:
KMime::Message::Ptr readAndParseMail( const QString &mailFile ) const;
......
From test.test@test.com Mon Jan 19 15:46:51 2015
From: "Test, Test" <test.test@test.com>
To: "Koller, Martin" <martin.koller@test.at>
Subject: Test
Date: Mon, 19 Jan 2015 15:46:51 +0000
Accept-Language: de-AT, en-US
Content-Language: en-US
Content-Type: application/x-pkcs7-mime; smime-type=enveloped-data;
name="smime.p7m"
Content-Disposition: attachment; filename="smime.p7m"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
DUMMY
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment