Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-01-08 12:14:04 -0600
committerDan McGee <dan@archlinux.org>2012-01-08 12:14:04 -0600
commit4f02b98338437b9395addb29000893b91d1ae21e (patch)
tree986568d1e64bea1bde6ff287ed5a2629e7f8136f /lib
parent7f51ba99ae6db204d69ce271cd5cc4e959135738 (diff)
parent73d0d743bda5367fcab2453bbe21c15e481150c2 (diff)
Merge branch 'maint'
Conflicts: lib/libalpm/signing.c Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/remove.c1
-rw-r--r--lib/libalpm/signing.c25
2 files changed, 21 insertions, 5 deletions
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index f5c3c078..bc196510 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -477,7 +477,6 @@ int _alpm_remove_single_package(alpm_handle_t *handle,
}
/* remove the package from the database */
- _alpm_log(handle, ALPM_LOG_DEBUG, "updating database\n");
_alpm_log(handle, ALPM_LOG_DEBUG, "removing database entry '%s'\n", pkgname);
if(_alpm_local_db_remove(handle->db_local, oldpkg) == -1) {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not remove database entry %s-%s\n"),
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index fbb6b134..c4cb077f 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -249,10 +249,24 @@ static int key_search(alpm_handle_t *handle, const char *fpr,
err = gpgme_get_key(ctx, fpr, &key, 0);
if(gpg_err_code(err) == GPG_ERR_EOF) {
_alpm_log(handle, ALPM_LOG_DEBUG, "key lookup failed, unknown key\n");
- ret = 0;
- goto error;
- } else if(gpg_err_code(err) != GPG_ERR_NO_ERROR) {
- _alpm_log(handle, ALPM_LOG_DEBUG, "gpg error: %s\n", gpgme_strerror(err));
+ /* Try an alternate lookup using the 8 character fingerprint value, since
+ * busted-ass keyservers can't support lookups using subkeys with the full
+ * value as of now. This is why 2012 is not the year of PGP encryption. */
+ if(strlen(fpr) > 8) {
+ const char *short_fpr = fpr + strlen(fpr) - 8;
+ _alpm_log(handle, ALPM_LOG_DEBUG,
+ "looking up key %s remotely\n", short_fpr);
+ err = gpgme_get_key(ctx, short_fpr, &key, 0);
+ if(gpg_err_code(err) == GPG_ERR_EOF) {
+ _alpm_log(handle, ALPM_LOG_DEBUG, "key lookup failed, unknown key\n");
+ ret = 0;
+ }
+ } else {
+ ret = 0;
+ }
+ }
+
+ if(gpg_err_code(err) != GPG_ERR_NO_ERROR) {
goto error;
}
@@ -293,6 +307,9 @@ static int key_search(alpm_handle_t *handle, const char *fpr,
ret = 1;
error:
+ if(ret != 1) {
+ _alpm_log(handle, ALPM_LOG_DEBUG, "gpg error: %s\n", gpgme_strerror(err));
+ }
gpgme_release(ctx);
return ret;
}