From 3b04e045655ed19af3e9107a51cc0384763db1bb Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 25 Aug 2016 07:37:41 +0200 Subject: [PATCH] Fix incorrect hash size for User objects fixes #12533 --- lib/db_ido/dbconnection.cpp | 1 + lib/db_ido/userdbobject.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/db_ido/dbconnection.cpp b/lib/db_ido/dbconnection.cpp index 329c93bac..93031c11e 100644 --- a/lib/db_ido/dbconnection.cpp +++ b/lib/db_ido/dbconnection.cpp @@ -445,6 +445,7 @@ void DbConnection::UpdateObject(const ConfigObject::Ptr& object) Dictionary::Ptr configFields = dbobj->GetConfigFields(); String configHash = dbobj->CalculateConfigHash(configFields); + ASSERT(configHash.GetLength() <= 64); configFields->Set("config_hash", configHash); String cachedHash = GetConfigHash(dbobj); diff --git a/lib/db_ido/userdbobject.cpp b/lib/db_ido/userdbobject.cpp index c50a78e71..57adc53a1 100644 --- a/lib/db_ido/userdbobject.cpp +++ b/lib/db_ido/userdbobject.cpp @@ -175,5 +175,5 @@ String UserDbObject::CalculateConfigHash(const Dictionary::Ptr& configFields) co if (groups) hashData += DbObject::HashValue(groups); - return hashData; + return SHA256(hashData); } -- 2.40.0