]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
insane.bbclass: Allow hashlib version that only accepts on parameter
authorMark Hatle <mark.hatle@kernel.crashing.org>
Thu, 6 Oct 2022 21:54:07 +0000 (16:54 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 25 Oct 2022 12:42:00 +0000 (13:42 +0100)
Some versions of hashlib don't appear to implement the second FIPS
related argument.  Detect this and support both versions.

Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-global/insane.bbclass

index db34b4bdb58dde7b85d2fa27d921f52dfc2b09e7..dc46857a194c3299810ff53927c068104fbd0507 100644 (file)
@@ -555,7 +555,10 @@ python populate_lic_qa_checksum() {
                 import hashlib
                 lineno = 0
                 license = []
-                m = hashlib.new('MD5', usedforsecurity=False)
+                try:
+                    m = hashlib.new('MD5', usedforsecurity=False)
+                except TypeError:
+                    m = hashlib.new('MD5')
                 for line in f:
                     lineno += 1
                     if (lineno >= beginline):