chg: [FIPS] falling back on older version of Python not having usedforsecurity

pull/823/head
Alexandre Dulaunoy 2022-01-27 15:47:37 +01:00
parent 1efc735fb3
commit 14bf1f8189
No known key found for this signature in database
GPG Key ID: 09E2CD4944E6CBCD
1 changed files with 2 additions and 2 deletions

View File

@ -354,9 +354,9 @@ class MISPAttribute(AbstractMISP):
hashes = []
for v in self.value.split('|'):
try:
h = hashlib.new(algorithm)
except ValueError:
h = hashlib.new(algorithm, usedforsecurity=False)
except:
h = hashlib.new(algorithm)
h.update(v.encode("utf-8"))
hashes.append(h.hexdigest())
return hashes