Commit 88f69225 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Fix fingerprint and creation timestamp written to OpenPGP cards

The timestamp needs to be in UTC. QDateTime::fromSecsSinceEpoch()
uses local time by default, so we need to request UTC explicitly.
The wrong creation timestamp resulted in a different creation
time stored on the card than stored locally. And, since the creation
time is included in the calculation of the fingerprint, this also
resulted in different fingerprints stored on the card and locally.
parent 4594a393
Pipeline #37443 passed with stage
in 47 minutes and 9 seconds
......@@ -256,7 +256,7 @@ void KeyToCardCommand::Private::startKeyToOpenPGPCard() {
// Now do the deed
const auto time = QDateTime::fromSecsSinceEpoch(subkey.creationTime());
const auto time = QDateTime::fromSecsSinceEpoch(subkey.creationTime(), Qt::UTC);
const auto timestamp = time.toString(QStringLiteral("yyyyMMdd'T'HHmmss"));
const QString cmd = QStringLiteral("KEYTOCARD --force %1 %2 OPENPGP.%3 %4")
.arg(QString::fromLatin1(subkey.keyGrip()), QString::fromStdString(serialNumber()))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment