Skip to content
This repository was archived by the owner on Apr 19, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions endpoints/users_id_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from __future__ import absolute_import

import base64
import hmac
import json
import logging
import os
Expand Down Expand Up @@ -625,8 +626,8 @@ def _verify_signed_jwt_with_certs(

# Check the signature on 'signed' by encrypting 'signature' with the
# public key and confirming the result matches the SHA256 hash of
# 'signed'.
verified = (hexsig == local_hash)
# 'signed'. hmac.compare_digest(a, b) is used to avoid timing attacks.
verified = hmac.compare_digest(hexsig, local_hash)
if verified:
break
except Exception, e: # pylint: disable=broad-except
Expand Down