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
This commit is contained in:
parent
b088d81cef
commit
4d87ea2851
@ -337,6 +337,10 @@ const Key &Key::mergeWith(const Key &other)
|
|||||||
for (gpgme_sub_key_t hissk = him->subkeys ; hissk ; hissk = hissk->next) {
|
for (gpgme_sub_key_t hissk = him->subkeys ; hissk ; hissk = hissk->next) {
|
||||||
if (strcmp(mysk->fpr, hissk->fpr) == 0) {
|
if (strcmp(mysk->fpr, hissk->fpr) == 0) {
|
||||||
mysk->is_cardkey |= hissk->is_cardkey;
|
mysk->is_cardkey |= hissk->is_cardkey;
|
||||||
|
mysk->secret |= hissk->secret;
|
||||||
|
if (hissk->keygrip && !mysk->keygrip) {
|
||||||
|
mysk->keygrip = strdup(hissk->keygrip);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user