- key.size = sizeof(keyid);
- key.data = &keyid;
-
- ret = privctx->id64db->get(privctx->id64db,
- privctx->txn,
- &key,
- &data,
- 0); /* flags*/
-
- if (ret == 0) {
- /* We got a match; retrieve the actual key */
- fingerprint.length = data.size;
-
- memset(&key, 0, sizeof(key));
- memset(&data, 0, sizeof(data));
- key.size = fingerprint.length;
- key.data = fingerprint.fp;
-
- ret = keydb_fp(privctx, &fingerprint)->get(
- keydb_fp(privctx, &fingerprint),
- privctx->txn,
- &key,
- &data,
- 0); /* flags*/
- }
- }
-
- if (ret == 0) {
- fetchbuf.buffer = data.data;
- fetchbuf.offset = 0;
- fetchbuf.size = data.size;
- read_openpgp_stream(buffer_fetchchar, &fetchbuf,
- &packets, 0);
- parse_keys(packets, publickey);
- free_packet_list(packets);
- packets = NULL;
- numkeys++;
- } else if (ret != DB_NOTFOUND) {
- logthing(LOGTHING_ERROR,
- "Problem retrieving key: %s",
- db_strerror(ret));