summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-11-20 16:23:06 (GMT)
committerChristian Heimes <christian@cheimes.de>2013-11-20 16:23:06 (GMT)
commit634919a9fa1fffe3d36b13b4248f99508b5999ed (patch)
treeb60c9ca7e04ad97e11385712b3405fc9b42d7803 /Doc
parent7f48396cb5d19a40f571b0aec4916612f117a13d (diff)
downloadcpython-634919a9fa1fffe3d36b13b4248f99508b5999ed.zip
cpython-634919a9fa1fffe3d36b13b4248f99508b5999ed.tar.gz
cpython-634919a9fa1fffe3d36b13b4248f99508b5999ed.tar.bz2
Issue #17276: MD5 as default digestmod for HMAC is deprecated. The HMAC
module supports digestmod names, e.g. hmac.HMAC('sha1').
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/hmac.rst11
-rw-r--r--Doc/whatsnew/3.4.rst3
2 files changed, 12 insertions, 2 deletions
diff --git a/Doc/library/hmac.rst b/Doc/library/hmac.rst
index 1d928ea..8fa1435 100644
--- a/Doc/library/hmac.rst
+++ b/Doc/library/hmac.rst
@@ -18,13 +18,20 @@ This module implements the HMAC algorithm as described by :rfc:`2104`.
Return a new hmac object. *key* is a bytes or bytearray object giving the
secret key. If *msg* is present, the method call ``update(msg)`` is made.
- *digestmod* is the digest constructor or module for the HMAC object to use.
- It defaults to the :data:`hashlib.md5` constructor.
+ *digestmod* is the digest name, digest constructor or module for the HMAC
+ object to use. It supports any name suitable to :func:`hashlib.new` and
+ defaults to the :data:`hashlib.md5` constructor.
.. versionchanged:: 3.4
Parameter *key* can be a bytes or bytearray object. Parameter *msg* can
be of any type supported by :mod:`hashlib`.
+ Paramter *digestmod* can be the name of a hash algorithm.
+
+ .. deprecated:: 3.4
+ MD5 as implicit default digest for *digestmod* is deprecated.
+
+
An HMAC object has the following methods:
.. method:: HMAC.update(msg)
diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst
index 19b20bf..42a6fef 100644
--- a/Doc/whatsnew/3.4.rst
+++ b/Doc/whatsnew/3.4.rst
@@ -842,6 +842,9 @@ Deprecated Python modules, functions and methods
* The :mod:`formatter` module is pending deprecation and is slated for removal
in Python 3.6.
+* MD5 as default digestmod for :mod:`hmac` is deprecated. Python 3.6 will
+ require an explicit digest name or constructor as *digestmod* argument.
+
Deprecated functions and types of the C API
-------------------------------------------