static int hkp_fetch_key_url(struct onak_dbctx *dbctx,
char *url,
struct openpgp_publickey **publickey,
- bool intrans)
+ __unused bool intrans)
{
struct onak_hkp_dbctx *privctx = (struct onak_hkp_dbctx *) dbctx->priv;
struct openpgp_packet_list *packets = NULL;
return count;
}
-/**
- * hkp_fetch_key_id - Given a keyid fetch the key from HKP server.
- */
-static int hkp_fetch_key_id(struct onak_dbctx *dbctx,
- uint64_t keyid,
- struct openpgp_publickey **publickey,
- bool intrans)
-{
- struct onak_hkp_dbctx *privctx = (struct onak_hkp_dbctx *) dbctx->priv;
- char keyurl[1024];
-
- snprintf(keyurl, sizeof(keyurl),
- "%s/lookup?op=get&search=0x%08" PRIX64,
- privctx->hkpbase, keyid);
-
- return (hkp_fetch_key_url(dbctx, keyurl, publickey, intrans));
-}
-
/**
* hkp_fetch_key_fp - Given a fingerprint fetch the key from HKP server.
*/
static int hkp_fetch_key_fp(struct onak_dbctx *dbctx,
struct openpgp_fingerprint *fingerprint,
struct openpgp_publickey **publickey,
- bool intrans)
+ __unused bool intrans)
{
struct onak_hkp_dbctx *privctx = (struct onak_hkp_dbctx *) dbctx->priv;
char keyurl[1024];
return (hkp_fetch_key_url(dbctx, keyurl, publickey, intrans));
}
+/**
+ * hkp_fetch_key_id - Given a keyid fetch the key from HKP server.
+ */
+static int hkp_fetch_key_id(struct onak_dbctx *dbctx,
+ uint64_t keyid,
+ struct openpgp_publickey **publickey,
+ bool intrans)
+{
+ struct onak_hkp_dbctx *privctx = (struct onak_hkp_dbctx *) dbctx->priv;
+ char keyurl[1024];
+
+ snprintf(keyurl, sizeof(keyurl),
+ "%s/lookup?op=get&search=0x%08" PRIX64,
+ privctx->hkpbase, keyid);
+
+ return (hkp_fetch_key_url(dbctx, keyurl, publickey, intrans));
+}
+
/**
* fetch_key_text - Tries to find the keys that contain the supplied text.
* @search: The text to search for.
*
*/
static int hkp_store_key(struct onak_dbctx *dbctx,
- struct openpgp_publickey *publickey, bool intrans,
- bool update)
+ struct openpgp_publickey *publickey,
+ __unused bool intrans,
+ __unused bool update)
{
struct onak_hkp_dbctx *privctx = (struct onak_hkp_dbctx *) dbctx->priv;
struct openpgp_packet_list *packets = NULL;
*
* No op for HKP.
*/
-static int hkp_delete_key(struct onak_dbctx *dbctx,
- struct openpgp_fingerprint *fp, bool intrans)
+static int hkp_delete_key(__unused struct onak_dbctx *dbctx,
+ __unused struct openpgp_fingerprint *fp, __unused bool intrans)
{
return -1;
}
*
* Not applicable for HKP backend.
*/
-static int hkp_iterate_keys(struct onak_dbctx *dbctx,
- void (*iterfunc)(void *ctx, struct openpgp_publickey *key),
- void *ctx)
+static int hkp_iterate_keys(__unused struct onak_dbctx *dbctx,
+ __unused void (*iterfunc)(void *ctx, struct openpgp_publickey *key),
+ __unused void *ctx)
{
return 0;
}
*
* This is just a no-op for HKP access.
*/
-static bool hkp_starttrans(struct onak_dbctx *dbctx)
+static bool hkp_starttrans(__unused struct onak_dbctx *dbctx)
{
return true;
}
*
* This is just a no-op for HKP access.
*/
-static void hkp_endtrans(struct onak_dbctx *dbctx)
+static void hkp_endtrans(__unused struct onak_dbctx *dbctx)
{
return;
}
#define NEED_KEYID2UID 1
#define NEED_GETKEYSIGS 1
#define NEED_UPDATEKEYS 1
+#define NEED_GET 1
#include "keydb.c"
/**
*
* We initialize CURL here.
*/
-struct onak_dbctx *keydb_hkp_init(struct onak_db_config *dbcfg, bool readonly)
+struct onak_dbctx *keydb_hkp_init(struct onak_db_config *dbcfg,
+ __unused bool readonly)
{
struct onak_dbctx *dbctx;
struct onak_hkp_dbctx *privctx;
dbctx->cleanupdb = hkp_cleanupdb;
dbctx->starttrans = hkp_starttrans;
dbctx->endtrans = hkp_endtrans;
- dbctx->fetch_key_id = hkp_fetch_key_id;
+ dbctx->fetch_key = generic_fetch_key;
dbctx->fetch_key_fp = hkp_fetch_key_fp;
+ dbctx->fetch_key_id = hkp_fetch_key_id;
dbctx->fetch_key_text = hkp_fetch_key_text;
dbctx->store_key = hkp_store_key;
dbctx->update_keys = generic_update_keys;