Skip to content

Commit d962eaa

Browse files
committed
lib: remove xhp argument from xbps_pubkey2fp
1 parent 9efba67 commit d962eaa

5 files changed

Lines changed: 9 additions & 7 deletions

File tree

bin/xbps-query/list.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ repo_list_uri(struct xbps_repo *repo)
197197
xbps_dictionary_get_uint16(repo->idxmeta, "public-key-size", &pubkeysize);
198198
pubkey = xbps_dictionary_get(repo->idxmeta, "public-key");
199199
if (pubkey)
200-
hexfp = xbps_pubkey2fp(repo->xhp, pubkey);
200+
hexfp = xbps_pubkey2fp(pubkey);
201201
if (signedby)
202202
printf(" Signed-by: %s\n", signedby);
203203
if (pubkeysize && hexfp)

include/xbps.h.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,13 +2245,12 @@ int xbps_cmpver(const char *pkg1, const char *pkg2);
22452245
/**
22462246
* Converts a RSA public key in PEM format to a hex fingerprint.
22472247
*
2248-
* @param[in] xhp The pointer to an xbps_handle struct.
22492248
* @param[in] pubkey The public-key in PEM format as xbps_data_t.
22502249
*
22512250
* @return The OpenSSH fingerprint in hexadecimal.
22522251
* The returned buffer must be free(3)d when necessary.
22532252
*/
2254-
char *xbps_pubkey2fp(struct xbps_handle *xhp, xbps_data_t pubkey);
2253+
char *xbps_pubkey2fp(xbps_data_t pubkey);
22552254

22562255
/**
22572256
* Returns a buffer with a sanitized path from \a src.

lib/pubkey2fp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fp2str(unsigned const char *fp, unsigned int len)
6363
}
6464

6565
char *
66-
xbps_pubkey2fp(struct xbps_handle *xhp, xbps_data_t pubkey)
66+
xbps_pubkey2fp(xbps_data_t pubkey)
6767
{
6868
EVP_MD_CTX *mdctx = NULL;
6969
EVP_PKEY *pPubKey = NULL;

lib/repo.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,11 @@ xbps_repo_key_import(struct xbps_repo *repo)
655655
rv = EINVAL;
656656
goto out;
657657
}
658-
hexfp = xbps_pubkey2fp(repo->xhp, pubkey);
658+
hexfp = xbps_pubkey2fp(pubkey);
659+
if (hexfp == NULL) {
660+
rv = EINVAL;
661+
goto out;
662+
}
659663
/*
660664
* Check if the public key is alredy stored.
661665
*/

lib/verifysig.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ xbps_verify_signature(struct xbps_repo *repo, const char *sigfile,
8787
xbps_dbg_printf("%s: unsigned repository\n", repo->uri);
8888
return false;
8989
}
90-
hexfp = xbps_pubkey2fp(repo->xhp,
91-
xbps_dictionary_get(repo->idxmeta, "public-key"));
90+
hexfp = xbps_pubkey2fp(xbps_dictionary_get(repo->idxmeta, "public-key"));
9291
if (hexfp == NULL) {
9392
xbps_dbg_printf("%s: incomplete signed repo, missing hexfp obj\n", repo->uri);
9493
return false;

0 commit comments

Comments
 (0)