summaryrefslogtreecommitdiff
path: root/keymanager
diff options
context:
space:
mode:
Diffstat (limited to 'keymanager')
-rw-r--r--keymanager/changes/do-not-decode-decrypted-data1
-rw-r--r--keymanager/src/leap/keymanager/openpgp.py10
2 files changed, 2 insertions, 9 deletions
diff --git a/keymanager/changes/do-not-decode-decrypted-data b/keymanager/changes/do-not-decode-decrypted-data
new file mode 100644
index 00000000..a708be6e
--- /dev/null
+++ b/keymanager/changes/do-not-decode-decrypted-data
@@ -0,0 +1 @@
+ o Do not decode decrypted data, return as str.
diff --git a/keymanager/src/leap/keymanager/openpgp.py b/keymanager/src/leap/keymanager/openpgp.py
index 4276b19f..961e1ed3 100644
--- a/keymanager/src/leap/keymanager/openpgp.py
+++ b/keymanager/src/leap/keymanager/openpgp.py
@@ -564,15 +564,7 @@ class OpenPGPScheme(EncryptionScheme):
'Failed to verify signature with key %s: %s' %
(verify.key_id, result.stderr))
- # XXX: this is the encoding used by gpg module
- # https://github.com/isislovecruft/python-gnupg/\
- # blob/master/gnupg/_meta.py#L121
- encoding = locale.getpreferredencoding()
- if encoding is None:
- encoding = sys.stdin.encoding
- if encoding is None:
- encoding = 'utf-8'
- return result.data.decode(encoding, 'replace')
+ return result.data
except errors.GPGError as e:
logger.error('Failed to decrypt: %s.' % str(e))
raise errors.DecryptError(str(e))