X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FGetBootMedium.py;fp=PLC%2FMethods%2FGetBootMedium.py;h=00a4ea979a9cc07188917bc23a0c693735e2e769;hb=b92fd6505ef9a6e2e3532add89f0eb368bd4e2e2;hp=1e58b9805fa2cfd5bd6c27ebb48627faeb566619;hpb=9735366c3bf4070802e42ce59d5ba7c94ea8f1f5;p=plcapi.git diff --git a/PLC/Methods/GetBootMedium.py b/PLC/Methods/GetBootMedium.py index 1e58b98..00a4ea9 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):