diff --git a/server/autotests/CMakeLists.txt b/server/autotests/CMakeLists.txt index 4842c3e..bef1652 100644 --- a/server/autotests/CMakeLists.txt +++ b/server/autotests/CMakeLists.txt @@ -1,10 +1,30 @@ # SPDX-FileCopyrightText: 2023 g10 code GmbH # SPDX-Contributor: Carl Schwan # SPDX-License-Identifier: BSD-2-Clause add_definitions(-DDATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/testdata" ) ecm_add_test(emailcontrollertest.cpp LINK_LIBRARIES gpgol-server-static Qt::Test NAME_PREFIX "server-http-" ) + +ecm_add_test(globalparttest.cpp + LINK_LIBRARIES gpgol-server-static Qt::Test + NAME_PREFIX "server-part-" +) + +ecm_add_test(infoparttest.cpp + LINK_LIBRARIES gpgol-server-static Qt::Test + NAME_PREFIX "server-part-" +) + +ecm_add_test(itipjobtest.cpp + LINK_LIBRARIES gpgol-server-static Qt::Test + NAME_PREFIX "server-job-" +) + +ecm_add_test(multipartjobtest.cpp + LINK_LIBRARIES gpgol-server-static Qt::Test + NAME_PREFIX "server-job-" +) diff --git a/server/autotests/globalparttest.cpp b/server/autotests/globalparttest.cpp new file mode 100644 index 0000000..2cb9e60 --- /dev/null +++ b/server/autotests/globalparttest.cpp @@ -0,0 +1,31 @@ +/* + SPDX-FileCopyrightText: 2014-2024 Laurent Montel + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "globalparttest.h" +#include "../editor/part/globalpart.h" +#include + +GlobalPartTest::GlobalPartTest(QObject *parent) + : QObject(parent) +{ +} + +GlobalPartTest::~GlobalPartTest() = default; + +void GlobalPartTest::shouldHaveDefaultValue() +{ + MessageComposer::GlobalPart globalpart; + QVERIFY(globalpart.isGuiEnabled()); + QVERIFY(!globalpart.parentWidgetForGui()); + QVERIFY(!globalpart.isFallbackCharsetEnabled()); + QVERIFY(!globalpart.is8BitAllowed()); + QVERIFY(!globalpart.MDNRequested()); + QVERIFY(!globalpart.requestDeleveryConfirmation()); +} + +QTEST_GUILESS_MAIN(GlobalPartTest) + +#include "moc_globalparttest.cpp" diff --git a/server/autotests/globalparttest.h b/server/autotests/globalparttest.h new file mode 100644 index 0000000..9a467ba --- /dev/null +++ b/server/autotests/globalparttest.h @@ -0,0 +1,18 @@ +/* + SPDX-FileCopyrightText: 2014-2024 Laurent Montel + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#pragma once +#include + +class GlobalPartTest : public QObject +{ + Q_OBJECT +public: + explicit GlobalPartTest(QObject *parent = nullptr); + ~GlobalPartTest() override; +private Q_SLOTS: + void shouldHaveDefaultValue(); +}; diff --git a/server/autotests/infoparttest.cpp b/server/autotests/infoparttest.cpp new file mode 100644 index 0000000..caf4532 --- /dev/null +++ b/server/autotests/infoparttest.cpp @@ -0,0 +1,38 @@ +/* + SPDX-FileCopyrightText: 2014-2024 Laurent Montel + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "infoparttest.h" +#include "../editor/part/infopart.h" +#include + +InfoPartTest::InfoPartTest(QObject *parent) + : QObject(parent) +{ +} + +InfoPartTest::~InfoPartTest() = default; + +void InfoPartTest::shouldHaveDefaultValue() +{ + MessageComposer::InfoPart infopart; + QCOMPARE(infopart.transportId(), 0); + QVERIFY(!infopart.urgent()); + QVERIFY(infopart.from().isEmpty()); + QVERIFY(infopart.to().isEmpty()); + QVERIFY(infopart.cc().isEmpty()); + QVERIFY(infopart.bcc().isEmpty()); + QVERIFY(infopart.replyTo().isEmpty()); + QVERIFY(infopart.subject().isEmpty()); + QVERIFY(infopart.fcc().isEmpty()); + QVERIFY(infopart.userAgent().isEmpty()); + QVERIFY(infopart.inReplyTo().isEmpty()); + QVERIFY(infopart.references().isEmpty()); + QVERIFY(infopart.extraHeaders().isEmpty()); +} + +QTEST_MAIN(InfoPartTest) + +#include "moc_infoparttest.cpp" diff --git a/server/autotests/infoparttest.h b/server/autotests/infoparttest.h new file mode 100644 index 0000000..c75c238 --- /dev/null +++ b/server/autotests/infoparttest.h @@ -0,0 +1,19 @@ +/* + SPDX-FileCopyrightText: 2014-2024 Laurent Montel + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#pragma once + +#include + +class InfoPartTest : public QObject +{ + Q_OBJECT +public: + explicit InfoPartTest(QObject *parent = nullptr); + ~InfoPartTest() override; +private Q_SLOTS: + void shouldHaveDefaultValue(); +}; diff --git a/server/autotests/itipjobtest.cpp b/server/autotests/itipjobtest.cpp new file mode 100644 index 0000000..dad132c --- /dev/null +++ b/server/autotests/itipjobtest.cpp @@ -0,0 +1,143 @@ +/* + SPDX-FileCopyrightText: 2023 Daniel Vrátil + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "itipjobtest.h" +#include "qtest_messagecomposer.h" + +#include +#include + +#include +#include +using namespace KMime; + +#include "../editor/composer.h" +#include "../editor/part/globalpart.h" +#include "../editor/job/itipjob.h" +#include "../editor/part/itippart.h" + +using namespace MessageComposer; + +QTEST_MAIN(ItipJobTest) + +static QString testItip = QStringLiteral(R"( +BEGIN:VCALENDAR +CALSCALE:GREGORIAN +METHOD:REQUEST +BEGIN:VEVENT +CREATED:20230508T143456Z +ORGANIZER;CN=Konqi:MAILTO:konqi@example.com +ATTENDEE;CN=Kate;RSVP=TRUE;ROLE=REQ-PARTICIPANT:MAILTO:kate@example.com +CREATED:20230508T143456Z +UID:KOrganizer-1673850046.1067 +SUMMARY:Krypto Party +DTSTART;VALUE=DATE:20230520 +DTEND;VALUE=DATE:20230520 +END:VEVENT +END:VCALENDAR)"); + +static QString testItipMessage = QStringLiteral("Hi all, let's do some crypto partying!"); + +void ItipJobTest::testInvitationWithAttachment() +{ + auto part = std::make_unique(); + part->setOutlookConformInvitation(false); + part->setInvitation(testItip); + part->setInvitationBody(testItipMessage); + + Composer composer; + ItipJob job(part.get(), &composer); + job.setAutoDelete(false); + QVERIFY(job.exec()); + + auto *content = job.content(); + content->assemble(); + QVERIFY(content); + + QCOMPARE(content->contentType(false)->mimeType(), "multipart/mixed"); + const auto subparts = content->contents(); + QCOMPARE(subparts.size(), 2); + const auto msgPart = subparts[0]; + QCOMPARE(msgPart->contentType(false)->mimeType(), "text/plain"); + QCOMPARE(msgPart->contentDisposition(false)->disposition(), KMime::Headers::CDinline); + QCOMPARE(msgPart->decodedText(), testItipMessage); + + const auto itipPart = subparts[1]; + QCOMPARE(itipPart->contentType(false)->mimeType(), "text/calendar"); + QCOMPARE(itipPart->contentType(false)->name(), QStringLiteral("cal.ics")); + QCOMPARE(itipPart->contentType(false)->parameter(QStringLiteral("method")), QStringLiteral("request")); + QCOMPARE(itipPart->contentType(false)->charset(), "utf-8"); + QCOMPARE(itipPart->contentDisposition(false)->disposition(), KMime::Headers::CDattachment); + QCOMPARE(itipPart->decodedText(), testItip); +} + +void ItipJobTest::testInvitationWithoutAttachment() +{ + auto part = std::make_unique(); + part->setOutlookConformInvitation(false); + part->setInvitationBody(testItipMessage); + + Composer composer; + ItipJob job(part.get(), &composer); + job.setAutoDelete(false); + QVERIFY(job.exec()); + + auto *content = job.content(); + content->assemble(); + QVERIFY(content); + + QCOMPARE(content->contentType(false)->mimeType(), "text/plain"); + QCOMPARE(content->contentDisposition(false)->disposition(), KMime::Headers::CDinline); + QCOMPARE(content->decodedText(), testItipMessage); +} + +void ItipJobTest::testOutlookInvitationWithAttachment() +{ + auto part = std::make_unique(); + part->setOutlookConformInvitation(true); + part->setInvitation(testItip); + part->setInvitationBody(testItipMessage); + + Composer composer; + ItipJob job(part.get(), &composer); + job.setAutoDelete(false); + QVERIFY(job.exec()); + + auto *content = job.content(); + content->assemble(); + QVERIFY(content); + + QCOMPARE(content->contentType(false)->mimeType(), "text/calendar"); + QCOMPARE(content->contentType(false)->name(), QStringLiteral("cal.ics")); + QCOMPARE(content->contentType(false)->parameter(QStringLiteral("method")), QStringLiteral("request")); + QCOMPARE(content->contentType(false)->charset(), "utf-8"); + QCOMPARE(content->contentDisposition(false)->disposition(), KMime::Headers::CDinline); + QCOMPARE(content->decodedText(), testItip); +} + +void ItipJobTest::testOutlookInvitationWithoutAttachment() +{ + auto part = std::make_unique(); + part->setOutlookConformInvitation(true); + part->setInvitationBody(testItipMessage); + + Composer composer; + ItipJob job(part.get(), &composer); + job.setAutoDelete(false); + QVERIFY(job.exec()); + + auto *content = job.content(); + content->assemble(); + QVERIFY(content); + + QCOMPARE(content->contentType(false)->mimeType(), "text/calendar"); + QCOMPARE(content->contentType(false)->name(), QStringLiteral("cal.ics")); + QCOMPARE(content->contentType(false)->parameter(QStringLiteral("method")), QStringLiteral("request")); + QCOMPARE(content->contentType(false)->charset(), "utf-8"); + QVERIFY(content->decodedText().isEmpty()); +} + +#include "moc_itipjobtest.cpp" diff --git a/server/autotests/itipjobtest.h b/server/autotests/itipjobtest.h new file mode 100644 index 0000000..2a3d640 --- /dev/null +++ b/server/autotests/itipjobtest.h @@ -0,0 +1,19 @@ +/* + SPDX-FileCopyrightText: 2023 Daniel Vrátil + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#pragma once + +#include + +class ItipJobTest : public QObject +{ + Q_OBJECT +private Q_SLOTS: + void testInvitationWithAttachment(); + void testInvitationWithoutAttachment(); + void testOutlookInvitationWithAttachment(); + void testOutlookInvitationWithoutAttachment(); +}; diff --git a/server/autotests/multipartjobtest.cpp b/server/autotests/multipartjobtest.cpp new file mode 100644 index 0000000..30f8d90 --- /dev/null +++ b/server/autotests/multipartjobtest.cpp @@ -0,0 +1,96 @@ +/* + SPDX-FileCopyrightText: 2009 Constantin Berzan + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "multipartjobtest.h" + +#include +#include + +#include + +using namespace KMime; + +#include "../editor/composer.h" +#include "../editor/part/globalpart.h" +#include "../editor/job/multipartjob.h" +#include "../editor/job/singlepartjob.h" + +using namespace MessageComposer; + +QTEST_MAIN(MultipartJobTest) + +void MultipartJobTest::testMultipartMixed() +{ + Composer composer; + auto mjob = new MultipartJob(&composer); + mjob->setMultipartSubtype("mixed"); + + QByteArray data1("one"); + QByteArray data2("two"); + QByteArray type1("text/plain"); + QByteArray type2("application/x-mors-ontologica"); + + { + auto cjob = new SinglepartJob(mjob); + cjob->setData(data1); + cjob->contentType()->setMimeType(type1); + } + + { + auto cjob = new SinglepartJob(mjob); + cjob->setData(data2); + cjob->contentType()->setMimeType(type2); + } + + QVERIFY(mjob->exec()); + Content *result = mjob->content(); + result->assemble(); + qDebug() << result->encodedContent(); + + QVERIFY(result->contentType(false)); + QCOMPARE(result->contentType(false)->mimeType(), QByteArray("multipart/mixed")); + QCOMPARE(result->contents().count(), 2); + + { + Content *c = result->contents().at(0); + QCOMPARE(c->body(), data1); + QVERIFY(c->contentType(false)); + QCOMPARE(c->contentType(false)->mimeType(), type1); + } + + { + Content *c = result->contents().at(1); + QCOMPARE(c->body(), data2); + QVERIFY(c->contentType(false)); + QCOMPARE(c->contentType(false)->mimeType(), type2); + } + delete result; +} + +void MultipartJobTest::test8BitPropagation() +{ + // If a subpart is 8bit, its parent must be 8bit too. + + Composer composer; + composer.globalPart()->set8BitAllowed(true); + auto mjob = new MultipartJob(&composer); + mjob->setMultipartSubtype("mixed"); + auto mjob2 = new MultipartJob(mjob); + mjob2->setMultipartSubtype("mixed"); + auto cjob = new SinglepartJob(mjob2); + QByteArray data("time is so short and I'm sure there must be something more"); + cjob->setData(data); + cjob->contentTransferEncoding()->setEncoding(Headers::CE8Bit); + QVERIFY(mjob->exec()); + Content *content = mjob->content(); + content->assemble(); + qDebug() << content->encodedContent(); + QVERIFY(content->contentTransferEncoding(false)); + QCOMPARE(content->contentTransferEncoding(false)->encoding(), Headers::CE8Bit); + delete content; +} + +#include "moc_multipartjobtest.cpp" diff --git a/server/autotests/multipartjobtest.h b/server/autotests/multipartjobtest.h new file mode 100644 index 0000000..1622ed6 --- /dev/null +++ b/server/autotests/multipartjobtest.h @@ -0,0 +1,17 @@ +/* + SPDX-FileCopyrightText: 2009 Constantin Berzan + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#pragma once + +#include + +class MultipartJobTest : public QObject +{ + Q_OBJECT +private Q_SLOTS: + void testMultipartMixed(); + void test8BitPropagation(); +}; diff --git a/server/autotests/qtest_messagecomposer.h b/server/autotests/qtest_messagecomposer.h new file mode 100644 index 0000000..98e4144 --- /dev/null +++ b/server/autotests/qtest_messagecomposer.h @@ -0,0 +1,17 @@ +/* + SPDX-FileCopyrightText: 2009 Constantin Berzan + + Based on Akonadi code by: + SPDX-FileCopyrightText: 2009 Volker Krause + + SPDX-License-Identifier: LGPL-2.0-only +*/ + +#pragma once + +/** + * Runs a MessageComposer::JobBase synchronously and aborts if the job failed. + * Similar to QVERIFY( job->exec() ) but includes the job error message + * in the output in case of a failure. + */ +#define VERIFYEXEC(job) QVERIFY2(job->exec(), job->errorString().toUtf8().constData()) diff --git a/server/autotests/signencrypttest.cpp b/server/autotests/signencrypttest.cpp new file mode 100644 index 0000000..e281c38 --- /dev/null +++ b/server/autotests/signencrypttest.cpp @@ -0,0 +1,268 @@ +/* + SPDX-FileCopyrightText: 2020 Sandro Knauß + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#include "signencrypttest.h" + +#include "cryptofunctions.h" +#include "qtest_messagecomposer.h" +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include + +QTEST_MAIN(SignEncryptTest) + +using namespace MessageComposer; + +void SignEncryptTest::initTestCase() +{ + Test::setupEnv(); +} + +void SignEncryptTest::testContent_data() +{ + QTest::addColumn("cryptoMessageFormat"); + QTest::addColumn("error"); + + QTest::newRow("OpenPGPMimeFormat") << (int)Kleo::OpenPGPMIMEFormat << QString(); + QTest::newRow("InlineOpenPGPFormat") << (int)Kleo::InlineOpenPGPFormat << QString(); + QTest::newRow("SMIMEFormat") << (int)Kleo::SMIMEFormat << QStringLiteral("Not implemented"); + QTest::newRow("SMIMEOpaqueFormat") << (int)Kleo::SMIMEOpaqueFormat << QStringLiteral("Not implemented"); +} + +void SignEncryptTest::testContent() +{ + QFETCH(int, cryptoMessageFormat); + QFETCH(QString, error); + + const std::vector &keys = Test::getKeys(); + const QString data(QString::fromLocal8Bit("one flew over the cuckoo's nest")); + + Composer composer; + + const QList charsets = {"us-ascii"}; + composer.globalPart()->setCharsets(charsets); + + TextPart part; + part.setWordWrappingEnabled(false); + part.setCleanPlainText(data); + + auto mainTextJob = new MainTextJob(&part, &composer); + auto seJob = new SignEncryptJob(&composer); + + QVERIFY(mainTextJob); + + VERIFYEXEC(mainTextJob); + + const QStringList recipients = {QString::fromLocal8Bit("test@kolab.org")}; + + seJob->setContent(mainTextJob->content()); + seJob->setSigningKeys(keys); + seJob->setCryptoMessageFormat((Kleo::CryptoMessageFormat)cryptoMessageFormat); + seJob->setRecipients(recipients); + seJob->setEncryptionKeys(keys); + + if (!error.isEmpty()) { + QVERIFY(!seJob->exec()); + QCOMPARE(seJob->errorString(), error); + return; + } + + VERIFYEXEC(seJob); + KMime::Content *result = seJob->content(); + QVERIFY(result); + result->assemble(); + + ComposerTestUtil::verifySignatureAndEncryption(result, data.toUtf8(), (Kleo::CryptoMessageFormat)cryptoMessageFormat, false, true); + + delete result; +} + +void SignEncryptTest::testContentSubjobChained() +{ + const std::vector &keys = Test::getKeys(); + + const QByteArray data(QString::fromLocal8Bit("one flew over the cuckoo's nest").toUtf8()); + KMime::Message skeletonMessage; + + auto content = new KMime::Content; + content->contentType(true)->setMimeType("text/plain"); + content->setBody(data); + + auto tJob = new TransparentJob; + tJob->setContent(content); + + const QStringList recipients = {QString::fromLocal8Bit("test@kolab.org")}; + + Composer composer; + auto seJob = new SignEncryptJob(&composer); + + seJob->setSigningKeys(keys); + seJob->setCryptoMessageFormat(Kleo::OpenPGPMIMEFormat); + seJob->setRecipients(recipients); + seJob->setEncryptionKeys(keys); + seJob->setSkeletonMessage(&skeletonMessage); + QVERIFY(seJob->appendSubjob(tJob)); + + VERIFYEXEC(seJob); + KMime::Content *result = seJob->content(); + QVERIFY(result); + result->assemble(); + + ComposerTestUtil::verifySignatureAndEncryption(result, data, Kleo::OpenPGPMIMEFormat, false, true); + + delete result; +} + +void SignEncryptTest::testHeaders() +{ + const std::vector &keys = Test::getKeys(); + + Composer composer; + auto seJob = new SignEncryptJob(&composer); + + QVERIFY(seJob); + + const QByteArray data(QString::fromLocal8Bit("one flew over the cuckoo's nest").toUtf8()); + auto content = new KMime::Content; + content->setBody(data); + + const QStringList recipients = {QString::fromLocal8Bit("test@kolab.org")}; + + seJob->setContent(content); + seJob->setSigningKeys(keys); + seJob->setCryptoMessageFormat(Kleo::OpenPGPMIMEFormat); + seJob->setRecipients(recipients); + seJob->setEncryptionKeys(keys); + + VERIFYEXEC(seJob); + + KMime::Content *result = seJob->content(); + QVERIFY(result); + result->assemble(); + + QFile f(QStringLiteral("test")); + QVERIFY(f.open(QIODevice::WriteOnly | QIODevice::Truncate)); + const QByteArray encodedContent(result->encodedContent()); + f.write(encodedContent); + if (!encodedContent.endsWith('\n')) { + f.write("\n"); + } + f.close(); + + QVERIFY(result->contentType(false)); + QCOMPARE(result->contentType()->mimeType(), "multipart/encrypted"); + QCOMPARE(result->contentType()->charset(), "ISO-8859-1"); + QCOMPARE(result->contentType()->parameter(QString::fromLocal8Bit("protocol")), QString::fromLocal8Bit("application/pgp-encrypted")); + QCOMPARE(result->contentTransferEncoding()->encoding(), KMime::Headers::CE7Bit); + + delete result; +} + +void SignEncryptTest::testProtectedHeaders_data() +{ + QTest::addColumn("protectedHeaders"); + QTest::addColumn("protectedHeadersObvoscate"); + QTest::addColumn("referenceFile"); + + QTest::newRow("simple-obvoscate") << true << true << QStringLiteral("protected_headers-obvoscate.mbox"); + QTest::newRow("simple-non-obvoscate") << true << false << QStringLiteral("protected_headers-non-obvoscate.mbox"); + QTest::newRow("non-protected_headers") << false << false << QStringLiteral("non-protected_headers.mbox"); +} + +void SignEncryptTest::testProtectedHeaders() +{ + QFETCH(bool, protectedHeaders); + QFETCH(bool, protectedHeadersObvoscate); + QFETCH(QString, referenceFile); + + const std::vector &keys = Test::getKeys(); + + Composer composer; + auto seJob = new SignEncryptJob(&composer); + + QVERIFY(seJob); + + const QByteArray data(QStringLiteral("one flew over the cuckoo's nest").toUtf8()); + const QString subject(QStringLiteral("asdfghjklö")); + + auto content = new KMime::Content; + content->contentType(true)->setMimeType("text/plain"); + content->setBody(data); + + KMime::Message skeletonMessage; + skeletonMessage.contentType(true)->setMimeType("foo/bla"); + skeletonMessage.to(true)->from7BitString("to@test.de, to2@test.de"); + skeletonMessage.cc(true)->from7BitString("cc@test.de, cc2@test.de"); + skeletonMessage.bcc(true)->from7BitString("bcc@test.de, bcc2@test.de"); + skeletonMessage.subject(true)->fromUnicodeString(subject, "utf-8"); + + const QStringList recipients = {QStringLiteral("test@kolab.org")}; + + seJob->setContent(content); + seJob->setCryptoMessageFormat(Kleo::OpenPGPMIMEFormat); + seJob->setRecipients(recipients); + seJob->setEncryptionKeys(keys); + seJob->setSkeletonMessage(&skeletonMessage); + seJob->setProtectedHeaders(protectedHeaders); + seJob->setProtectedHeadersObvoscate(protectedHeadersObvoscate); + + VERIFYEXEC(seJob); + + if (protectedHeadersObvoscate) { + QCOMPARE(skeletonMessage.subject()->as7BitString(false), "..."); + } else { + QCOMPARE(skeletonMessage.subject()->asUnicodeString(), subject); + } + + KMime::Content *result = seJob->content(); + result->assemble(); + + KMime::Content *encPart = Util::findTypeInMessage(result, "application", "octet-stream"); + KMime::Content tempNode; + { + QByteArray plainText; + auto job = QGpgME::openpgp()->decryptVerifyJob(); + auto jobResult = job->exec(encPart->encodedBody(), plainText); + + auto signature = jobResult.second.signatures()[0]; + + QCOMPARE(signature.fingerprint(), "1BA323932B3FAA826132C79E8D9860C58F246DE6"); + QCOMPARE(signature.status().code(), 0); + + tempNode.setContent(KMime::CRLFtoLF(plainText.constData())); + tempNode.parse(); + } + if (protectedHeadersObvoscate) { + tempNode.contentType(false)->setBoundary("123456789"); + tempNode.assemble(); + } + + delete result; + + Test::compareFile(&tempNode, QStringLiteral(MAIL_DATA_DIR "/") + referenceFile); +} + +#include "moc_signencrypttest.cpp" diff --git a/server/autotests/signencrypttest.h b/server/autotests/signencrypttest.h new file mode 100644 index 0000000..6688273 --- /dev/null +++ b/server/autotests/signencrypttest.h @@ -0,0 +1,26 @@ +/* + SPDX-FileCopyrightText: 2020 Sandro Knauß + + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +#pragma once + +#include + +class SignEncryptTest : public QObject +{ + Q_OBJECT + +public Q_SLOTS: + void initTestCase(); + +private Q_SLOTS: + void testContent_data(); + void testContent(); + void testContentSubjobChained(); + void testHeaders(); + + void testProtectedHeaders_data(); + void testProtectedHeaders(); +};