summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-08-08 21:45:45 -0300
committerTomás Touceda <chiiph@leap.se>2013-08-08 21:45:45 -0300
commit8137a6e7dd461335f0fedbe7314a1fcf866b5d4d (patch)
tree1315dbab4eb13eb4117cd379923cc7fdd33ac40f /src
parent92e1115f6aa76ec656972820021f24387bac117d (diff)
parent67433e626eca83ddc0d52076b815743004962748 (diff)
Merge remote-tracking branch 'drebs/feature/3397-keymanager-should-support-bundled-gpg' into develop
Diffstat (limited to 'src')
-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