If pkg signature verification files, remove pkg archive and its signature file.

This commit is contained in:
Juan RP 2015-06-04 09:59:52 +02:00
parent 92c07c126f
commit 87fcc7d6a8

View File

@ -95,9 +95,16 @@ check_binpkgs(struct xbps_handle *xhp, xbps_object_iterator_t iter)
"%s: verifying RSA signature...", pkgver);
if (!xbps_verify_file_signature(repo, binfile)) {
char *sigfile;
rv = EPERM;
xbps_set_cb_state(xhp, XBPS_STATE_VERIFY_FAIL, rv, pkgver,
"%s: the RSA signature is not valid!", pkgver);
xbps_set_cb_state(xhp, XBPS_STATE_VERIFY_FAIL, rv, pkgver,
"%s: removed pkg archive and its signature.", pkgver);
(void)remove(binfile);
sigfile = xbps_xasprintf("%s.sig", binfile);
(void)remove(sigfile);
free(sigfile);
free(binfile);
break;
}