aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ply
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@kernel.crashing.org>2022-02-28 19:30:53 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-02 00:20:45 +0000
commitaf866dd077867cba0129757bfcc689551445e9d7 (patch)
tree1562525b6045896693167cb6ad50bc106bab5822 /lib/ply
parentf0fc0fe94161d4dd4f34df8426222ac590ef6736 (diff)
downloadbitbake-af866dd077867cba0129757bfcc689551445e9d7.tar.gz
utils/ply: Change md5 usages to work on FIPS enabled hosts
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. Note: utils.py version should never be used to verify file integrity, but instead be used to identify if the file may have changed. sha256 should be used for integrity purposes. 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>
Diffstat (limited to 'lib/ply')
-rw-r--r--lib/ply/yacc.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/ply/yacc.py b/lib/ply/yacc.py
index 46e7dc96f..767c4e467 100644
--- a/lib/ply/yacc.py
+++ b/lib/ply/yacc.py
@@ -2797,11 +2797,8 @@ class ParserReflect(object):
# Compute a signature over the grammar
def signature(self):
try:
- from hashlib import md5
- except ImportError:
- from md5 import md5
- try:
- sig = md5()
+ import hashlib
+ sig = hashlib.new('MD5', usedforsecurity=False)
if self.start:
sig.update(self.start.encode('latin-1'))
if self.prec: