mirror of https://github.com/MISP/PyMISP
chg: [FIPS] falling back on older version of Python not having usedforsecurity
parent
1efc735fb3
commit
14bf1f8189
|
@ -354,9 +354,9 @@ class MISPAttribute(AbstractMISP):
|
||||||
hashes = []
|
hashes = []
|
||||||
for v in self.value.split('|'):
|
for v in self.value.split('|'):
|
||||||
try:
|
try:
|
||||||
h = hashlib.new(algorithm)
|
|
||||||
except ValueError:
|
|
||||||
h = hashlib.new(algorithm, usedforsecurity=False)
|
h = hashlib.new(algorithm, usedforsecurity=False)
|
||||||
|
except:
|
||||||
|
h = hashlib.new(algorithm)
|
||||||
h.update(v.encode("utf-8"))
|
h.update(v.encode("utf-8"))
|
||||||
hashes.append(h.hexdigest())
|
hashes.append(h.hexdigest())
|
||||||
return hashes
|
return hashes
|
||||||
|
|
Loading…
Reference in New Issue