Redo how the repository keys are stored.

- Repository keys are now stored in a new directory on metadir (/var/db/xbps):

	<metadir>/key>

- Repository keys are stored with the hex fingerprint of its RSA
  public key in a plist dictionary:

	<metadir>/keys/xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.plist

- Drop xbps-rkeys(8) and merge its functionality into xbps-install(8) and
  xbps-query(8).

- xbps-query(8) -vL now shows some more details of remote repositories:

 3134 http://localhost:8000 (RSA signed, verified)
      Signed-by: Void Linux
      4096 60:ae:0c:d6:f0:95:17:80:bc:93:46:7a:89:af:a3:2d
   16 http://localhost:8000/nonfree (RSA signed, verified)
      Signed-by: Void Linux
      4096 60:ae:0c:d6:f0:95:17:80:bc:93:46:7a:89:af:a3:2d

Bump XBPS_API_VERSION.
This commit is contained in:
Juan RP
2013-11-18 16:05:46 +01:00
parent c9825feb29
commit 8882b0215f
22 changed files with 183 additions and 509 deletions

View File

@ -76,6 +76,18 @@ unpack_progress_cb(struct xbps_unpack_cb_data *xpd, void *cbdata _unused)
xpd->entry_size);
}
static int
repo_import_key_cb(struct xbps_repo *repo, void *arg _unused, bool *done _unused)
{
int rv;
if ((rv = xbps_repo_key_import(repo)) != 0)
fprintf(stderr, "Failed to import pubkey from %s: %s\n",
repo->uri, strerror(rv));
return rv;
}
int
main(int argc, char **argv)
{
@ -190,10 +202,13 @@ main(int argc, char **argv)
maxcols = get_maxcols();
/* Sync remote repository data by default */
/* Sync remote repository data and import keys from remote repos */
if (sync && !drun) {
if ((rv = xbps_rpool_sync(&xh, NULL)) != 0)
exit(rv);
rv = xbps_rpool_foreach(&xh, repo_import_key_cb, NULL);
if (rv != 0)
exit(rv);
}
if (sync && !update && (argc == optind))

View File

@ -48,10 +48,10 @@ state_cb(struct xbps_state_cb_data *xscd, void *cbdata _unused)
switch (xscd->state) {
/* notifications */
case XBPS_STATE_REPO_SIGVERIFIED:
printf("[*] RSA signature verified correctly\n");
printf("[*] %s: RSA signature verified\n", xscd->arg);
break;
case XBPS_STATE_REPO_SIGUNVERIFIED:
printf("[*] RSA signature UNVERIFIED! ignoring...\n");
printf("[*] %s: RSA signature invalid! ignoring...\n", xscd->arg);
break;
case XBPS_STATE_TRANS_DOWNLOAD:
printf("\n[*] Downloading binary packages\n");
@ -130,6 +130,11 @@ state_cb(struct xbps_state_cb_data *xscd, void *cbdata _unused)
"(rootdir: %s).", xscd->arg,
xscd->xhp->rootdir);
break;
case XBPS_STATE_REPO_KEY_IMPORT:
printf("%s\n", xscd->desc);
printf("Fingerprint: %s\n", xscd->arg);
rv = yesno("Do you want to import this public key?");
break;
/* errors */
case XBPS_STATE_UNPACK_FAIL:
case XBPS_STATE_UPDATE_FAIL:

View File

@ -110,8 +110,7 @@ Default cache directory to store downloaded binary packages.
.Xr xbps-query 8 ,
.Xr xbps-reconfigure 8 ,
.Xr xbps-remove 8 ,
.Xr xbps-rindex 8 ,
.Xr xbps-rkeys 8
.Xr xbps-rindex 8
.Sh AUTHORS
.An Juan Romero Pardines <xtraeme@gmail.com>
.Sh BUGS