diff --git a/src/lib/key-provider.cpp b/src/lib/key-provider.cpp index a0ed89d8b..6ef89e324 100644 --- a/src/lib/key-provider.cpp +++ b/src/lib/key-provider.cpp @@ -44,7 +44,7 @@ pgp_key_provider_t::request_key(const pgp_key_request_ctx_t &ctx) const return nullptr; } // confirm that the key actually matches the search criteria - if (!key->matches(ctx.search) && key->is_secret() == ctx.secret) { + if (!key->matches(ctx.search) || (key->is_secret() != ctx.secret)) { return nullptr; } return key;