diff --git a/designate/storage/impl_sqlalchemy/__init__.py b/designate/storage/impl_sqlalchemy/__init__.py index 00e2575d2..7449f9e21 100644 --- a/designate/storage/impl_sqlalchemy/__init__.py +++ b/designate/storage/impl_sqlalchemy/__init__.py @@ -14,9 +14,9 @@ # License for the specific language governing permissions and limitations # under the License. import time -import hashlib from oslo_log import log as logging +from oslo_utils.secretutils import md5 from sqlalchemy import select, distinct, func from sqlalchemy.sql.expression import or_ @@ -799,11 +799,11 @@ class SQLAlchemyStorage(sqlalchemy_base.SQLAlchemy, storage_base.Storage): """ Calculates the hash of the record, used to ensure record uniqueness. """ - md5 = hashlib.md5() - md5.update(("%s:%s" % (record.recordset_id, - record.data)).encode('utf-8')) + md5sum = md5(usedforsecurity=False) + md5sum.update(("%s:%s" % (record.recordset_id, + record.data)).encode('utf-8')) - return md5.hexdigest() + return md5sum.hexdigest() def create_record(self, context, zone_id, recordset_id, record): # Fetch the zone as we need the tenant_id diff --git a/lower-constraints.txt b/lower-constraints.txt index 90985cdbe..1a2e8ad5d 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -83,7 +83,7 @@ oslo.rootwrap==5.8.0 oslo.serialization==2.25.0 oslo.service==1.31.0 oslo.upgradecheck==1.3.0 -oslo.utils==4.5.0 +oslo.utils==4.7.0 oslo.versionedobjects==1.31.2 oslotest==3.2.0 packaging==20.4 diff --git a/requirements.txt b/requirements.txt index 26c39be30..6f622631a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,7 +20,7 @@ oslo.rootwrap>=5.8.0 # Apache-2.0 oslo.serialization>=2.25.0 # Apache-2.0 oslo.service>=1.31.0 # Apache-2.0 oslo.upgradecheck>=1.3.0 -oslo.utils>=4.5.0 # Apache-2.0 +oslo.utils>=4.7.0 # Apache-2.0 oslo.versionedobjects>=1.31.2 # Apache-2.0 Paste>=2.0.2 # MIT PasteDeploy>=1.5.0 # MIT