aim
aim copied to clipboard
[fix] Aimstack crashing on FIPS enabled servers.
This PR tries to solve the issue https://github.com/aimhubio/aim/issues/3143.
Using Aim on a FIPS compatible server, RHEL 9 FIPS enabled server in our case results in error due to lack of flexibility in the FIPS compatible version of blake2
hash algorithm used in aim currently.
Post further investigation we found out that on our FIPS servers the hashlib
library used openssl
version of the constructors for blake2
which doesn't provide digest_size
argument which is used in Aim to customize the size of hash digest to 8 bytes
.
In this patch we introduce use of a FIPS compatible hashing algorithm shake_256
which supports variable lengths digests and is available in FIPS mode under the SHA3 algorithms.
Currently the code is written to keep using blake2
in normal execution mode but if FIPS mode is detected it switches to shake_256
.