xbps_repo_key_import: check that returned hex fingerprint is not NULL.
This commit is contained in:
parent
b7d91b490c
commit
89ab9a4b0c
@ -42,7 +42,7 @@ xbps_repo_key_import(struct xbps_repo *repo)
|
|||||||
xbps_dictionary_t repokeyd, newmetad = NULL;
|
xbps_dictionary_t repokeyd, newmetad = NULL;
|
||||||
xbps_data_t rpubkey;
|
xbps_data_t rpubkey;
|
||||||
const char *signedby;
|
const char *signedby;
|
||||||
unsigned char *fp;
|
unsigned char *fp = NULL;
|
||||||
char *rkeypath = NULL;
|
char *rkeypath = NULL;
|
||||||
int import, rv = 0;
|
int import, rv = 0;
|
||||||
|
|
||||||
@ -95,6 +95,13 @@ xbps_repo_key_import(struct xbps_repo *repo)
|
|||||||
* to the client.
|
* to the client.
|
||||||
*/
|
*/
|
||||||
fp = xbps_pubkey2fp(repo->xhp, rpubkey);
|
fp = xbps_pubkey2fp(repo->xhp, rpubkey);
|
||||||
|
if (fp == NULL) {
|
||||||
|
xbps_dbg_printf(repo->xhp,
|
||||||
|
"[repo] `%s': failed to compute hex fingerprint: %s\n",
|
||||||
|
repo->uri, strerror(errno));
|
||||||
|
rv = EINVAL;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
xbps_dictionary_get_cstring_nocopy(repo->meta, "signature-by", &signedby);
|
xbps_dictionary_get_cstring_nocopy(repo->meta, "signature-by", &signedby);
|
||||||
import = xbps_set_cb_state(repo->xhp, XBPS_STATE_REPO_KEY_IMPORT,
|
import = xbps_set_cb_state(repo->xhp, XBPS_STATE_REPO_KEY_IMPORT,
|
||||||
0, (const char *)fp,
|
0, (const char *)fp,
|
||||||
|
Loading…
Reference in New Issue
Block a user