summaryrefslogtreecommitdiff
path: root/indra/llcommon/lluuid.cpp
diff options
context:
space:
mode:
authorHenri Beauchamp <sldevel@users.noreply.github.com>2023-02-13 18:34:00 +0100
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-02-13 19:36:54 +0200
commitd998bcbfb54bf5d129f6b88136729a2e2a23c19f (patch)
treec54cf245d9a3f55d8d13f3d5b1586816f8a37787 /indra/llcommon/lluuid.cpp
parent50f9f18427a74e0bdc535df31bc7a0edbb381c1f (diff)
SL-19110 revert LLUUID::combine() to old algorithm to match server code. (#75)
As it happens, the change in the LLUUID::combine() algorithm introduced by one of my previous commits is causing invalid assets creation (seen with some clothing items, such as Shape and Universal types); obviously, the server is using the old algorithm for UUID validation purpose of these assets. This commit reverts LLUUID::combine() code to use LLMD5.
Diffstat (limited to 'indra/llcommon/lluuid.cpp')
-rw-r--r--indra/llcommon/lluuid.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp
index 47c6bc71c8..fc04dca08d 100644
--- a/indra/llcommon/lluuid.cpp
+++ b/indra/llcommon/lluuid.cpp
@@ -44,6 +44,7 @@
#include "lltimer.h"
#include "llthread.h"
#include "llmutex.h"
+#include "llmd5.h"
#include "hbxxh.h"
const LLUUID LLUUID::null;
@@ -400,11 +401,16 @@ LLUUID LLUUID::operator^(const LLUUID& rhs) const
return id;
}
+// WARNING: this algorithm SHALL NOT be changed. It is also used by the server
+// and plays a role in some assets validation (e.g. clothing items). Changing
+// it would cause invalid assets.
void LLUUID::combine(const LLUUID& other, LLUUID& result) const
{
- HBXXH128 hash((const void*)mData, 16, false); // false = do not finalize
- hash.update((const void*)other.mData, 16);
- hash.digest(result);
+ LLMD5 md5_uuid;
+ md5_uuid.update((unsigned char*)mData, 16);
+ md5_uuid.update((unsigned char*)other.mData, 16);
+ md5_uuid.finalize();
+ md5_uuid.raw_digest(result.mData);
}
LLUUID LLUUID::combine(const LLUUID &other) const