mirror of https://github.com/MISP/PyMISP
chg: [FIPS] in some cases, the `usedforsecurity` is not used. So fail if
the FIPS compliance is required and then the `usedforsecurity` is disabledpull/823/head
parent
02bc129341
commit
6e018a4582
|
@ -353,7 +353,10 @@ class MISPAttribute(AbstractMISP):
|
||||||
if '|' in self.type or self.type == 'malware-sample':
|
if '|' in self.type or self.type == 'malware-sample':
|
||||||
hashes = []
|
hashes = []
|
||||||
for v in self.value.split('|'):
|
for v in self.value.split('|'):
|
||||||
h = hashlib.new(algorithm, usedforsecurity=False)
|
try:
|
||||||
|
h = hashlib.new(algorithm)
|
||||||
|
except ValueError e:
|
||||||
|
h = hashlib.new(algorithm, usedforsecurity=False)
|
||||||
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