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.
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));
/*