Mercurial > hgrepos > Python > apps > py-cutils
diff cutils/shasum.py @ 75:a31de3c65877
Remove the use of "hmac.compare_digest()": there are no secrets to protect here
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sun, 27 Feb 2022 15:42:34 +0100 |
| parents | c3268f4e752f |
| children | 8708c34e2723 |
line wrap: on
line diff
--- a/cutils/shasum.py Sat Feb 26 19:35:41 2022 +0100 +++ b/cutils/shasum.py Sun Feb 27 15:42:34 2022 +0100 @@ -20,10 +20,6 @@ import binascii import errno import hashlib -try: - from hmac import compare_digest -except ImportError: - compare_digest = None import io try: import mmap @@ -211,10 +207,7 @@ return False else: return False - if compare_digest: - return compare_digest(given_digest, exd) - else: - return given_digest == exd + return given_digest == exd def verify_digests_with_checklist(opts):
