]> the.earth.li Git - onak.git/blobdiff - keydb.c
Remove unused worddb_cmp() from DB4 backend
[onak.git] / keydb.c
diff --git a/keydb.c b/keydb.c
index f8d5a0bd8ef60248157542ee55ec356a06a0ae4d..1a882386bf25933c4ea4ae5fa47853301ce5bd6b 100644 (file)
--- a/keydb.c
+++ b/keydb.c
@@ -155,33 +155,6 @@ struct ll *generic_cached_getkeysigs(struct onak_dbctx *dbctx, uint64_t keyid)
        return key->sigs;
 }
 
-#ifdef NEED_GETFULLKEYID
-/**
- *     getfullkeyid - Maps a 32bit key id to a 64bit one.
- *     @keyid: The 32bit keyid.
- *
- *     This function maps a 32bit key id to the full 64bit one. It returns the
- *     full keyid. If the key isn't found a keyid of 0 is returned.
- */
-uint64_t generic_getfullkeyid(struct onak_dbctx *dbctx, uint64_t keyid)
-{
-       struct openpgp_publickey *publickey = NULL;
-
-       if (keyid < 0x100000000LL) {
-               dbctx->fetch_key_id(dbctx, keyid, &publickey, false);
-               if (publickey != NULL) {
-                       get_keyid(publickey, &keyid);
-                       free_publickey(publickey);
-                       publickey = NULL;
-               } else {
-                       keyid = 0;
-               }
-       }
-       
-       return keyid;
-}
-#endif
-
 #ifdef NEED_UPDATEKEYS
 /**
  *     update_keys - Takes a list of public keys and updates them in the DB.
@@ -200,17 +173,16 @@ int generic_update_keys(struct onak_dbctx *dbctx,
        struct openpgp_publickey *curkey = NULL;
        struct openpgp_publickey *oldkey = NULL;
        struct openpgp_publickey *prev = NULL;
+       struct openpgp_fingerprint fp;
        int newkeys = 0;
        bool intrans;
-       uint64_t keyid;
 
        for (curkey = *keys; curkey != NULL; curkey = curkey->next) {
                intrans = dbctx->starttrans(dbctx);
-               get_keyid(curkey, &keyid);
+               get_fingerprint(curkey->publickey, &fp);
                logthing(LOGTHING_INFO,
-                       "Fetching key 0x%" PRIX64 ", result: %d",
-                       keyid,
-                       dbctx->fetch_key_id(dbctx, keyid, &oldkey,
+                       "Fetching key, result: %d",
+                       dbctx->fetch_key_fp(dbctx, &fp, &oldkey,
                                        intrans));
 
                /*