diff options
author | Christian Heimes <christian@python.org> | 2019-09-13 02:30:00 +0200 |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2019-09-12 19:30:00 -0500 |
commit | 7cad53e6b084435a220e6604010f1fa5778bd0b1 (patch) | |
tree | a54b4906b9e9fc18bd5319fe87ad8a7fc071b3a7 /Modules/_blake2/blake2b_impl.c | |
parent | 3a4f66707e824ef3a8384827590ebaa6ca463dc0 (diff) | |
download | cpython-git-7cad53e6b084435a220e6604010f1fa5778bd0b1.tar.gz |
bpo-9216: Add usedforsecurity to hashlib constructors (GH-16044)
The usedforsecurity keyword only argument added to the hash constructors is useful for FIPS builds and similar restrictive environment with non-technical requirements that legacy algorithms be forbidden by their implementations without being explicitly annotated as not being used for any security related purposes. Linux distros with FIPS support benefit from this being standard rather than making up their own way(s) to do it.
Contributed and Signed-off-by: Christian Heimes christian@python.org
Diffstat (limited to 'Modules/_blake2/blake2b_impl.c')
-rw-r--r-- | Modules/_blake2/blake2b_impl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/_blake2/blake2b_impl.c b/Modules/_blake2/blake2b_impl.c index edab31ea22..88c103f56c 100644 --- a/Modules/_blake2/blake2b_impl.c +++ b/Modules/_blake2/blake2b_impl.c @@ -81,6 +81,7 @@ _blake2.blake2b.__new__ as py_blake2b_new node_depth: int = 0 inner_size: int = 0 last_node: bool = False + usedforsecurity: bool = True Return a new BLAKE2b hash object. [clinic start generated code]*/ @@ -90,8 +91,8 @@ py_blake2b_new_impl(PyTypeObject *type, PyObject *data, int digest_size, Py_buffer *key, Py_buffer *salt, Py_buffer *person, int fanout, int depth, unsigned long leaf_size, unsigned long long node_offset, int node_depth, - int inner_size, int last_node) -/*[clinic end generated code: output=65e732c66c2297a0 input=82be35a4e6a9daa2]*/ + int inner_size, int last_node, int usedforsecurity) +/*[clinic end generated code: output=32bfd8f043c6896f input=b947312abff46977]*/ { BLAKE2bObject *self = NULL; Py_buffer buf; |