chg: [FIPS] no clean way to support OpenSSL hashlib interface for FIPS

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

View File

@ -353,10 +353,7 @@ class MISPAttribute(AbstractMISP):
if '|' in self.type or self.type == 'malware-sample':
hashes = []
for v in self.value.split('|'):
try:
h = hashlib.new(algorithm, usedforsecurity=False)
except:
h = hashlib.new(algorithm)
h = hashlib.new(algorithm)
h.update(v.encode("utf-8"))
hashes.append(h.hexdigest())
return hashes