summaryrefslogtreecommitdiff
path: root/user/gpgme/0002-Make-sure-expiration-time-is-interpreted-as-unsigned.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/gpgme/0002-Make-sure-expiration-time-is-interpreted-as-unsigned.patch')
-rw-r--r--user/gpgme/0002-Make-sure-expiration-time-is-interpreted-as-unsigned.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/user/gpgme/0002-Make-sure-expiration-time-is-interpreted-as-unsigned.patch b/user/gpgme/0002-Make-sure-expiration-time-is-interpreted-as-unsigned.patch
new file mode 100644
index 000000000..558cacda0
--- /dev/null
+++ b/user/gpgme/0002-Make-sure-expiration-time-is-interpreted-as-unsigned.patch
@@ -0,0 +1,30 @@
+From 6a79e90dedc19877ae1c520fed875b57089a5425 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= <dev@ingo-kloecker.de>
+Date: Thu, 8 Jul 2021 11:54:06 +0200
+Subject: [PATCH] Make sure expiration time is interpreted as unsigned number
+
+* lang/qt/tests/t-various.cpp (testSignKeyWithExpiration): Convert
+expiration time to uint_least32_t.
+--
+
+This fixes the test on 32-bit systems where time_t (the return type of
+expirationTime()) is a signed 32-bit integer type.
+
+GnuPG-bug-id: 5522
+---
+ lang/qt/tests/t-various.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lang/qt/tests/t-various.cpp b/lang/qt/tests/t-various.cpp
+index 8563b681..72a2487a 100644
+--- a/lang/qt/tests/t-various.cpp
++++ b/lang/qt/tests/t-various.cpp
+@@ -355,7 +355,7 @@ private Q_SLOTS:
+ target.update();
+ const auto keySignature = target.userID(0).signature(target.userID(0).numSignatures() - 1);
+ QVERIFY(!keySignature.neverExpires());
+- const auto expirationDate = QDateTime::fromSecsSinceEpoch(keySignature.expirationTime()).date();
++ 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
+ }
+