summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
diff options
context:
space:
mode:
authorJean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com>2020-01-24 18:08:03 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-27 16:48:10 +0000
commitbdcd68f092bcd803f08524c30c99e2a082462fd1 (patch)
treea46770cd531c66231a17804a9f9c374efab379f8 /bitbake/lib/bb/utils.py
parent820a9b52f2bf028854bfb591f27d6d13874bb85f (diff)
downloadpoky-bdcd68f092bcd803f08524c30c99e2a082462fd1.tar.gz
bitbake: utils: add sha384_file and sha512_file functions
The npm fetcher needs these functions to support the subresource integrity: https://www.w3.org/TR/SRI/ (Bitbake rev: 80e2216e2b41cb6170292009064864449bc48bbe) Signed-off-by: Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r--bitbake/lib/bb/utils.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 68ca4ef25a..28368f0a60 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -556,6 +556,20 @@ def sha1_file(filename):
556 import hashlib 556 import hashlib
557 return _hasher(hashlib.sha1(), filename) 557 return _hasher(hashlib.sha1(), filename)
558 558
559def sha384_file(filename):
560 """
561 Return the hex string representation of the SHA384 checksum of the filename
562 """
563 import hashlib
564 return _hasher(hashlib.sha384(), filename)
565
566def sha512_file(filename):
567 """
568 Return the hex string representation of the SHA512 checksum of the filename
569 """
570 import hashlib
571 return _hasher(hashlib.sha512(), filename)
572
559def preserved_envvars_exported(): 573def preserved_envvars_exported():
560 """Variables which are taken from the environment and placed in and exported 574 """Variables which are taken from the environment and placed in and exported
561 from the metadata""" 575 from the metadata"""