summaryrefslogtreecommitdiff
path: root/src/pacman/package.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-07-01 16:50:32 -0500
committerDan McGee <dan@archlinux.org>2011-07-05 10:13:20 -0500
commit07502f2d82393854f36f5c3ff608458e74fcb747 (patch)
tree24ec485afd9feceeebf326566b323a974a939cd1 /src/pacman/package.c
parente8443b1685cc99cf3a46461e7a12c9b616fac44e (diff)
Allow frontend access to signature verification information
Show output in -Qip for each package signature, which includes the UID string from the key ("Joe User <joe@example.com>") and the validity of said key. Example output: Signatures : Valid signature from "Dan McGee <dpmcgee@gmail.com>" Unknown signature from "<Key Unknown>" Invalid signature from "Dan McGee <dpmcgee@gmail.com>" Also add a backend alpm_sigresult_cleanup() function since memory allocation took place on this object, and we need some way of freeing it. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/package.c')
-rw-r--r--src/pacman/package.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pacman/package.c b/src/pacman/package.c
index 5514f001..afbac6b7 100644
--- a/src/pacman/package.c
+++ b/src/pacman/package.c
@@ -136,6 +136,17 @@ void dump_pkg_full(alpm_pkg_t *pkg, enum pkg_from from, int extra)
if(from == PKG_FROM_SYNCDB) {
string_display(_("MD5 Sum :"), alpm_pkg_get_md5sum(pkg));
}
+ if(from == PKG_FROM_FILE) {
+ alpm_sigresult_t result;
+ int err = alpm_pkg_check_pgp_signature(pkg, &result);
+ if(err) {
+ string_display(_("Signatures :"),
+ alpm_strerror(alpm_errno(config->handle)));
+ } else {
+ signature_display(_("Signatures :"), &result);
+ }
+ alpm_sigresult_cleanup(&result);
+ }
string_display(_("Description :"), alpm_pkg_get_desc(pkg));
/* Print additional package info if info flag passed more than once */