]> code.ossystems Code Review - openembedded-core.git/commitdiff
insane.bbclass: Update insane.bbclass to work on FIPS enabled hosts
authorMark Hatle <mark.hatle@kernel.crashing.org>
Tue, 1 Mar 2022 01:37:26 +0000 (19:37 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 1 Mar 2022 23:44:29 +0000 (23:44 +0000)
hashlib.md5() is not permitted on a FIPS enabled host system.  This is due
to md5 not being an approved hash algorithm.

Instead use:
 hashlib.new('MD5', usedforsecurity=False)

This is allowed, as it's clear the hash is used for a non-security purpose.

Using an md5 to identify when a license has changed is permitted, as we're
not using it for file integrity.

Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/insane.bbclass

index 890e865a8f379a182ab3f73d72af5a838e993aa5..29b9b3d466a627411f03f02a846f1e8e861f39b1 100644 (file)
@@ -549,7 +549,7 @@ python populate_lic_qa_checksum() {
                 import hashlib
                 lineno = 0
                 license = []
-                m = hashlib.md5()
+                m = hashlib.new('MD5', usedforsecurity=False)
                 for line in f:
                     lineno += 1
                     if (lineno >= beginline):