Skip to content
Snippets Groups Projects
Commit 0da24cac authored by Erik Johnston's avatar Erik Johnston
Browse files

Add null separator to hmac

parent be3548f7
No related branches found
No related tags found
No related merge requests found
...@@ -32,7 +32,9 @@ def request_registration(user, password, server_location, shared_secret, admin=F ...@@ -32,7 +32,9 @@ def request_registration(user, password, server_location, shared_secret, admin=F
) )
mac.update(user) mac.update(user)
mac.update("\x00")
mac.update(password) mac.update(password)
mac.update("\x00")
mac.update("admin" if admin else "notadmin") mac.update("admin" if admin else "notadmin")
mac = mac.hexdigest() mac = mac.hexdigest()
......
...@@ -336,7 +336,9 @@ class RegisterRestServlet(ClientV1RestServlet): ...@@ -336,7 +336,9 @@ class RegisterRestServlet(ClientV1RestServlet):
digestmod=sha1, digestmod=sha1,
) )
want_mac.update(user) want_mac.update(user)
want_mac.update("\x00")
want_mac.update(password) want_mac.update(password)
want_mac.update("\x00")
want_mac.update("admin" if admin else "notadmin") want_mac.update("admin" if admin else "notadmin")
want_mac = want_mac.hexdigest() want_mac = want_mac.hexdigest()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment