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: If8b7fb81b18cd44272e572bc0b1eae51a3d766b3
This commit is contained in:
parent
b9c987ee75
commit
3a4f2d6fee
@ -19,7 +19,6 @@ import hashlib
|
||||
import hmac
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import secretutils
|
||||
|
||||
|
||||
OPTS = [
|
||||
@ -111,7 +110,7 @@ def verify_signature(message, secret):
|
||||
return False
|
||||
new_sig = new_sig.encode('ascii')
|
||||
|
||||
return secretutils.constant_time_compare(new_sig, old_sig)
|
||||
return hmac.compare_digest(new_sig, old_sig)
|
||||
|
||||
|
||||
def meter_message_from_counter(sample, secret, publisher_id=None):
|
||||
|
Loading…
Reference in New Issue
Block a user