Skip to content

Commit

Permalink
fips #205
Browse files Browse the repository at this point in the history
  • Loading branch information
ACEnglish committed Apr 3, 2024
1 parent d862e76 commit a8dbd30
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion repo_utils/test_files/external/fake_mafft/mafft
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sys.stderr.write(f"Running fake MAFFT\n")
m_dir = os.path.dirname(os.path.realpath(__file__))

stdin = sys.stdin.read()
md5sum = hashlib.md5(stdin.encode()).hexdigest()
md5sum = hashlib.md5(stdin.encode(), usedforsecurity=False).hexdigest()
fn = os.path.join(m_dir, f"lookup/fm_{md5sum}.msa")

#if not os.path.exists(fn):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# For every haps.fa, read it in, get a hash key, save hash key to file's msa.fa
with open(haps, 'r') as fh:
data = fh.read()
m_key = hashlib.md5(data.encode('utf-8')).hexdigest()
m_key = hashlib.md5(data.encode('utf-8'), usedforsecurity=False).hexdigest()
if m_key in lookup:
sys.stderr.write("!!WARN!! Conflicting key %s on %s with %s\n" % (m_key, haps, lookup[m_key]))
lookup[m_key] = os.path.join(os.path.dirname(haps), 'msa.fa')
Expand Down
2 changes: 1 addition & 1 deletion truvari/phab.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def run_mafft(seq_bytes, params=DEFAULT_MAFFT_PARAM):
dev_name = None
if "PHAB_WRITE_MAFFT" in os.environ and os.environ["PHAB_WRITE_MAFFT"] == "1":
import hashlib # pylint: disable=import-outside-toplevel
dev_name = hashlib.md5(seq_bytes).hexdigest()
dev_name = hashlib.md5(seq_bytes, usedforsecurity=False).hexdigest()

ret = truvari.cmd_exe(f"mafft {params} -", stdin=seq_bytes)
if ret.ret_code != 0:
Expand Down

0 comments on commit a8dbd30

Please sign in to comment.