add imported keys to list of keys for encryption
authorAndrew Engelbrecht <sudoman@ninthfloor.org>
Sun, 19 Jul 2015 21:44:26 +0000 (17:44 -0400)
committerAndrew Engelbrecht <sudoman@ninthfloor.org>
Mon, 7 Dec 2015 18:16:28 +0000 (13:16 -0500)
only one will be used.

edward

diff --git a/edward b/edward
index fb92076d46af04bb17624504797873f8f1177fd9..d4321a85f797c5078c9357119fb7d2ad5e2de06a 100755 (executable)
--- 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 = ""