git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
for python-2.6
[plcapi.git]
/
PLC
/
Auth.py
diff --git
a/PLC/Auth.py
b/PLC/Auth.py
index
9fea3e3
..
b11e855
100644
(file)
--- a/
PLC/Auth.py
+++ b/
PLC/Auth.py
@@
-256,7
+256,8
@@
class BootAuth(Auth):
# We encode in UTF-8 before calculating the HMAC, which is
# an 8-bit algorithm.
# We encode in UTF-8 before calculating the HMAC, which is
# an 8-bit algorithm.
- digest = hmac.new(key, msg.encode('utf-8'), sha).hexdigest()
+ # python 2.6 insists on receiving a 'str' as opposed to a 'unicode'
+ digest = hmac.new(str(key), msg.encode('utf-8'), sha).hexdigest()
if digest != auth['value']:
raise PLCAuthenticationFailure, "Call could not be authenticated"
if digest != auth['value']:
raise PLCAuthenticationFailure, "Call could not be authenticated"