Fix undocumented functions in secretutils
Change-Id: Ic226f4b64b91a1a391d6be2cb3c9f781440ef318
This commit is contained in:
parent
dfdd8fa557
commit
67345b82e0
@ -3,4 +3,4 @@
|
||||
=============
|
||||
|
||||
.. automodule:: oslo_utils.secretutils
|
||||
:members: constant_time_compare
|
||||
:members:
|
||||
|
@ -31,6 +31,14 @@ import debtcollector.removals
|
||||
@debtcollector.removals.remove(message='Use hmac.compare_digest instead',
|
||||
category=DeprecationWarning)
|
||||
def constant_time_compare(*args, **kwargs):
|
||||
"""Return True if both string or binary inputs are equal, otherwise False.
|
||||
|
||||
This function should take a constant amount of time regardless of
|
||||
how many characters in the strings match. This function uses an
|
||||
approach designed to prevent timing analysis by avoiding
|
||||
content-based short circuiting behaviour, making it appropriate
|
||||
for cryptography.
|
||||
"""
|
||||
return hmac.compare_digest(*args, **kwargs)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user