]> the.earth.li Git - onak.git/blobdiff - keydb_keyd.c
Don't store a key if we can't get the keyid
[onak.git] / keydb_keyd.c
index 26f2f2797a1465627a195983f221953a0c8d0fff..4820ee31d9a0a364f0e15f7670dedaf0767a98e8 100644 (file)
@@ -274,7 +274,10 @@ static int keyd_store_key(struct openpgp_publickey *publickey, bool intrans,
        uint32_t                    cmd = KEYD_CMD_STORE;
        uint64_t                    keyid;
 
-       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 (update) {
                keyd_delete_key(keyid, false);