From ec1e779ae3edf12d6575c1885a8764e48f7940ac Mon Sep 17 00:00:00 2001 From: Andrew Engelbrecht Date: Sun, 19 Jul 2015 17:44:26 -0400 Subject: [PATCH] add imported keys to list of keys for encryption only one will be used. --- edward | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 = "" -- 2.25.1