-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
79c03b4
commit 334b021
Showing
5 changed files
with
72 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
-----BEGIN MEGOLM SESSION DATA----- | ||
ATQrLZT5CO0z1mJGtJcBaa4mabBB0pRII3RsKeXzvtKSAAehIFJ3016VcwFNTWDHPXC6cixX6u9YXWP7rTk7Z5vMVkIPRkUND2SbGmdrXYDWJgN/Ueg++VQZKkTWbiIQ | ||
6l/h9Xo3Jp8Quskrb1g9kqerF0s9m+z5xfp2plwCzsYwEtvm7mFbS2v5yvY8Gc9c4oaMRU/+W1ZqBB0AznubfcvmU+EbWXtCKk+7EhnCbeD12ve9YLL4G/gfiE9afeRk | ||
T318G8xYYT1eCMt/wxXAiSSmjwXc+Vp1n6qbg7KIGHWmu8eNvnj55aRu9Kk0+jtBXGhrMCGnjiJ3XDyPnjZnBJV81Cb3FIE8o3AAZGZ1aGgxK/PSBScaCI4aoWURd1oP | ||
4SXNgehJdahqhLNfulagns9Cxx3lo/IlRG9tf28gDE6Bb3IFj5GbH8SUICylHZsJSD+vTSXb7aUNNqjcqowNS4evGFJCzOtfDqkoHyfqiln+8rMQ1OL0MuqEcX/2G6Tt | ||
encqwrJN/6dMgdInAB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ATA----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// SPDX-FileCopyrightText: 2024 Tobias Fella <[email protected]> | ||
// SPDX-License-Identifier: LGPL-2.1-or-later | ||
|
||
#include <Quotient/e2ee/cryptoutils.h> | ||
|
||
#include <QTest> | ||
|
||
#include <Quotient/keyimport.h> | ||
|
||
class TestKeyImport : public QObject | ||
{ | ||
Q_OBJECT | ||
private slots: | ||
void testImport(); | ||
}; | ||
|
||
using namespace Quotient; | ||
|
||
void TestKeyImport::testImport() | ||
{ | ||
KeyImport keyImport; | ||
|
||
auto path = QString::fromUtf8(__FILE__); | ||
path = path.left(path.lastIndexOf(QDir::separator())); | ||
path += QStringLiteral("/key-export.data"); | ||
QFile file(path); | ||
file.open(QIODevice::ReadOnly); | ||
auto data = file.readAll(); | ||
QVERIFY(!data.isEmpty()); | ||
const auto result = keyImport.decrypt(QString::fromUtf8(data), QStringLiteral("123passphrase")); | ||
QVERIFY(result.has_value()); | ||
const auto &json = result.value(); | ||
QCOMPARE(json.size(), 2); | ||
} | ||
|
||
QTEST_GUILESS_MAIN(TestKeyImport) | ||
#include "testkeyimport.moc" |