Fix code scanning alert no. 32: Use of a broken or weak cryptographic hashing algorithm on sensitive data (#203)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
涵曦 2024-09-25 22:26:48 +08:00 committed by GitHub
parent db8b90487f
commit 2b6619b4da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -399,7 +399,7 @@ def access_key_verification(file_path, key, code):
if code is not None:
current_code_bytes = code.encode("utf8")
correct_code_bytes = (
hashlib.md5(
hashlib.sha256(
(
file_path + config.httpauth_username + config.httpauth_password
).encode("utf-8")