diff options
-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 |