Skip to content

Commit

Permalink
jcat-context: don't fail verification if compiled without an engine
Browse files Browse the repository at this point in the history
libjcat can be compiled with both gpg and pkcs7, but if it's compiled
without one then blobs signed with both can't be verified.

```
Jcat engine kind 'gpg' not supported
```
  • Loading branch information
Mario Limonciello authored and superm1 committed Oct 22, 2020
1 parent 06d93c2 commit 109399e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libjcat/jcat-context.c
Expand Up @@ -302,9 +302,11 @@ jcat_context_verify_item (JcatContext *self,
g_autoptr(JcatEngine) engine = NULL;
g_autoptr(JcatResult) result = NULL;

engine = jcat_context_get_engine (self, jcat_blob_get_kind (blob), error);
if (engine == NULL)
return NULL;
engine = jcat_context_get_engine (self, jcat_blob_get_kind (blob), &error_local);
if (engine == NULL) {
g_debug ("%s", error_local->message);
continue;
}
if (jcat_engine_get_method (engine) != JCAT_BLOB_METHOD_SIGNATURE)
continue;
result = jcat_engine_pubkey_verify (engine, data, jcat_blob_get_data (blob), flags, &error_local);
Expand Down

0 comments on commit 109399e

Please sign in to comment.