diff options
author | drebs <drebs@leap.se> | 2013-08-08 16:11:18 +0200 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-08-08 23:59:04 +0200 |
commit | 67433e626eca83ddc0d52076b815743004962748 (patch) | |
tree | 1315dbab4eb13eb4117cd379923cc7fdd33ac40f | |
parent | 92e1115f6aa76ec656972820021f24387bac117d (diff) |
Update to latest keymanager API and support bundled GPG.
-rw-r--r-- | changes/feature_keymanager-should-support-bundled-gpg | 1 | ||||
-rw-r--r-- | src/leap/mx/mail_receiver.py | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/changes/feature_keymanager-should-support-bundled-gpg b/changes/feature_keymanager-should-support-bundled-gpg new file mode 100644 index 0000000..1d9a458 --- /dev/null +++ b/changes/feature_keymanager-should-support-bundled-gpg @@ -0,0 +1 @@ + o Update keymanager API. Closes #3397. 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 |