All of lore.kernel.org
 help / color / mirror / Atom feed
* [langdale,master][PATCH] insane.bbclass: Allow hashlib version that only accepts on parameter
@ 2022-10-06 21:54 Mark Hatle
  0 siblings, 0 replies; only message in thread
From: Mark Hatle @ 2022-10-06 21:54 UTC (permalink / raw)
  To: openembedded-core

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>
---
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(-)

diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass
index db34b4bdb5..dc46857a19 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -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):
-- 
2.17.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-06 21:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-06 21:54 [langdale,master][PATCH] insane.bbclass: Allow hashlib version that only accepts on parameter Mark Hatle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.