changeset 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 6cec638c995c
children 15c1058c832e
files cutils/shasum.py
diffstat 1 files changed, 1 insertions(+), 8 deletions(-) [+]
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):