Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use hashlib.sha256() instead of _sha256.sha256()
_sha256 is a CPython extension and is an implementation detail one must not rely on. Despite being a part of most CPython distributions, _sha256 module may not exist if CPython has been built in so-called FIPS compliant mode. Examples of such distributions could be found in CentOS and/or RHEL. Recommended way of using sha256() is via hashlib module because hashlib module may choose a hash function implementation based on whether OpenSSL exist or not. Normally _sha256 module is a fallback implementation if CPython has not been linked to OpenSSL, but in FIPS mode it's always linked to OpenSSL.
- Loading branch information