From: Andrew Engelbrecht <sudoman@ninthfloor.org>
Date: Sun, 19 Jul 2015 23:18:26 +0000 (-0400)
Subject: fixed crash when receiving tampered encrypted msgs
X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=afc1f64ce2e0a4ed38555ea20facc8b7c674443d;p=edward.git

fixed crash when receiving tampered encrypted msgs

edward now shouldn't crash when receiving a corrupted gpg encryption
block.
---

diff --git a/edward b/edward
index d022149..cd58536 100755
--- a/edward
+++ b/edward
@@ -222,7 +222,10 @@ def decrypt_block (msg_block, gpgme_ctx):
     block_b = io.BytesIO(msg_block.encode('ascii'))
     plain_b = io.BytesIO()
 
-    sigs = gpgme_ctx.decrypt_verify(block_b, plain_b)
+    try:
+        sigs = gpgme_ctx.decrypt_verify(block_b, plain_b)
+    except:
+        return ("",[])
 
     plaintext = plain_b.getvalue().decode('utf-8')
     return (plaintext, sigs)