summaryrefslogtreecommitdiff
path: root/src/leap/mx
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2014-12-22 09:04:29 -0600
committerRuben Pollan <meskio@sindominio.net>2014-12-22 09:04:29 -0600
commit82a2b6d45751d671c593c15144c908b665e955bb (patch)
tree267aa579738c63dbc1dd1860ae389b0c7ebf393d /src/leap/mx
parentd8893584886a593dd6ddcfa1a6930288c7fd8ecc (diff)
Use gpg key directly
_build_key_from_gpg in keymanager has changed
Diffstat (limited to 'src/leap/mx')
-rw-r--r--src/leap/mx/mail_receiver.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/leap/mx/mail_receiver.py b/src/leap/mx/mail_receiver.py
index dd76f08..d3f3c68 100644
--- a/src/leap/mx/mail_receiver.py
+++ b/src/leap/mx/mail_receiver.py
@@ -224,10 +224,6 @@ class MailReceiver(Service):
with openpgp.TempGPGWrapper(gpgbinary='/usr/bin/gpg') as gpg:
gpg.import_keys(pubkey)
key = gpg.list_keys().pop()
- # We don't care about the actual address, so we use a
- # dummy one, we just care about the import of the pubkey
- openpgp_key = openpgp._build_key_from_gpg("dummy@mail.com",
- key, pubkey)
# add X-Leap-Provenance header if message is not encrypted
if message.get_content_type() != 'multipart/encrypted' and \
@@ -236,7 +232,7 @@ class MailReceiver(Service):
message.add_header(
'X-Leap-Provenance',
email.utils.formatdate(),
- pubkey=openpgp_key.key_id)
+ pubkey=key["keyid"])
data = {'incoming': True, 'content': message.as_string()}
doc.content = {
self.INCOMING_KEY: True,
@@ -244,7 +240,7 @@ class MailReceiver(Service):
ENC_SCHEME_KEY: EncryptionSchemes.PUBKEY,
ENC_JSON_KEY: str(gpg.encrypt(
json.dumps(data, ensure_ascii=False),
- openpgp_key.fingerprint,
+ key["fingerprint"],
symmetric=False))
}