From 1fc9c5931bda6129d3a8fe1525b8e6bdf81e6ef3 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Sat, 2 Jan 2016 12:30:42 -0300 Subject: kdepim-15.12.0-2.nonprism1: fix decoding PGP encoded mails (FS#47551 -> https://bugs.archlinux.org/task/47551) --- nonprism/kdepim/PKGBUILD | 14 +++++++--- nonprism/kdepim/bug333611.patch | 60 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 nonprism/kdepim/bug333611.patch (limited to 'nonprism/kdepim') diff --git a/nonprism/kdepim/PKGBUILD b/nonprism/kdepim/PKGBUILD index 6244ae65d..87cb952dd 100644 --- a/nonprism/kdepim/PKGBUILD +++ b/nonprism/kdepim/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 256270 2015-12-16 07:08:40Z arojas $ +# $Id: PKGBUILD 257437 2016-01-01 20:47:24Z arojas $ # Maintainer (Arch): Felix Yan # Contributor (Arch): Andrea Scarpino # Contributor (Arch): Pierre Schmitz @@ -7,18 +7,24 @@ pkgbase=kdepim pkgname=(akonadiconsole kaddressbook kmail knotes korganizer libkdepim) pkgver=15.12.0 -pkgrel=1.nonprism1 +pkgrel=2.nonprism1 arch=('i686' 'x86_64') url='http://pim.kde.org' license=('GPL' 'LGPL' 'FDL') groups=('kde-applications' 'kdepim') makedepends=(extra-cmake-modules kdepim-runtime qt5-tools kdoctools knewstuff khtml ktexteditor kdnssd kldap libktnef kontactinterface kxmlrpcclient kblog akonadi-search boost) -source=("http://download.kde.org/stable/applications/$pkgver/src/$pkgbase-$pkgver.tar.xz") -sha1sums=('7308191135cf17fc7fa44014b9f016222a8341d4') +source=("http://download.kde.org/stable/applications/$pkgver/src/$pkgbase-$pkgver.tar.xz" + bug333611.patch::"https://quickgit.kde.org/?p=kdepim.git&a=blobdiff&h=1988dc&hp=11921d&f=messageviewer%2Fsrc%2Fviewer%2Fobjecttreeparser.cpp&o=plain") +sha1sums=('7308191135cf17fc7fa44014b9f016222a8341d4' + '10cc13a4a03b8ee496dfa89f8373db085cc951c6') prepare() { mkdir -p build + + # Fix decoding PGP encoded packages https://bugs.kde.org/show_bug.cgi?id=333611 + cd $pkgbase-$pkgver + patch -p1 -i ../bug333611.patch } build() { diff --git a/nonprism/kdepim/bug333611.patch b/nonprism/kdepim/bug333611.patch new file mode 100644 index 000000000..44befd8d0 --- /dev/null +++ b/nonprism/kdepim/bug333611.patch @@ -0,0 +1,60 @@ +--- a/messageviewer/src/viewer/objecttreeparser.cpp ++++ b/messageviewer/src/viewer/objecttreeparser.cpp +@@ -696,29 +696,36 @@ + signatureFound = verifyResult.signatures().size() > 0; + signatures = verifyResult.signatures(); + bDecryptionOk = !decryptResult.error(); +- passphraseError = decryptResult.error().isCanceled() +- || decryptResult.error().code() == GPG_ERR_NO_SECKEY; +- actuallyEncrypted = decryptResult.error().code() != GPG_ERR_NO_DATA; +- partMetaData.errorText = QString::fromLocal8Bit(decryptResult.error().asString()); + partMetaData.auditLogError = m->auditLogError(); + partMetaData.auditLog = m->auditLogAsHtml(); +- partMetaData.isEncrypted = actuallyEncrypted; +- if (actuallyEncrypted && decryptResult.numRecipients() > 0) { +- partMetaData.keyId = decryptResult.recipient(0).keyID(); +- } +- +- qCDebug(MESSAGEVIEWER_LOG) << "ObjectTreeParser::decryptMIME: returned from CRYPTPLUG"; +- if (bDecryptionOk) { ++ if (!bDecryptionOk && signatureFound) { ++ //Only a signed part ++ actuallyEncrypted = false; ++ bDecryptionOk = true; + decryptedData = plainText; +- } else if (htmlWriter() && showWarning) { +- decryptedData = "
" +- + errorMsg.toUtf8() +- + "
"; +- if (!passphraseError) +- partMetaData.errorText = i18n("Crypto plug-in \"%1\" could not decrypt the data.", cryptPlugLibName) +- + QLatin1String("
") +- + i18n("Error: %1", partMetaData.errorText); ++ } else { ++ passphraseError = decryptResult.error().isCanceled() ++ || decryptResult.error().code() == GPG_ERR_NO_SECKEY; ++ actuallyEncrypted = decryptResult.error().code() != GPG_ERR_NO_DATA; ++ partMetaData.errorText = QString::fromLocal8Bit(decryptResult.error().asString()); ++ partMetaData.isEncrypted = actuallyEncrypted; ++ if (actuallyEncrypted && decryptResult.numRecipients() > 0) { ++ partMetaData.keyId = decryptResult.recipient(0).keyID(); ++ } ++ ++ qCDebug(MESSAGEVIEWER_LOG) << "ObjectTreeParser::decryptMIME: returned from CRYPTPLUG"; ++ if (bDecryptionOk) { ++ decryptedData = plainText; ++ } else if (htmlWriter() && showWarning) { ++ decryptedData = "
" ++ + errorMsg.toUtf8() ++ + "
"; ++ if (!passphraseError) { ++ partMetaData.errorText = i18n("Crypto plug-in \"%1\" could not decrypt the data.", cryptPlugLibName) ++ + QLatin1String("
") ++ + i18n("Error: %1", partMetaData.errorText); ++ } ++ } + } + } + } + -- cgit v1.2.3