Hmac: various fixes
This commit is contained in:
parent
ec1c2508d2
commit
3140339869
1 changed files with 2 additions and 2 deletions
|
@ -82,9 +82,9 @@ def update_repo(hook, clone_url):
|
|||
|
||||
def check_signature(received_sig, hook, payload):
|
||||
''' Check Gogs signature '''
|
||||
digest = hmac.new(hook.secret,
|
||||
digest = hmac.new(hook['secret'].encode('utf-8'),
|
||||
msg=payload,
|
||||
digestmod=sha256).digest()
|
||||
digestmod=sha256).hexdigest()
|
||||
return hmac.compare_digest(digest, received_sig)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue