Remove constant_time_prepare

We no longer see any usage of the function in openstack namespace so
can remove it now.

Related-Bug: #2081732
Change-Id: I3c6205ca518dc9c0fd35680b5559f9fd75f5879a
This commit is contained in:
Takashi Kajinami 2025-03-19 02:30:41 +09:00
parent 67345b82e0
commit 2f36253cb0
2 changed files with 5 additions and 15 deletions

View File

@ -21,27 +21,12 @@ Secret utilities.
import ctypes
import ctypes.util
import hashlib
import hmac
import secrets
import string as _string
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)
@debtcollector.removals.remove(message='Use hashlib.md5 instead',
category=DeprecationWarning)
def md5(string=b'', usedforsecurity=True):

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
The deprecated ``oslo_utils.secretutils.constant_time_compare`` function
has been removed.