diff mbox series

[kirkstone,17/31] insane.bbclass: Allow hashlib version that only accepts on parameter

Message ID 4b847bc337fe9e800168851e7fedf8d8972d40c5.1667530733.git.steve@sakoman.com
State New, archived
Headers show
Series [kirkstone,01/31] openssl: export necessary env vars in SDK | expand

Commit Message

Steve Sakoman Nov. 4, 2022, 3 a.m. UTC
From: Mark Hatle <mark.hatle@kernel.crashing.org>

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>
(cherry picked from commit 2bbabed51e3aca138486d3feef640f5d3249be40)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/classes/insane.bbclass | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 0d93d50e58..dfda70bad6 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -552,7 +552,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):