Merge "Replace md5 for fips"

This commit is contained in:
Zuul 2021-07-12 23:09:35 +00:00 committed by Gerrit Code Review
commit 6fc04e72ec
3 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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