From 87fcc7d6a81f4722803909f68b517c9e54253fdc Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 4 Jun 2015 09:59:52 +0200 Subject: [PATCH] If pkg signature verification files, remove pkg archive and its signature file. --- lib/transaction_commit.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/transaction_commit.c b/lib/transaction_commit.c index 3de305de..b018e5d3 100644 --- a/lib/transaction_commit.c +++ b/lib/transaction_commit.c @@ -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; }