summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-06-28 09:51:13 (GMT)
committerGitHub <noreply@github.com>2022-06-28 09:51:13 (GMT)
commit71d5299b73c854a7b0e12eb5d0a524579723660b (patch)
tree4b3c56052382756ef9c23698d27961ab25b18263 /Doc
parent5c5fc9da3f91ac09f7f00ac644071cd5efb2eafe (diff)
downloadcpython-71d5299b73c854a7b0e12eb5d0a524579723660b.zip
cpython-71d5299b73c854a7b0e12eb5d0a524579723660b.tar.gz
cpython-71d5299b73c854a7b0e12eb5d0a524579723660b.tar.bz2
gh-94199: Remove hashlib.pbkdf2_hmac() Python implementation (GH-94200)
Remove the pure Python implementation of hashlib.pbkdf2_hmac(), deprecated in Python 3.10. Python 3.10 and newer requires OpenSSL 1.1.1 or newer (PEP 644), this OpenSSL version provides a C implementation of pbkdf2_hmac() which is faster.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/hashlib.rst18
-rw-r--r--Doc/whatsnew/3.12.rst6
2 files changed, 12 insertions, 12 deletions
diff --git a/Doc/library/hashlib.rst b/Doc/library/hashlib.rst
index 0906ce7..386541a 100644
--- a/Doc/library/hashlib.rst
+++ b/Doc/library/hashlib.rst
@@ -300,23 +300,17 @@ include a `salt <https://en.wikipedia.org/wiki/Salt_%28cryptography%29>`_.
>>> from hashlib import pbkdf2_hmac
>>> our_app_iters = 500_000 # Application specific, read above.
- >>> dk = pbkdf2_hmac('sha256', b'password', b'bad salt'*2, our_app_iters)
+ >>> dk = pbkdf2_hmac('sha256', b'password', b'bad salt' * 2, our_app_iters)
>>> dk.hex()
'15530bba69924174860db778f2c6f8104d3aaf9d26241840c8c4a641c8d000a9'
- .. versionadded:: 3.4
-
- .. note::
+ Function only available when Python is compiled with OpenSSL.
- A fast implementation of *pbkdf2_hmac* is available with OpenSSL. The
- Python implementation uses an inline version of :mod:`hmac`. It is about
- three times slower and doesn't release the GIL.
-
- .. deprecated:: 3.10
+ .. versionadded:: 3.4
- Slow Python implementation of *pbkdf2_hmac* is deprecated. In the
- future the function will only be available when Python is compiled
- with OpenSSL.
+ .. versionchanged:: 3.12
+ Function now only available when Python is built with OpenSSL. The slow
+ pure Python implementation has been removed.
.. function:: scrypt(password, *, salt, n, r, p, maxmem=0, dklen=64)
diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst
index e0b9599..0a4d498 100644
--- a/Doc/whatsnew/3.12.rst
+++ b/Doc/whatsnew/3.12.rst
@@ -273,6 +273,12 @@ Removed
use :func:`locale.format_string` instead.
(Contributed by Victor Stinner in :gh:`94226`.)
+* :mod:`hashlib`: Remove the pure Python implementation of
+ :func:`hashlib.pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and
+ newer requires OpenSSL 1.1.1 (:pep:`644`): this OpenSSL version provides
+ a C implementation of :func:`~hashlib.pbkdf2_hmac()` which is faster.
+ (Contributed by Victor Stinner in :gh:`94199`.)
+
Porting to Python 3.12
======================