From: Gunnar Beutner Date: Thu, 25 Aug 2016 05:37:41 +0000 (+0200) Subject: Fix incorrect hash size for User objects X-Git-Tag: v2.5.3~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b04e045655ed19af3e9107a51cc0384763db1bb;p=icinga2 Fix incorrect hash size for User objects fixes #12533 --- 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); }