summaryrefslogtreecommitdiff
path: root/keymanager/src
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-11-01 10:34:39 -0300
committerTomás Touceda <chiiph@leap.se>2013-11-01 10:34:39 -0300
commit1b8ae950e9cef347bfd91ace66fd540bcca264b3 (patch)
tree043ae17d1a29cde4ae133601631d18fa86c7abbc /keymanager/src
parent2e1e258d6efadcd3a6ba34cd3194fe3e5c71e177 (diff)
parent4f066dfd45e03c9fab4c72205a217959f9ab8ca5 (diff)
Merge branch 'release-0.3.5'
Diffstat (limited to 'keymanager/src')
-rw-r--r--keymanager/src/leap/keymanager/openpgp.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/keymanager/src/leap/keymanager/openpgp.py b/keymanager/src/leap/keymanager/openpgp.py
index 6412331..8ec8639 100644
--- a/keymanager/src/leap/keymanager/openpgp.py
+++ b/keymanager/src/leap/keymanager/openpgp.py
@@ -26,6 +26,7 @@ import os
import re
import shutil
import tempfile
+import locale
from gnupg import GPG
from gnupg.gnupg import GPGUtilities
@@ -482,7 +483,7 @@ class OpenPGPScheme(EncryptionScheme):
:type verify: OpenPGPKey
:return: The decrypted data.
- :rtype: str
+ :rtype: unicode
@raise InvalidSignature: Raised if unable to verify the signature with
C{verify} key.
@@ -504,7 +505,12 @@ class OpenPGPScheme(EncryptionScheme):
raise errors.InvalidSignature(
'Failed to verify signature with key %s: %s' %
(verify.key_id, stderr))
- return result.data
+
+ # XXX: this is the encoding used by gpg module
+ # https://github.com/isislovecruft/python-gnupg/\
+ # blob/master/gnupg/_meta.py#L121
+ encoding = locale.getpreferredencoding()
+ return result.data.decode(encoding, 'replace')
def is_encrypted(self, data):
"""