summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/signing.c
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2012-11-02 16:16:32 +0100
committerAllan McRae <allan@archlinux.org>2013-02-09 03:43:37 +0100
commit5f5469c7746ee1699433060030bbd2e6ee43ced7 (patch)
tree7fa20de201d4480883a2e7984a0ce21d1567e9cf /lib/libalpm/signing.c
parent0d89c10f4b12cb574223a23776c26144c6bceccd (diff)
downloadpacman-5f5469c7746ee1699433060030bbd2e6ee43ced7.tar.gz
pacman-5f5469c7746ee1699433060030bbd2e6ee43ced7.tar.xz
Import key if needed when installing package from file
When installing a package with "pacman -U" that has a detached signature, check if the needed key is in the keyring and download if necessary. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/signing.c')
-rw-r--r--lib/libalpm/signing.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index aa7e134a..a57c9463 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -192,6 +192,11 @@ int _alpm_key_in_keychain(alpm_handle_t *handle, const char *fpr)
gpgme_key_t key;
int ret = -1;
+ if(init_gpgme(handle)) {
+ /* pm_errno was set in gpgme_init() */
+ goto error;
+ }
+
memset(&ctx, 0, sizeof(ctx));
err = gpgme_new(&ctx);
CHECK_ERR();