From b92fd6505ef9a6e2e3532add89f0eb368bd4e2e2 Mon Sep 17 00:00:00 2001 From: parmentelat Date: Fri, 14 Dec 2018 14:41:49 +0100 Subject: [PATCH] bytes vs string in getbootmedium --- PLC/Methods/GetBootMedium.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PLC/Methods/GetBootMedium.py b/PLC/Methods/GetBootMedium.py index 1e58b980..00a4ea97 100644 --- a/PLC/Methods/GetBootMedium.py +++ b/PLC/Methods/GetBootMedium.py @@ -42,12 +42,12 @@ allowed_actions = { # compute a new key def compute_key(): # Generate 32 random bytes - bytes = random.sample(range(0, 256), 32) + int8s = random.sample(range(0, 256), 32) # Base64 encode their string representation - key = base64.b64encode("".join(map(chr, bytes))) + key = base64.b64encode(bytes(int8s)) # Boot Manager cannot handle = in the key # XXX this sounds wrong, as it might prevent proper decoding - key = key.replace("=", "") + key = key.replace(b"=", b"") return key class GetBootMedium(Method): -- 2.47.0