Sign repodata

This commit is contained in:
Piotr Wójcik
2019-10-01 21:18:25 +02:00
committed by Juan RP
parent 6886a73288
commit 04194f44c8
8 changed files with 122 additions and 20 deletions

View File

@@ -57,7 +57,7 @@ set_build_date(const xbps_dictionary_t pkgd, time_t timestamp)
static bool
repodata_commit(struct xbps_handle *xhp, const char *repodir,
xbps_dictionary_t idx, xbps_dictionary_t meta, xbps_dictionary_t stage,
const char *compression)
const char *compression, const char *privkey)
{
xbps_object_iterator_t iter;
xbps_object_t keysym;
@@ -189,7 +189,7 @@ repodata_commit(struct xbps_handle *xhp, const char *repodir,
printf("stage: added `%s' (%s)\n", pkgver, arch);
}
xbps_object_iterator_release(iter);
rv = repodata_flush(xhp, repodir, "stagedata", stage, NULL, compression);
rv = repodata_flush(xhp, repodir, "stagedata", stage, NULL, compression, privkey);
}
else {
char *stagefile;
@@ -207,7 +207,7 @@ repodata_commit(struct xbps_handle *xhp, const char *repodir,
stagefile = xbps_repo_path_with_name(xhp, repodir, "stagedata");
unlink(stagefile);
free(stagefile);
rv = repodata_flush(xhp, repodir, "repodata", idx, meta, compression);
rv = repodata_flush(xhp, repodir, "repodata", idx, meta, compression, privkey);
}
xbps_object_release(usedshlibs);
xbps_object_release(oldshlibs);
@@ -215,7 +215,7 @@ repodata_commit(struct xbps_handle *xhp, const char *repodir,
}
int
index_add(struct xbps_handle *xhp, int args, int argmax, char **argv, bool force, const char *compression)
index_add(struct xbps_handle *xhp, int args, int argmax, char **argv, bool force, const char *compression, const char *privkey)
{
xbps_dictionary_t idx, idxmeta, idxstage, binpkgd, curpkgd;
struct xbps_repo *repo = NULL, *stage = NULL;
@@ -407,7 +407,7 @@ index_add(struct xbps_handle *xhp, int args, int argmax, char **argv, bool force
/*
* Generate repository data files.
*/
if (!repodata_commit(xhp, repodir, idx, idxmeta, idxstage, compression)) {
if (!repodata_commit(xhp, repodir, idx, idxmeta, idxstage, compression, privkey)) {
fprintf(stderr, "%s: failed to write repodata: %s\n",
_XBPS_RINDEX, strerror(errno));
goto out;