Skip to contentSkip to conversation

insane.bbclass: Allow hashlib version that only accepts on parameter

PATCH New Mark Hatle 1 participant 1 message Oct 6, 2022

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

PATCH 1/1 insane.bbclass: Allow hashlib version that only accepts on parameter

Some versions of hashlib don't appear to implement the second FIPS related argument. Detect this and support both versions.

---
This was found on an internal Ubuntu 18.04 container. Unfortunately I don't have access to the container itself but this resolves the issue.

 meta/classes-global/insane.bbclass | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
meta/classes-global/insane.bbclass +4 -1
index db34b4bdb5..dc46857a19 100644
@@ -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):
Signature · 1 line
2.17.1