cpp: Ensure that hasSecret is correct after update
* lang/cpp/src/key.cpp (Key::update): Check for a secret key first before listing public keys. -- This is a performance delay but the update should only be called in a non gui thread anyway. The information if we have the secret key for this key is important to provide after update.
This commit is contained in:
parent
85e05537e1
commit
da5343a9d2
@ -341,7 +341,12 @@ void Key::update()
|
||||
KeyListMode::Validate |
|
||||
KeyListMode::WithTofu);
|
||||
Error err;
|
||||
auto newKey = ctx->key(primaryFingerprint(), err, hasSecret());
|
||||
auto newKey = ctx->key(primaryFingerprint(), err, true);
|
||||
// Not secret so we get the information from the pubring.
|
||||
if (newKey.isNull())
|
||||
{
|
||||
newKey = ctx->key(primaryFingerprint(), err, false);
|
||||
}
|
||||
delete ctx;
|
||||
if (err) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user