summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2014-12-22 09:04:29 -0600
committerKali Kaneko <kali@futeisha.org>2015-02-11 11:54:25 -0400
commita3bd2f6073a2ab10edfa15ff22e230baf611f239 (patch)
tree4088690132f3b17b9fafd6afbc6256b4417869f4 /src/leap
parent85680ed4053aca4794cd88f75388c56c350fc466 (diff)
Use gpg key directly
_build_key_from_gpg in keymanager has changed
Diffstat (limited to 'src/leap')
-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))
}