xbps_repo_open: just call xbps_pubkey2fp() if pubkey is valid (issue #27).

This commit is contained in:
Juan RP 2014-01-06 10:01:49 +01:00
parent b61f552562
commit 29cf8e9ba8

View File

@ -163,12 +163,14 @@ xbps_repo_open(struct xbps_handle *xhp, const char *url)
goto out;
}
if ((meta = repo_get_dict(repo))) {
repo->is_signed = true;
xbps_dictionary_get_cstring_nocopy(meta, "signature-by", &repo->signedby);
repo->pubkey = xbps_dictionary_get(meta, "public-key");
xbps_dictionary_get_uint16(meta, "public-key-size", &repo->pubkey_size);
repo->pubkey = xbps_dictionary_get(meta, "public-key");
if (repo->pubkey) {
repo->is_signed = true;
repo->hexfp = xbps_pubkey2fp(repo->xhp, repo->pubkey);
}
}
out:
free(repofile);