better auth.wiki
This commit is contained in:
+3
-3
@@ -327,8 +327,8 @@ def URL(
|
||||
|
||||
# re-assembling the same way during hash authentication
|
||||
message = h_args + '?' + urllib.urlencode(sorted(h_vars))
|
||||
|
||||
sig = hmac_hash(message, hmac_key, digest_alg='sha1', salt=salt)
|
||||
sig = hmac_hash(message, (hmac_key or '')+(salt or ''),
|
||||
digest_alg='sha1')
|
||||
# add the signature into vars
|
||||
list_vars.append(('_signature', sig))
|
||||
|
||||
@@ -447,7 +447,7 @@ def verifyURL(request, hmac_key=None, hash_vars=True, salt=None, user_signature=
|
||||
message = h_args + '?' + urllib.urlencode(sorted(h_vars))
|
||||
|
||||
# hash with the hmac_key provided
|
||||
sig = hmac_hash(message, str(hmac_key), digest_alg='sha1', salt=salt)
|
||||
sig = hmac_hash(message, str(hmac_key)+(salt or ''), digest_alg='sha1')
|
||||
|
||||
# put _signature back in get_vars just in case a second call to URL.verify is performed
|
||||
# (otherwise it'll immediately return false)
|
||||
|
||||
Reference in New Issue
Block a user