diff options
author | drebs <drebs@leap.se> | 2013-08-08 15:33:33 +0200 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-08-08 16:00:15 +0200 |
commit | a46b3fcea0db6a3545e955a1c4cb648750d93974 (patch) | |
tree | e05e6d02114bbe9f144ab5935f749c39398663d7 /src/leap/mail/smtp/smtprelay.py | |
parent | efe498757821622f4f0661a3ed13babb9c41aa02 (diff) |
Update use of keymanager API.
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(): |