summaryrefslogtreecommitdiffstats
path: root/custodia/message
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2015-06-07 15:14:42 -0400
committerSimo Sorce <simo@redhat.com>2015-06-07 15:14:42 -0400
commit77d841778fa5ec2793b3879e475439c2365ec4f6 (patch)
tree7135e3c13c8f81fc8479abfb444d183e9507c92a /custodia/message
parent43e1f39ebe1c58408b05329644007fb1799751fa (diff)
downloadcustodia-77d841778fa5ec2793b3879e475439c2365ec4f6.tar.gz
custodia-77d841778fa5ec2793b3879e475439c2365ec4f6.tar.xz
custodia-77d841778fa5ec2793b3879e475439c2365ec4f6.zip
Fix Python 3 portablility issues
Signed-off-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'custodia/message')
-rw-r--r--custodia/message/kem.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/custodia/message/kem.py b/custodia/message/kem.py
index 205a5fa..a47a689 100644
--- a/custodia/message/kem.py
+++ b/custodia/message/kem.py
@@ -138,7 +138,7 @@ class KEMHandler(MessageHandler):
token.decrypt(self.kkstore.server_keys[KEY_USAGE_ENC])
# If an encrypted payload is received then there must be
# a nested signed payload to verify the provenance.
- payload = token.payload
+ payload = token.payload.decode('utf-8')
token = JWS()
token.deserialize(payload)
elif isinstance(token, JWS):
@@ -367,7 +367,7 @@ class KEMTests(unittest.TestCase):
cli_ekey = JWK(**self.client_keys[1])
jtok.token.decrypt(cli_ekey)
nested = jtok.token.payload
- jtok = JWT(jwt=nested)
+ jtok = JWT(jwt=nested.decode('utf-8'))
jtok.token.verify(JWK(**test_keys[0]))
payload = json_decode(jtok.token.payload)['value']
self.assertEqual(payload, 'output')