Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ def _cert_thumbprint(cert_path: Path) -> str:

pem_bytes = Path(cert_path).read_bytes()
der_bytes = ssl.PEM_cert_to_DER_cert(pem_bytes.decode())
return hashlib.sha1(der_bytes, usedforsecurity=False).hexdigest().upper()
# SHA-1 is not used here as a security primitive; it is required to compute the X.509 certificate thumbprint
# (the `x5t` JWT header value), which MSAL and Microsoft Entra ID mandate to be a SHA-1 digest for the
# `thumbprint` client credential. Hence the `usedforsecurity=False` flag.
return hashlib.sha1(der_bytes, usedforsecurity=False).hexdigest().upper() # CodeQL [SM02167] x5t thumbprint


# endregion
Expand Down
Loading