summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-08-08 16:11:18 +0200
committerdrebs <drebs@leap.se>2013-08-08 23:59:04 +0200
commit67433e626eca83ddc0d52076b815743004962748 (patch)
tree1315dbab4eb13eb4117cd379923cc7fdd33ac40f /src/leap
parent92e1115f6aa76ec656972820021f24387bac117d (diff)
Update to latest keymanager API and support bundled GPG.
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/mx/mail_receiver.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/leap/mx/mail_receiver.py b/src/leap/mx/mail_receiver.py
index 43925df..a830fa1 100644
--- a/src/leap/mx/mail_receiver.py
+++ b/src/leap/mx/mail_receiver.py
@@ -123,7 +123,7 @@ class MailReceiver(Service):
return uuid, doc
openpgp_key = None
- with openpgp.temporary_gpgwrapper() as gpg:
+ with openpgp.TempGPGWrapper(gpgbinary='/usr/bin/gpg') as gpg:
gpg.import_keys(pubkey)
key = gpg.list_keys().pop()
openpgp_key = openpgp._build_key_from_gpg(address, key, pubkey)
@@ -131,8 +131,10 @@ class MailReceiver(Service):
doc.content = {
"incoming": True,
"_enc_scheme": EncryptionSchemes.PUBKEY,
- "_enc_json": openpgp.encrypt_asym(json.dumps(data),
- openpgp_key)
+ "_enc_json": str(gpg.encrypt(
+ json.dumps(data),
+ openpgp_key.fingerprint,
+ symmetric=False))
}
return uuid, doc