Skip to content

Commit 721ad4b

Browse files
authored
Use sha256 for gef_hash to quiet static analyzers (#751)
1 parent 8fc0583 commit 721ad4b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gef.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4737,7 +4737,7 @@ def do_invoke(self, argv):
47374737
gef_fpath = os.path.abspath(os.path.expanduser(inspect.stack()[0][1]))
47384738
gef_dir = os.path.dirname(gef_fpath)
47394739
with open(gef_fpath, "rb") as f:
4740-
gef_hash = hashlib.sha1(f.read()).hexdigest()
4740+
gef_hash = hashlib.sha256(f.read()).hexdigest()
47414741

47424742
if os.access("{}/.git".format(gef_dir), os.X_OK):
47434743
ver = subprocess.check_output("git log --format='%H' -n 1 HEAD", cwd=gef_dir, shell=True).decode("utf8").strip()
@@ -4747,7 +4747,7 @@ def do_invoke(self, argv):
47474747
gef_blob_hash = subprocess.check_output("git hash-object {}".format(gef_fpath), shell=True).decode().strip()
47484748
gef_print("GEF: (Standalone)")
47494749
gef_print("Blob Hash({}): {}".format(gef_fpath, gef_blob_hash))
4750-
gef_print("SHA1({}): {}".format(gef_fpath, gef_hash))
4750+
gef_print("SHA256({}): {}".format(gef_fpath, gef_hash))
47514751
gef_print("GDB: {}".format(gdb.VERSION, ))
47524752
py_ver = "{:d}.{:d}".format(sys.version_info.major, sys.version_info.minor)
47534753
gef_print("GDB-Python: {}".format(py_ver, ))

0 commit comments

Comments
 (0)