git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9735366
)
bytes vs string in getbootmedium
author
parmentelat
<thierry.parmentelat@inria.fr>
Fri, 14 Dec 2018 13:41:49 +0000
(14:41 +0100)
committer
parmentelat
<thierry.parmentelat@inria.fr>
Fri, 14 Dec 2018 13:41:49 +0000
(14:41 +0100)
PLC/Methods/GetBootMedium.py
patch
|
blob
|
history
diff --git
a/PLC/Methods/GetBootMedium.py
b/PLC/Methods/GetBootMedium.py
index
1e58b98
..
00a4ea9
100644
(file)
--- 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
-
byte
s = random.sample(range(0, 256), 32)
+
int8
s = 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):