X-Git-Url: http://the.earth.li/gitweb/?a=blobdiff_plain;f=keydb_hkp.c;h=0c6fd5a97f97f7eb50eecbe5a8d564430d3150e3;hb=ce50ec7c87838b4c5444d8846caa372c8e82fa0d;hp=7c7b31a4a50e75bc7acc290bb6333e81c8c07cf7;hpb=8e0907be1d73011075a99a0c029c56664e12843e;p=onak.git diff --git a/keydb_hkp.c b/keydb_hkp.c index 7c7b31a..0c6fd5a 100644 --- a/keydb_hkp.c +++ b/keydb_hkp.c @@ -52,7 +52,7 @@ static int hkp_parse_url(struct onak_hkp_dbctx *privctx, const char *url) &port); if (matched < 2) { proto[0] = 0; - matched = sscanf(url, "%256[a-zA-Z0-9.]:%u", host, &port); + sscanf(url, "%256[a-zA-Z0-9.]:%u", host, &port); } if (host[0] == 0) { @@ -163,7 +163,7 @@ static int hkp_fetch_key_id(struct onak_dbctx *dbctx, * hkp_fetch_key_fp - Given a fingerprint fetch the key from HKP server. */ static int hkp_fetch_key_fp(struct onak_dbctx *dbctx, - uint8_t *fp, size_t fpsize, + struct openpgp_fingerprint *fingerprint, struct openpgp_publickey **publickey, bool intrans) { @@ -171,19 +171,19 @@ static int hkp_fetch_key_fp(struct onak_dbctx *dbctx, char keyurl[1024]; int i, ofs; - if (fpsize > MAX_FINGERPRINT_LEN) { + if (fingerprint->length > MAX_FINGERPRINT_LEN) { return 0; } ofs = snprintf(keyurl, sizeof(keyurl), "%s/lookup?op=get&search=0x", privctx->hkpbase); - if ((ofs + fpsize * 2 + 1)> sizeof(keyurl)) { + if ((ofs + fingerprint->length * 2 + 1)> sizeof(keyurl)) { return 0; } - for (i = 0; i < fpsize; i++) { - ofs += sprintf(&keyurl[ofs], "%02X", fp[i]); + for (i = 0; i < fingerprint->length; i++) { + ofs += sprintf(&keyurl[ofs], "%02X", fingerprint->fp[i]); } return (hkp_fetch_key_url(dbctx, keyurl, publickey, intrans));