From: Andrew Engelbrecht Date: Sun, 19 Jul 2015 21:44:26 +0000 (-0400) Subject: add imported keys to list of keys for encryption X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ec1e779ae3edf12d6575c1885a8764e48f7940ac;p=edward.git add imported keys to list of keys for encryption only one will be used. --- diff --git a/edward b/edward index fb92076..d4321a8 100755 --- a/edward +++ b/edward @@ -106,7 +106,7 @@ def email_decode_flatten (email_text, gpgme_ctx): keys += more_keys elif content_type == "application/pgp-keys": - add_gpg_keys(payload, gpgme_ctx) + keys += add_gpg_keys(payload, gpgme_ctx) elif content_type == "text/plain": body += payload + "\n" @@ -158,14 +158,20 @@ def add_gpg_keys (text, gpgme_ctx): '-----BEGIN PGP PUBLIC KEY BLOCK-----', '-----END PGP PUBLIC KEY BLOCK-----') + fps = [] for key in keys: fp = io.BytesIO(key.encode('ascii')) result = gpgme_ctx.import_(fp) - fingerprint = result.imports[0][0] + fingerprint = result.imports[0][0] debug("added gpg key: " + fingerprint) + fps += fingerprint + + return fps + + def decrypt_text (gpg_text, gpgme_ctx): body = ""