fixed key format bug
authorAndrew Engelbrecht <sudoman@ninthfloor.org>
Sun, 19 Jul 2015 22:32:24 +0000 (18:32 -0400)
committerAndrew Engelbrecht <sudoman@ninthfloor.org>
Mon, 7 Dec 2015 18:16:28 +0000 (13:16 -0500)
edward

diff --git a/edward b/edward
index d4321a85f797c5078c9357119fb7d2ad5e2de06a..793316ca5d1ab301552774e26d230b7b6c96e11e 100755 (executable)
--- a/edward
+++ b/edward
@@ -154,22 +154,22 @@ def get_email_subpart_info (part):
 
 def add_gpg_keys (text, gpgme_ctx):
 
-    keys = scan_and_grab(text,
-                         '-----BEGIN PGP PUBLIC KEY BLOCK-----',
-                         '-----END PGP PUBLIC KEY BLOCK-----')
+    key_blocks = scan_and_grab(text,
+                               '-----BEGIN PGP PUBLIC KEY BLOCK-----',
+                               '-----END PGP PUBLIC KEY BLOCK-----')
 
-    fps = []
-    for key in keys:
-        fp = io.BytesIO(key.encode('ascii'))
+    keys = []
+    for key_block in key_blocks:
+        fp = io.BytesIO(key_block.encode('ascii'))
 
         result = gpgme_ctx.import_(fp)
 
         fingerprint = result.imports[0][0]
         debug("added gpg key: " + fingerprint)
 
-        fps += fingerprint
+        keys += [gpgme_ctx.get_key(fingerprint)]
 
-    return fps
+    return keys
 
 
 def decrypt_text (gpg_text, gpgme_ctx):