char *primary = NULL;
char *safeuid = NULL;
int i;
+ uint64_t keyid;
if (!intrans) {
result = PQexec(dbconn, "BEGIN");
PQclear(result);
}
+ get_keyid(publickey, &keyid);
+
/*
* Delete the key if we already have it.
*
* it definitely needs updated.
*/
if (update) {
- pg_delete_key(get_keyid(publickey), true);
+ pg_delete_key(keyid, true);
}
next = publickey->next;
snprintf(statement, 1023,
"INSERT INTO onak_keys (keyid, keydata) VALUES "
"('%" PRIX64 "', '%d')",
- get_keyid(publickey),
+ keyid,
key_oid);
result = PQexec(dbconn, statement);
"INSERT INTO onak_uids "
"(keyid, uid, pri) "
"VALUES ('%" PRIX64 "', '%s', '%c')",
- get_keyid(publickey),
+ keyid,
safeuid,
(uids[i] == primary) ? 't' : 'f');
result = PQexec(dbconn, statement);
"INSERT INTO onak_sigs (signer, signee) "
"VALUES ('%" PRIX64 "', '%" PRIX64 "')",
sig_keyid(packets->packet),
- get_keyid(publickey));
+ keyid);
result = PQexec(dbconn, statement);
PQclear(result);
}