diff options
author | Thais Siqueira <thais.siqueira@gmail.com> | 2016-05-16 17:38:46 -0300 |
---|---|---|
committer | Thais Siqueira <thais.siqueira@gmail.com> | 2016-05-16 17:38:46 -0300 |
commit | 64f1342d0f8ab27a95624b561b52eb8c2003e771 (patch) | |
tree | 3a11bc9319d4857084b35acdf1cc02e527c4557f | |
parent | d3d51359fa70decf6d26dd71fc6f0a4ec66e35e8 (diff) |
[bug] verify signature of encrypted email from Apple Mail
Fix verify signature on encrypted email from Apple Mail, adding a step
to verify signature after decrypt the email because the keymananger
could not verify signature when decrypting it
-rw-r--r-- | src/leap/mail/incoming/service.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/leap/mail/incoming/service.py b/src/leap/mail/incoming/service.py index c7d194d..f60921a 100644 --- a/src/leap/mail/incoming/service.py +++ b/src/leap/mail/incoming/service.py @@ -524,10 +524,20 @@ class IncomingMail(Service): self._add_decrypted_header(msg) return (msg, signkey) + def verify_signature_after_decrypt_an_email(res): + decrdata, signkey = res + if not isinstance(signkey, OpenPGPKey): + try: + return self._verify_signature_not_encrypted_msg(decrdata, senderAddress) + except: + pass + return res + d = self._keymanager.decrypt( encdata, self._userid, OpenPGPKey, verify=senderAddress) d.addCallbacks(build_msg, self._decryption_error, errbackArgs=(msg,)) + d.addCallbacks(verify_signature_after_decrypt_an_email) return d def _maybe_decrypt_inline_encrypted_msg(self, origmsg, encoding, |