X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FAuth.py;fp=PLC%2FAuth.py;h=b11e8551ef2d97afe350427917566ad323bf0b2e;hb=c70d455693665a29ab0eb31a3929b98b42bfe2ea;hp=9fea3e3aca291d4e7020dd96fe7252cb126ac066;hpb=38fd936c8dea87c4feb4620db06a91691a0bf5ff;p=plcapi.git diff --git a/PLC/Auth.py b/PLC/Auth.py index 9fea3e3..b11e855 100644 --- 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. - 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"