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,6 +353,9 @@ class MISPAttribute(AbstractMISP):
|
|||
if '|' in self.type or self.type == 'malware-sample':
|
||||
hashes = []
|
||||
for v in self.value.split('|'):
|
||||
try:
|
||||
h = hashlib.new(algorithm)
|
||||
except ValueError e:
|
||||
h = hashlib.new(algorithm, usedforsecurity=False)
|
||||
h.update(v.encode("utf-8"))
|
||||
hashes.append(h.hexdigest())
|
||||
|
|
Loading…
Reference in New Issue