From 4a4ac4b35fd5faf14e7143c0c8babe65c9c95e92 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Fri, 18 Nov 2022 03:11:50 -0600 Subject: user/trojita: Fix build and add patches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Ensures Trojitá does not crash using attachments. * Port to Qt 5.15. * Fix a security issue with STARTTLS. * Ensure passwords are stored correctly. * Fix signedness on unsigned char platforms (ARM, Power). Closes: #856 --- user/trojita/testfix.patch | 85 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 user/trojita/testfix.patch (limited to 'user/trojita/testfix.patch') diff --git a/user/trojita/testfix.patch b/user/trojita/testfix.patch new file mode 100644 index 000000000..efe36d053 --- /dev/null +++ b/user/trojita/testfix.patch @@ -0,0 +1,85 @@ +Required for plaintext-upgrade-attack.patch to run successfully. + +From 91d19cb8530cb8df6ec0ee0580abcd98f1957395 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= +Date: Mon, 5 Sep 2016 12:47:28 +0200 +Subject: [PATCH] tests: fix more memleaks + +There's some progress, but still plenty of stuff to do: + +-SUMMARY: AddressSanitizer: 77490 byte(s) leaked in 1010 allocation(s). ++SUMMARY: AddressSanitizer: 7720 byte(s) leaked in 95 allocation(s). + +Change-Id: I133fda902a9bd3f9fe697d7ffe8c57a159c887d8 +--- + tests/Imap/test_Imap_Tasks_OpenConnection.cpp | 16 ++++++++-------- + tests/Imap/test_Imap_Tasks_OpenConnection.h | 14 +++++++------- + 2 files changed, 15 insertions(+), 15 deletions(-) + +diff --git a/tests/Imap/test_Imap_Tasks_OpenConnection.cpp b/tests/Imap/test_Imap_Tasks_OpenConnection.cpp +index b3a95636..c40297ab 100644 +--- a/tests/Imap/test_Imap_Tasks_OpenConnection.cpp ++++ b/tests/Imap/test_Imap_Tasks_OpenConnection.cpp +@@ -35,12 +35,11 @@ void ImapModelOpenConnectionTest::initTestCase() + { + LibMailboxSync::initTestCase(); + qRegisterMetaType(); +- completedSpy = 0; +- m_enableAutoLogin = true; + } + + void ImapModelOpenConnectionTest::init() + { ++ m_enableAutoLogin = true; + reinit(TlsRequired::No); + } + +@@ -56,13 +55,14 @@ void ImapModelOpenConnectionTest::reinit(const TlsRequired tlsRequired) + connect(model, &Imap::Mailbox::Model::needsSslDecision, this, &ImapModelOpenConnectionTest::acceptSsl, Qt::QueuedConnection); + LibMailboxSync::setModelNetworkPolicy(model, Imap::Mailbox::NETWORK_ONLINE); + QCoreApplication::processEvents(); ++ delete task; + task = new Imap::Mailbox::OpenConnectionTask(model); +- completedSpy = new QSignalSpy(task, SIGNAL(completed(Imap::Mailbox::ImapTask*))); +- failedSpy = new QSignalSpy(task, SIGNAL(failed(QString))); +- authSpy = new QSignalSpy(model, SIGNAL(authRequested())); +- connErrorSpy = new QSignalSpy(model, SIGNAL(imapError(QString))); +- startTlsUpgradeSpy = new QSignalSpy(model, SIGNAL(requireStartTlsInFuture())); +- authErrorSpy = new QSignalSpy(model, SIGNAL(imapAuthErrorChanged(const QString&))); ++ completedSpy.reset(new QSignalSpy(task, SIGNAL(completed(Imap::Mailbox::ImapTask*)))); ++ failedSpy.reset(new QSignalSpy(task, SIGNAL(failed(QString)))); ++ authSpy.reset(new QSignalSpy(model, SIGNAL(authRequested()))); ++ connErrorSpy.reset(new QSignalSpy(model, SIGNAL(imapError(QString)))); ++ startTlsUpgradeSpy.reset(new QSignalSpy(model, SIGNAL(requireStartTlsInFuture()))); ++ authErrorSpy.reset(new QSignalSpy(model, SIGNAL(imapAuthErrorChanged(const QString&)))); + t.reset(); + } + +diff --git a/tests/Imap/test_Imap_Tasks_OpenConnection.h b/tests/Imap/test_Imap_Tasks_OpenConnection.h +index 30f531a2..4df65c05 100644 +--- a/tests/Imap/test_Imap_Tasks_OpenConnection.h ++++ b/tests/Imap/test_Imap_Tasks_OpenConnection.h +@@ -78,13 +78,13 @@ protected: + void reinit(const TlsRequired tlsRequired = TlsRequired::No); + + private: +- Imap::Mailbox::OpenConnectionTask* task; +- QSignalSpy* completedSpy; +- QSignalSpy* failedSpy; +- QSignalSpy* authSpy; +- QSignalSpy *connErrorSpy; +- QSignalSpy *startTlsUpgradeSpy; +- QSignalSpy *authErrorSpy; ++ QPointer task; ++ std::unique_ptr completedSpy; ++ std::unique_ptr failedSpy; ++ std::unique_ptr authSpy; ++ std::unique_ptr connErrorSpy; ++ std::unique_ptr startTlsUpgradeSpy; ++ std::unique_ptr authErrorSpy; + + bool m_enableAutoLogin; + }; +-- +GitLab + -- cgit v1.2.3-60-g2f50