Skip to content

Commit eac15a9

Browse files
authored
Suppress CodeQL warning (#867)
SHA1 thumbprint in client assertion remains the only recognized way for some IDPs that MSAL supports, like ADFS.
1 parent d3464e6 commit eac15a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

msal/application.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ def _extract_cert_and_thumbprints(cert):
7777
[1:-1] # Strip the "--- header ---" and "--- footer ---"
7878
)
7979
]
80-
# https://cryptography.io/en/latest/x509/reference/#x-509-certificate-object
81-
sha256_thumbprint = cert.fingerprint(hashes.SHA256()).hex() # Requires cryptography 0.7+
82-
sha1_thumbprint = cert.fingerprint(hashes.SHA1()).hex() # Requires cryptography 0.7+
80+
# https://cryptography.io/en/latest/x509/reference/#x-509-certificate-object - Requires cryptography 0.7+
81+
sha256_thumbprint = cert.fingerprint(hashes.SHA256()).hex()
82+
sha1_thumbprint = cert.fingerprint(hashes.SHA1()).hex() # CodeQL [SM02167] for legacy support such as ADFS
8383
return sha256_thumbprint, sha1_thumbprint, x5c
8484

8585
def _parse_pfx(pfx_path, passphrase_bytes):

0 commit comments

Comments
 (0)