]> the.earth.li Git - onak.git/blobdiff - keydb_db4.c
Don't store a key if we can't get the keyid
[onak.git] / keydb_db4.c
index 0507511ea90098ff2df788b51969b88c70c7ea9a..f4fffa58849b90e7c5f4f0cc93e28b05f29d1300 100644 (file)
@@ -1180,7 +1180,10 @@ static int db4_store_key(struct openpgp_publickey *publickey, bool intrans,
        bool       deadlock = false;
        struct skshash hash;
 
-       get_keyid(publickey, &keyid);
+       if (get_keyid(publickey, &keyid) != ONAK_E_OK) {
+               logthing(LOGTHING_ERROR, "Couldn't find key ID for key.");
+               return 0;
+       }
 
        if (!intrans) {
                db4_starttrans();