summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2022-11-26 09:33:48 (GMT)
committerGitHub <noreply@github.com>2022-11-26 09:33:48 (GMT)
commit47d673d81fc315069c14f9438ebe61fb70ef1ccc (patch)
tree3da85ea3b94fe937e4054b51a41d6da5b8a86e37 /Doc/library
parentec2b76aa8b7c6313293ff9c6814e8bc31e08fcaf (diff)
downloadcpython-47d673d81fc315069c14f9438ebe61fb70ef1ccc.zip
cpython-47d673d81fc315069c14f9438ebe61fb70ef1ccc.tar.gz
cpython-47d673d81fc315069c14f9438ebe61fb70ef1ccc.tar.bz2
gh-99502: mention bytes-like objects as input in `secrets.compare_digest` (GH-99512)
Now it is in sync with https://docs.python.org/3/library/hmac.html#hmac.compare_digest It is the same function, just re-exported. So, I guess they should mention the same input types.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/secrets.rst4
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/library/secrets.rst b/Doc/library/secrets.rst
index dc8e5f4..4405dfc 100644
--- a/Doc/library/secrets.rst
+++ b/Doc/library/secrets.rst
@@ -128,7 +128,9 @@ Other functions
.. function:: compare_digest(a, b)
- Return ``True`` if strings *a* and *b* are equal, otherwise ``False``,
+ Return ``True`` if strings or
+ :term:`bytes-like objects <bytes-like object>`
+ *a* and *b* are equal, otherwise ``False``,
using a "constant-time compare" to reduce the risk of
`timing attacks <https://codahale.com/a-lesson-in-timing-attacks/>`_.
See :func:`hmac.compare_digest` for additional details.