From f4459420b72bbd005886d67fba4fb34da2958b5e Mon Sep 17 00:00:00 2001 From: Damien Caliste Date: Wed, 3 Apr 2024 13:45:50 +0200 Subject: Adjust crypto sign() API Make sign() API to operate on a pointer on a part, instead of a reference, to emphasis the fact that it will change the part itself, making it a multipart/signed container. Change-Id: I55a1e2d15ee170909ae4aa8f2c0e8f8e88c9134c Reviewed-by: Pekka Vuorela --- tests/tst_crypto/tst_crypto.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/tst_crypto/tst_crypto.cpp b/tests/tst_crypto/tst_crypto.cpp index d6bf3c9b..f36aa074 100644 --- a/tests/tst_crypto/tst_crypto.cpp +++ b/tests/tst_crypto/tst_crypto.cpp @@ -384,7 +384,7 @@ void tst_Crypto::sign() // Check message signing. QMailMessage msg = QMailMessage::fromRfc2822File(QStringLiteral("%1/%2").arg(QCoreApplication::applicationDirPath(), rfc2822Filename)); - QCOMPARE(QMailCryptographicServiceFactory::sign(msg, plugin, QStringList(fingerprint), passphrase), expectedStatus); + QCOMPARE(QMailCryptographicServiceFactory::sign(&msg, plugin, QStringList(fingerprint), passphrase), expectedStatus); // Check signed message output. // Replace the random boundary strings with a fixed one for comparison. @@ -413,7 +413,7 @@ void tst_Crypto::signVerify() message.setBody(QMailMessageBody::fromData("test", type, QMailMessageBody::Base64)); // Sign it with the PGP key (no password). - QMailCryptoFwd::SignatureResult r = QMailCryptographicServiceFactory::sign(message, "libgpgme.so", QStringList() << m_pgpKey); + QMailCryptoFwd::SignatureResult r = QMailCryptographicServiceFactory::sign(&message, "libgpgme.so", QStringList() << m_pgpKey); QCOMPARE(r, QMailCryptoFwd::SignatureValid); QCOMPARE(message.partCount(), uint(2)); QCOMPARE(message.contentType().type(), QByteArray("multipart")); -- cgit v1.2.3