summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/telfhash/telfhash-new-tlsh-hash.patch
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2021-05-24 09:55:24 -0500
committerRobin Gloster <mail@glob.in>2021-05-24 09:55:24 -0500
commit4bc5fbef9d159e143fb7e2c3231932e6e76f667c (patch)
treee2198f5c552e0667d838b8ec764ddb3a4d8f6dec /pkgs/development/python-modules/telfhash/telfhash-new-tlsh-hash.patch
parentjq: fix build with structured-attrs on darwin (diff)
parentMerge pull request #123802 from superherointj/package-virtmanager-bugfix (diff)
downloadnixpkgs-origin/structured-attrs.tar.gz
Merge remote-tracking branch 'upstream/master' into structured-attrsorigin/structured-attrs
Diffstat (limited to 'pkgs/development/python-modules/telfhash/telfhash-new-tlsh-hash.patch')
-rw-r--r--pkgs/development/python-modules/telfhash/telfhash-new-tlsh-hash.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/telfhash/telfhash-new-tlsh-hash.patch b/pkgs/development/python-modules/telfhash/telfhash-new-tlsh-hash.patch
new file mode 100644
index 000000000000..3984a4c1e810
--- /dev/null
+++ b/pkgs/development/python-modules/telfhash/telfhash-new-tlsh-hash.patch
@@ -0,0 +1,30 @@
+diff --git a/telfhash/grouping.py b/telfhash/grouping.py
+index c62f8d9..4ee9f0b 100644
+--- a/telfhash/grouping.py
++++ b/telfhash/grouping.py
+@@ -32,10 +32,10 @@ import tlsh
+ def get_combination(telfhash_data):
+
+ #
+- # TLSH hash is 70 characters long. if the telfhash is not 70
++ # The new TLSH hash is 72 characters long. if the telfhash is not 72
+ # characters in length, exclude from the list
+ #
+- files_list = [x for x in list(telfhash_data.keys()) if telfhash_data[x]["telfhash"] is not None and len(telfhash_data[x]["telfhash"]) == 70]
++ files_list = [x for x in list(telfhash_data.keys()) if telfhash_data[x]["telfhash"] is not None and len(telfhash_data[x]["telfhash"]) == 72]
+
+ #
+ # get the combination of all the possible pairs of filenames
+diff --git a/telfhash/telfhash.py b/telfhash/telfhash.py
+index f2bbd25..c6e346c 100755
+--- a/telfhash/telfhash.py
++++ b/telfhash/telfhash.py
+@@ -132,7 +132,7 @@ def get_hash(symbols_list):
+ symbol_string = ",".join(symbols_list)
+ encoded_symbol_string = symbol_string.encode("ascii")
+
+- return tlsh.forcehash(encoded_symbol_string).lower()
++ return tlsh.forcehash(encoded_symbol_string)
+
+
+ def elf_get_imagebase(elf):