[oe-commits] [bitbake] 01/12: bitbake: utils: add sha384_file and sha512_file functions

git at git.openembedded.org git at git.openembedded.org
Thu Jan 23 16:59:07 UTC 2020


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 5f539b2b05e5053ea8c6e7c2593c49d02a068dde
Author: Jean-Marie LEMETAYER <jean-marie.lemetayer at savoirfairelinux.com>
AuthorDate: Mon Jan 20 11:27:09 2020 +0100

    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/
    
    Signed-off-by: Jean-Marie LEMETAYER <jean-marie.lemetayer at savoirfairelinux.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/utils.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 68ca4ef..28368f0 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -556,6 +556,20 @@ def sha1_file(filename):
     import hashlib
     return _hasher(hashlib.sha1(), filename)
 
+def sha384_file(filename):
+    """
+    Return the hex string representation of the SHA384 checksum of the filename
+    """
+    import hashlib
+    return _hasher(hashlib.sha384(), filename)
+
+def sha512_file(filename):
+    """
+    Return the hex string representation of the SHA512 checksum of the filename
+    """
+    import hashlib
+    return _hasher(hashlib.sha512(), filename)
+
 def preserved_envvars_exported():
     """Variables which are taken from the environment and placed in and exported
     from the metadata"""

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list