Skip to content

Commit d82712a

Browse files
ayeshurunAlon YeshurunCopilot
authored
fix: resolve codeql alert (#136)
Co-authored-by: Alon Yeshurun <alonyeshurun+microsoft@microsoft.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 5cecb1b commit d82712a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/fabric_cli/core/fab_auth.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,9 @@ def _load_pem_certificate(
690690
certificate_data, password, backend=default_backend()
691691
)
692692
cert = x509.load_pem_x509_certificate(certificate_data, default_backend())
693-
fingerprint = cert.fingerprint(hashes.SHA1())
693+
fingerprint = cert.fingerprint(
694+
hashes.SHA1()
695+
) # CodeQL [SM02167] SHA‑1 thumbprint is only a certificate identifier required by MSAL/Microsoft Entra, not a cryptographic operation
694696
return self._Cert(certificate_data, private_key, fingerprint)
695697

696698
def _load_pkcs12_certificate(
@@ -730,7 +732,9 @@ def _load_pkcs12_certificate(
730732
]
731733
pem_bytes = b"".join(pem_sections)
732734

733-
fingerprint = cert.fingerprint(hashes.SHA1())
735+
fingerprint = cert.fingerprint(
736+
hashes.SHA1()
737+
) # CodeQL [SM02167] SHA‑1 thumbprint is only a certificate identifier required by MSAL/Microsoft Entra, not a cryptographic operation
734738

735739
return self._Cert(pem_bytes, private_key, fingerprint)
736740

0 commit comments

Comments
 (0)