diff options
author | Kali Kaneko <kali@leap.se> | 2013-11-05 11:13:31 -0200 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2013-11-05 11:13:31 -0200 |
commit | 426eb72b9dde581b764b3eb73ca1fe04448408a6 (patch) | |
tree | 277e64d95323d36704627d88078083738d22d172 /src/leap/keymanager/openpgp.py | |
parent | ef8a6a8894fb194e6546e72498cdfec9ab50d028 (diff) | |
parent | a22efb595cee79fbcab830d8024a173a6a68d6aa (diff) |
Merge tag '0.3.5' into debian
Tag leap.keymanager version 0.3.5
Diffstat (limited to 'src/leap/keymanager/openpgp.py')
-rw-r--r-- | src/leap/keymanager/openpgp.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/leap/keymanager/openpgp.py b/src/leap/keymanager/openpgp.py index 6412331..8ec8639 100644 --- a/src/leap/keymanager/openpgp.py +++ b/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): """ |