summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alot/crypto.py9
-rw-r--r--tests/crypto_test.py1
2 files changed, 5 insertions, 5 deletions
diff --git a/alot/crypto.py b/alot/crypto.py
index 08213f34..b0849ae2 100644
--- a/alot/crypto.py
+++ b/alot/crypto.py
@@ -202,10 +202,11 @@ def verify_detached(message, signature):
message_data = StringIO(message)
signature_data = StringIO(signature)
ctx = gpgme.Context()
- try:
- return ctx.verify(signature_data, message_data, None)
- except gpgme.GpgmeError as e:
- raise GPGProblem(e.message, code=e.code)
+
+ status = ctx.verify(signature_data, message_data, None)
+ if isinstance(status[0].status, gpgme.GpgmeError):
+ raise GPGProblem(status[0].status.message, code=status[0].status.code)
+ return status
def decrypt_verify(encrypted):
diff --git a/tests/crypto_test.py b/tests/crypto_test.py
index 7afb7a93..51cb48ba 100644
--- a/tests/crypto_test.py
+++ b/tests/crypto_test.py
@@ -88,7 +88,6 @@ class TestSignature(utilities.TestCaseClassCleanup):
except GPGProblem:
raise AssertionError
- @unittest.expectedFailure
def test_verify_signature_bad(self):
to_sign = "this is some text.\nIt's something\n."
similar = "this is some text.\r\n.It's something\r\n."