+
+ h1 = le64toh(o->data.hash);
+
+ if (o->object.flags & OBJECT_COMPRESSED) {
+ void *b = NULL;
+ uint64_t alloc = 0, b_size;
+
+ if (!uncompress_blob(o->data.payload,
+ le64toh(o->object.size) - offsetof(Object, data.payload),
+ &b, &alloc, &b_size))
+ return -EBADMSG;
+
+ h2 = hash64(b, b_size);
+ free(b);
+ } else
+ h2 = hash64(o->data.payload, le64toh(o->object.size) - offsetof(Object, data.payload));
+
+ if (h1 != h2)
+ return -EBADMSG;
+