]> the.earth.li Git - onak.git/blobdiff - keydb_pg.c
Don't store a key if we can't get the keyid
[onak.git] / keydb_pg.c
index 1ec0a1a570e16fb0c71397a7055b2207dc213944..480f1f1d34541831c6e3fd414785867d0a2c3ed1 100644 (file)
@@ -376,7 +376,10 @@ static int pg_store_key(struct openpgp_publickey *publickey, bool intrans,
                PQclear(result);
        }
 
-       get_keyid(publickey, &keyid);
+       if (get_keyid(publickey, &keyid) != ONAK_E_OK) {
+               logthing(LOGTHING_ERROR, "Couldn't find key ID for key.");
+               return 0;
+       }
 
        /*
         * Delete the key if we already have it.