From 2e4ce9065657b512de983af37404591558ecf03a Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Mon, 7 Dec 2015 03:34:41 -0800 Subject: [PATCH] Commented out old encryption functions --- core/backends/lan/landevicelink.cpp | 6 ------ core/networkpackage.cpp | 8 ++++---- core/networkpackage.h | 9 ++++----- tests/networkpackagetests.cpp | 5 +++-- tests/networkpackagetests.h | 2 +- 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/core/backends/lan/landevicelink.cpp b/core/backends/lan/landevicelink.cpp index 03e7ad10d..a0b14da56 100644 --- a/core/backends/lan/landevicelink.cpp +++ b/core/backends/lan/landevicelink.cpp @@ -99,12 +99,6 @@ void LanDeviceLink::dataReceived() return; } - if (!package.isEncrypted()) { - qWarning() << "Received plain-text package from paired link, ignoring!"; - } - - package.decrypt(mPrivateKey, &package); - if (package.hasPayloadTransferInfo()) { //qCDebug(KDECONNECT_CORE) << "HasPayloadTransferInfo"; QVariantMap transferInfo = package.payloadTransferInfo(); diff --git a/core/networkpackage.cpp b/core/networkpackage.cpp index 78e88a7c2..f56929f42 100644 --- a/core/networkpackage.cpp +++ b/core/networkpackage.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +//#include #include #include "dbushelper.h" @@ -35,7 +35,7 @@ #include "pluginloader.h" #include "kdeconnectconfig.h" -const QCA::EncryptionAlgorithm NetworkPackage::EncryptionAlgorithm = QCA::EME_PKCS1v15; +//const QCA::EncryptionAlgorithm NetworkPackage::EncryptionAlgorithm = QCA::EME_PKCS1v15; const int NetworkPackage::ProtocolVersion = 6; NetworkPackage::NetworkPackage(const QString& type) @@ -159,7 +159,7 @@ bool NetworkPackage::unserialize(const QByteArray& a, NetworkPackage* np) return true; } - +/* void NetworkPackage::encrypt(QCA::PublicKey& key) { @@ -213,7 +213,7 @@ bool NetworkPackage::decrypt(QCA::PrivateKey& key, NetworkPackage* out) const return true; } - +*/ FileTransferJob* NetworkPackage::createPayloadTransferJob(const QUrl &destination) const { return new FileTransferJob(payload(), payloadSize(), destination); diff --git a/core/networkpackage.h b/core/networkpackage.h index 49dfeb610..a73448d51 100644 --- a/core/networkpackage.h +++ b/core/networkpackage.h @@ -26,9 +26,8 @@ #include #include #include -#include #include -#include +//#include #include #include @@ -48,7 +47,7 @@ class KDECONNECTCORE_EXPORT NetworkPackage : public QObject public: - const static QCA::EncryptionAlgorithm EncryptionAlgorithm; + //const static QCA::EncryptionAlgorithm EncryptionAlgorithm; const static int ProtocolVersion; explicit NetworkPackage(const QString& type); @@ -58,8 +57,8 @@ public: QByteArray serialize() const; static bool unserialize(const QByteArray& json, NetworkPackage* out); - void encrypt(QCA::PublicKey& key); - bool decrypt(QCA::PrivateKey& key, NetworkPackage* out) const; + //void encrypt(QCA::PublicKey& key); + //bool decrypt(QCA::PrivateKey& key, NetworkPackage* out) const; bool isEncrypted() const { return mType == PACKAGE_TYPE_ENCRYPTED; } const QString& id() const { return mId; } diff --git a/tests/networkpackagetests.cpp b/tests/networkpackagetests.cpp index cb4050667..8d2b3d9db 100644 --- a/tests/networkpackagetests.cpp +++ b/tests/networkpackagetests.cpp @@ -23,6 +23,7 @@ #include "core/networkpackage.h" #include +#include QTEST_GUILESS_MAIN(NetworkPackageTests); @@ -88,7 +89,7 @@ void NetworkPackageTests::networkPackageIdentityTest() QCOMPARE( np.type() , PACKAGE_TYPE_IDENTITY ); } - +/* void NetworkPackageTests::networkPackageEncryptionTest() { QCA::Initializer init; @@ -140,7 +141,7 @@ void NetworkPackageTests::networkPackageEncryptionTest() QCOMPARE(QString(decryptedJson), QString(json)); } - +*/ void NetworkPackageTests::cleanupTestCase() { diff --git a/tests/networkpackagetests.h b/tests/networkpackagetests.h index bb2b74379..917482826 100644 --- a/tests/networkpackagetests.h +++ b/tests/networkpackagetests.h @@ -33,7 +33,7 @@ private Q_SLOTS: void dummyTest(); void networkPackageTest(); void networkPackageIdentityTest(); - void networkPackageEncryptionTest(); + //void networkPackageEncryptionTest(); void cleanupTestCase();