diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-08-08 11:18:41 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-08-08 11:18:41 -0300 |
commit | 14fbcb055fcc2084e11497c53deb1b523ed85f32 (patch) | |
tree | 983363316a985beb674180877c90cb84989d1f5a /src/leap/mail/smtp/smtprelay.py | |
parent | 2d61fd7a27aad51092ccf831c76ce1cd993dacd1 (diff) | |
parent | a46b3fcea0db6a3545e955a1c4cb648750d93974 (diff) |
Merge remote-tracking branch 'drebs/feature/3397-keymanager-should-support-bundled-gpg' into develop
Diffstat (limited to 'src/leap/mail/smtp/smtprelay.py')
-rw-r--r-- | src/leap/mail/smtp/smtprelay.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/leap/mail/smtp/smtprelay.py b/src/leap/mail/smtp/smtprelay.py index e5a5614..5211d8e 100644 --- a/src/leap/mail/smtp/smtprelay.py +++ b/src/leap/mail/smtp/smtprelay.py @@ -34,11 +34,7 @@ from email.parser import Parser from leap.common.check import leap_assert, leap_assert_type from leap.keymanager import KeyManager -from leap.keymanager.openpgp import ( - OpenPGPKey, - encrypt_asym, - sign, -) +from leap.keymanager.openpgp import OpenPGPKey from leap.keymanager.errors import KeyNotFound @@ -296,12 +292,13 @@ class CtxFactory(ssl.ClientContextFactory): self.key = key def getContext(self): - self.method = SSL.TLSv1_METHOD #SSLv23_METHOD + self.method = SSL.TLSv1_METHOD # SSLv23_METHOD ctx = ssl.ClientContextFactory.getContext(self) ctx.use_certificate_file(self.cert) ctx.use_privatekey_file(self.key) return ctx + class EncryptedMessage(object): """ Receive plaintext from client, encrypt it and send message to a @@ -453,7 +450,7 @@ class EncryptedMessage(object): """ if message.is_multipart() is False: message.set_payload( - encrypt_asym( + self._km.encrypt( message.get_payload(), pubkey, sign=signkey)) else: for msg in message.get_payload(): @@ -472,7 +469,7 @@ class EncryptedMessage(object): """ if message.is_multipart() is False: message.set_payload( - sign( + self._km.sign( message.get_payload(), signkey)) else: for msg in message.get_payload(): |