[network/ruqola] src/core: Remove unused method

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 375f67433344714ef94c500eca21a01fda6ecd4a by Laurent Montel.
Committed on 17/08/2026 at 11:41.
Pushed by mlaurent into branch 'master'.

Remove unused method

M  +0    -16   src/core/autotests/masterkeytest.cpp
M  +0    -1    src/core/autotests/masterkeytest.h
M  +0    -20   src/core/encryption/encryptionutils.cpp
M  +0    -1    src/core/encryption/encryptionutils.h

https://invent.kde.org/network/ruqola/-/commit/375f67433344714ef94c500eca21a01fda6ecd4a

diff --git a/src/core/autotests/masterkeytest.cpp b/src/core/autotests/masterkeytest.cpp
index e510601b20..0e2baeebe7 100644
--- a/src/core/autotests/masterkeytest.cpp
+++ b/src/core/autotests/masterkeytest.cpp
@@ -60,20 +60,4 @@ void MasterKeyTest::masterKeyEmptyUserIdTest()
     QVERIFY(masterKey.isEmpty());
 }
 
-void MasterKeyTest::importRawKeyTest()
-{
-    QByteArray baseKey1;
-    QByteArray baseKey2;
-
-    for (int i = 0; i <= 10; i++) {
-        baseKey1 = EncryptionUtils::importRawKey(u"admin"_s.toUtf8(), u"root"_s.toUtf8(), 1000);
-        baseKey2 = EncryptionUtils::importRawKey(u"admin"_s.toUtf8(), u"root"_s.toUtf8(), 1000);
-        QCOMPARE(baseKey1, baseKey2);
-
-        baseKey1 = EncryptionUtils::importRawKey(u"admin"_s.toUtf8(), u"root"_s.toUtf8(), 1000);
-        baseKey2 = EncryptionUtils::importRawKey(u"root"_s.toUtf8(), u"admin"_s.toUtf8(), 1000);
-        QVERIFY(baseKey1 != baseKey2);
-    }
-}
-
 #include "moc_masterkeytest.cpp"
diff --git a/src/core/autotests/masterkeytest.h b/src/core/autotests/masterkeytest.h
index 6bfe291b51..ee52fff973 100644
--- a/src/core/autotests/masterkeytest.h
+++ b/src/core/autotests/masterkeytest.h
@@ -19,5 +19,4 @@ private Q_SLOTS:
     void masterKeyDeterminismTest();
     void masterKeyEmptyUserIdTest();
     void masterKeyEmptyPasswordTest();
-    void importRawKeyTest();
 };
diff --git a/src/core/encryption/encryptionutils.cpp b/src/core/encryption/encryptionutils.cpp
index dad8c10fd5..90b3173c42 100644
--- a/src/core/encryption/encryptionutils.cpp
+++ b/src/core/encryption/encryptionutils.cpp
@@ -1164,26 +1164,6 @@ QVector<uint8_t> EncryptionUtils::toArrayBuffer(const QByteArray &ba)
     return byteVector;
 }
 
-// crypto.subtle.importKey('raw', keyData, { name: 'PBKDF2' }, false, keyUsages);
-QByteArray EncryptionUtils::importRawKey(const QByteArray &keyData, const QByteArray &salt, int iterations)
-{
-#if 0
-    export async function importRawKey(keyData, keyUsages = ['deriveKey']) {
-            return crypto.subtle.importKey('raw', keyData, { name: 'PBKDF2' }, false, keyUsages);
-    }
-#endif
-
-#if 0
-    QByteArray iv = generateRandomIV(16);
-    QByteArray data = generateRandomText(16).toUtf8();
-    QByteArray cipherText = encryptAES_CBC(data, key, iv);
-#endif
-
-    const QByteArray baseKey = deriveKey(keyData, salt, iterations);
-
-    return baseKey;
-}
-
 bool EncryptionUtils::EncryptionInfo::isValid() const
 {
     return !vector.isEmpty() && !encryptedData.isEmpty();
diff --git a/src/core/encryption/encryptionutils.h b/src/core/encryption/encryptionutils.h
index 825482c4ca..d17c4c60ca 100644
--- a/src/core/encryption/encryptionutils.h
+++ b/src/core/encryption/encryptionutils.h
@@ -63,7 +63,6 @@ struct RSAKeyPair {
 [[nodiscard]] LIBRUQOLACORE_EXPORT EncryptionUtils::EncryptionInfo splitVectorAndEcryptedData(const QByteArray &cipherText);
 [[nodiscard]] LIBRUQOLACORE_EXPORT QByteArray joinVectorAndEcryptedData(const EncryptionUtils::EncryptionInfo &info);
 [[nodiscard]] LIBRUQOLACORE_EXPORT QVector<uint8_t> toArrayBuffer(const QByteArray &ba);
-[[nodiscard]] LIBRUQOLACORE_EXPORT QByteArray importRawKey(const QByteArray &keyData, const QByteArray &salt, int iterations);
 [[nodiscard]] LIBRUQOLACORE_EXPORT QString generateRandomPassword();
 [[nodiscard]] LIBRUQOLACORE_EXPORT QString generateRoomKeyId();
 };
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.