summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorThais Siqueira <thais.siqueira@gmail.com>2016-05-16 17:38:46 -0300
committerThais Siqueira <thais.siqueira@gmail.com>2016-05-16 17:38:46 -0300
commit9d44862908f521850eaf420cfcdac733d030113d (patch)
treed19d39807189ce331c82ab7d1f8c1efdd37050e5 /mail
parenta3ce6051caa3a515913a4bb25c13c355b72f7df4 (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
Diffstat (limited to 'mail')
-rw-r--r--mail/src/leap/mail/incoming/service.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/mail/src/leap/mail/incoming/service.py b/mail/src/leap/mail/incoming/service.py
index c7d194d..f60921a 100644
--- a/mail/src/leap/mail/incoming/service.py
+++ b/mail/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,