summaryrefslogtreecommitdiff
path: root/keymanager/src
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-01-17 15:53:03 -0300
committerTomás Touceda <chiiph@leap.se>2014-01-17 15:53:03 -0300
commita7839a6e839dcfe96f36e0787869bcc5d56ce769 (patch)
tree3994066c293eecc6732f914ab93c4ef7db9353a5 /keymanager/src
parentbd5e5ea19b1cb16cbd3441bf17cee1e7842d8212 (diff)
parentda9191e700895811b657a19148d1d3852e79d157 (diff)
Merge remote-tracking branch 'refs/remotes/ivan/bug/do-not-decode-decrypted-data' into develop
Diffstat (limited to 'keymanager/src')
-rw-r--r--keymanager/src/leap/keymanager/openpgp.py14
1 files changed, 2 insertions, 12 deletions
diff --git a/keymanager/src/leap/keymanager/openpgp.py b/keymanager/src/leap/keymanager/openpgp.py
index 4276b19..950d022 100644
--- a/keymanager/src/leap/keymanager/openpgp.py
+++ b/keymanager/src/leap/keymanager/openpgp.py
@@ -17,12 +17,10 @@
"""
Infrastructure for using OpenPGP keys in Key Manager.
"""
-import locale
import logging
import os
import re
import shutil
-import sys
import tempfile
from contextlib import closing
@@ -522,7 +520,7 @@ class OpenPGPScheme(EncryptionScheme):
return result.data
except errors.GPGError as e:
logger.error('Failed to decrypt: %s.' % str(e))
- raise error.EncryptError()
+ raise errors.EncryptError()
def decrypt(self, data, privkey, passphrase=None, verify=None):
"""
@@ -564,15 +562,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))