]> the.earth.li Git - onak.git/blobdiff - keydb_fs.c
Don't store a key if we can't get the keyid
[onak.git] / keydb_fs.c
index eacf1c65b15cf1dae48c79e9e59f52503655f873..b7117bebab4ffeda8f4bf36a2b650eb3c600a256 100644 (file)
@@ -336,7 +336,10 @@ static int fs_store_key(struct openpgp_publickey *publickey, bool intrans,
        uint32_t hashid;
        int i = 0;
 
-       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)
                fs_starttrans();