summaryrefslogtreecommitdiff
path: root/keymanager/src/leap
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2014-01-17 14:53:10 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2014-01-17 14:53:10 -0300
commit92c14ffdbcec74cb6c602fc82633a99e9b8bde40 (patch)
treea4cd94b3a3d4142218c00296f8c6f31dcbf9d51e /keymanager/src/leap
parentbd5e5ea19b1cb16cbd3441bf17cee1e7842d8212 (diff)
Do not decode decrypted data, return as str.
Diffstat (limited to 'keymanager/src/leap')
-rw-r--r--keymanager/src/leap/keymanager/openpgp.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/keymanager/src/leap/keymanager/openpgp.py b/keymanager/src/leap/keymanager/openpgp.py
index 4276b19..961e1ed 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))