X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FAuth.py;h=945c8ce5585d3fd9f4056f2964ed2c88711d64e2;hb=dbd0288d599d2cb6fecf1e9bf7b4d0705a641f7a;hp=b11e8551ef2d97afe350427917566ad323bf0b2e;hpb=5b3409148b4100ff8cde3636d6c68c8f07ad8a87;p=plcapi.git diff --git a/PLC/Auth.py b/PLC/Auth.py index b11e8551..945c8ce5 100644 --- a/PLC/Auth.py +++ b/PLC/Auth.py @@ -9,7 +9,7 @@ # import crypt -import sha +import hashlib import hmac import time @@ -257,7 +257,7 @@ class BootAuth(Auth): # We encode in UTF-8 before calculating the HMAC, which is # an 8-bit algorithm. # python 2.6 insists on receiving a 'str' as opposed to a 'unicode' - digest = hmac.new(str(key), msg.encode('utf-8'), sha).hexdigest() + digest = hmac.new(str(key), msg.encode('utf-8'), hashlib.sha1).hexdigest() if digest != auth['value']: raise PLCAuthenticationFailure, "Call could not be authenticated"