diff options
author | Ingo Klöcker <[email protected]> | 2022-06-10 09:54:03 +0000 |
---|---|---|
committer | Ingo Klöcker <[email protected]> | 2022-06-10 09:54:03 +0000 |
commit | 7870fdbfeff47755138136dbd6648b18f6b4fc76 (patch) | |
tree | 9f0c26667a61b7961ad089e26a1871df7ffac912 /lang/qt/tests/t-various.cpp | |
parent | Revert "tests: Avoid problems with local time across a day boundary." (diff) | |
download | gpgme-7870fdbfeff47755138136dbd6648b18f6b4fc76.tar.gz gpgme-7870fdbfeff47755138136dbd6648b18f6b4fc76.zip |
qt: Prevent u32 overflow when calculating expiration date
* lang/qt/src/qgpgmesignkeyjob.cpp (sign_key): Change maxAllowedDate to
2106-02-05. Change log-level from warning to debug.
* lang/qt/tests/t-various.cpp (TestVarious::testSignKeyWithExpiration):
Remove check for warning. Adapt assertion.
--
Capping the expiration date at 2106-02-05 prevents a u32 overflow when
adding the number of days until the maximal date to the current time.
GnuPG-bug-id: 5991
Diffstat (limited to 'lang/qt/tests/t-various.cpp')
-rw-r--r-- | lang/qt/tests/t-various.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lang/qt/tests/t-various.cpp b/lang/qt/tests/t-various.cpp index b630350c..18360166 100644 --- a/lang/qt/tests/t-various.cpp +++ b/lang/qt/tests/t-various.cpp @@ -328,8 +328,6 @@ private Q_SLOTS: } }); - QTest::ignoreMessage(QtWarningMsg, "Expiration of certification has been changed to QDate(\"2106-02-06\")"); - job->start(target); QSignalSpy spy{this, &TestVarious::asyncDone}; QVERIFY(spy.wait(QSIGNALSPY_TIMEOUT)); @@ -339,7 +337,7 @@ private Q_SLOTS: const auto keySignature = target.userID(0).signature(target.userID(0).numSignatures() - 1); QVERIFY(!keySignature.neverExpires()); const auto expirationDate = QDateTime::fromSecsSinceEpoch(uint_least32_t(keySignature.expirationTime())).date(); - QCOMPARE(expirationDate, QDate(2106, 2, 6)); // expiration date is capped at 2106-02-06 + QCOMPARE(expirationDate, QDate(2106, 2, 5)); // expiration date is capped at 2106-02-05 } void testVersion() |