Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Paste
P12
Fallback for keys with keyid but no finterprint value in gpgme
Active
Public
Actions
Authored by
aheinecke
on May 19 2021, 1:19 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Tags
None
Subscribers
None
diff --git a/lang/cpp/src/key.cpp b/lang/cpp/src/key.cpp
index b893a7cd..9d9f4615 100644
--- a/lang/cpp/src/key.cpp
+++ b/lang/cpp/src/key.cpp
@@ -292,10 +292,14 @@ const char *Key::primaryFingerprint() const
/* Return what gpgme thinks is the primary fingerprint */
return key->fpr;
}
- if (key->subkeys) {
+ if (key->subkeys && key->subkeys->fpr) {
/* Return the first subkeys fingerprint */
return key->subkeys->fpr;
}
+ if (key->subkeys && key->subkeys->keyid) {
+ /* When no fingerprint is available use the first subkeys keyid */
+ return key->subkeys->keyid;
+ }
return nullptr;
}
Event Timeline
aheinecke
created this paste.
May 19 2021, 1:19 PM
2021-05-19 13:19:44 (UTC+2)
werner
mentioned this in
rGa4e04375e84e: sm: Rework the PKCS#12 parser to support DFN issued keys.
.
Jun 20 2022, 5:34 PM
2022-06-20 17:34:53 (UTC+2)
ikloecker
mentioned this in
T5713: Kleopatra: PKCS#12 Import no Error on bad passphrase
.
Sep 9 2022, 6:25 PM
2022-09-09 18:25:20 (UTC+2)
Log In to Comment