summaryrefslogtreecommitdiffstats
path: root/Modules/md5module.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2019-09-13 00:30:00 (GMT)
committerGregory P. Smith <greg@krypto.org>2019-09-13 00:30:00 (GMT)
commit7cad53e6b084435a220e6604010f1fa5778bd0b1 (patch)
treea54b4906b9e9fc18bd5319fe87ad8a7fc071b3a7 /Modules/md5module.c
parent3a4f66707e824ef3a8384827590ebaa6ca463dc0 (diff)
downloadcpython-7cad53e6b084435a220e6604010f1fa5778bd0b1.zip
cpython-7cad53e6b084435a220e6604010f1fa5778bd0b1.tar.gz
cpython-7cad53e6b084435a220e6604010f1fa5778bd0b1.tar.bz2
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/md5module.c')
-rw-r--r--Modules/md5module.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/md5module.c b/Modules/md5module.c
index b9a351a..f2c2d32 100644
--- a/Modules/md5module.c
+++ b/Modules/md5module.c
@@ -503,13 +503,15 @@ static PyTypeObject MD5type = {
_md5.md5
string: object(c_default="NULL") = b''
+ *
+ usedforsecurity: bool = True
Return a new MD5 hash object; optionally initialized with a string.
[clinic start generated code]*/
static PyObject *
-_md5_md5_impl(PyObject *module, PyObject *string)
-/*[clinic end generated code: output=2cfd0f8c091b97e6 input=d12ef8f72d684f7b]*/
+_md5_md5_impl(PyObject *module, PyObject *string, int usedforsecurity)
+/*[clinic end generated code: output=587071f76254a4ac input=7a144a1905636985]*/
{
MD5object *new;
Py_buffer buf;