diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2018-03-12 11:12:56 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2018-03-12 11:12:56 -0700 |
commit | d3f87ad82432a773cc69808135454f6bb104880e (patch) | |
tree | 2597d3068ff0b017bb1ad2e3331f01c3fa4cafbb | |
parent | 10b46df578f08f54f879d561ccc7d061569fa7b4 (diff) | |
parent | 9e2cd32ab0b7a1906c2cf47f594a70fcaf901502 (diff) |
Merge branch 'master' into py3k
-rw-r--r-- | alot/commands/__init__.py | 2 | ||||
-rw-r--r-- | alot/crypto.py | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/alot/commands/__init__.py b/alot/commands/__init__.py index bcd27c07..0887a76a 100644 --- a/alot/commands/__init__.py +++ b/alot/commands/__init__.py @@ -24,7 +24,7 @@ class Command(object): self.undoable = False self.help = self.__doc__ - def apply(self, caller): + def apply(self, ui): """code that gets executed when this command is applied""" pass diff --git a/alot/crypto.py b/alot/crypto.py index 9d7d89ec..247dbd19 100644 --- a/alot/crypto.py +++ b/alot/crypto.py @@ -218,13 +218,15 @@ def decrypt_verify(encrypted): """ ctx = gpg.core.Context() try: - (plaintext, _, verify_result) = ctx.decrypt( - encrypted, verify=True) + plaintext, _, verify_result = ctx.decrypt(encrypted, verify=True) + sigs = verify_result.signatures except gpg.errors.GPGMEError as e: raise GPGProblem(str(e), code=e.getcode()) - # what if the signature is bad? + except gpg.errors.BadSignatures as e: + plaintext, _, _ = ctx.decrypt(encrypted, verify=False) + sigs = e.result.signatures - return verify_result.signatures, plaintext + return sigs, plaintext def validate_key(key, sign=False, encrypt=False): |