From c1faa8478c2c821c268ddd619f9c1149b9f5d7b2 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 2 Oct 2024 18:34:03 +0900 Subject: [PATCH] Replace deprecated constant_time_compare The method is being deprecated now[1]. [1] https://review.opendev.org/c/openstack/oslo.utils/+/930198 Closes-Bug: #2081732 Change-Id: Icd707efef0375f4938cd60376b892430c36083c7 --- osprofiler/_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osprofiler/_utils.py b/osprofiler/_utils.py index d903b9b3..644829c8 100644 --- a/osprofiler/_utils.py +++ b/osprofiler/_utils.py @@ -20,7 +20,6 @@ import json import os import uuid -from oslo_utils import secretutils from oslo_utils import uuidutils @@ -107,7 +106,7 @@ def signed_unpack(data, hmac_data, hmac_keys): except Exception: # nosec pass else: - if secretutils.constant_time_compare(hmac_data, user_hmac_data): + if hmac.compare_digest(hmac_data, user_hmac_data): try: contents = json.loads( binary_decode(base64.urlsafe_b64decode(data)))