diff options
author | Ingo Klöcker <[email protected]> | 2020-09-03 10:20:24 +0000 |
---|---|---|
committer | Ingo Klöcker <[email protected]> | 2020-09-03 10:24:21 +0000 |
commit | 4d87ea2851ae1156cfb1d754cf32b5c9073d4252 (patch) | |
tree | 0266664a3647cb8c1f328511a136b0c42b22b7a2 /lang/cpp/src/key.cpp | |
parent | qt: Fix an rfc2253 parser flaw (diff) | |
download | gpgme-4d87ea2851ae1156cfb1d754cf32b5c9073d4252.tar.gz gpgme-4d87ea2851ae1156cfb1d754cf32b5c9073d4252.zip |
cpp: Copy some more subkey properties when merging keys
* lang/cpp/src/key.cpp (Key::mergeWith): Also merge secret flag and
keygrip
--
The keygrip was lost if the result of a public key listing was merged
with the result of a secret key listing as done by QGpgMEListAllKeysJob.
GnuPG-bug-id: 4794
Diffstat (limited to 'lang/cpp/src/key.cpp')
-rw-r--r-- | lang/cpp/src/key.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lang/cpp/src/key.cpp b/lang/cpp/src/key.cpp index 5d6560b1..cb0c186e 100644 --- a/lang/cpp/src/key.cpp +++ b/lang/cpp/src/key.cpp @@ -337,6 +337,10 @@ const Key &Key::mergeWith(const Key &other) for (gpgme_sub_key_t hissk = him->subkeys ; hissk ; hissk = hissk->next) { if (strcmp(mysk->fpr, hissk->fpr) == 0) { mysk->is_cardkey |= hissk->is_cardkey; + mysk->secret |= hissk->secret; + if (hissk->keygrip && !mysk->keygrip) { + mysk->keygrip = strdup(hissk->keygrip); + } break; } } |