Validating hash of .filez objects



Hi,

I'm trying to understand how the hash of filez objects is calculated in
the OSTree repo.

The dirtree, dirmeta and commit appear to be just stored under the hash
of their contents, but the .filez seems to include some compression I
don't understand:


# sha256sum -b $(find . -type f)
3c064a2f38... *./3c/064a2f38....dirtree
2a28dac42b... *./2a/28dac42b....dirmeta
16ef2f2629... *./16/ef2f2629....commit

These all work, but the filez commit doesn't match:

23b2e93cf796cbb0078d2f900c19e42968e60b62d787cf7456d1e87130663de8
*./a1/f4f81612ce959883f58e83789f6c7d97b0b55b801b2a09955235f40b0f2dfb.filez

I guess this is because filez is gzip'd and the hash is calculated over
the uncompressed contents, but I'm having trouble working out an
incantation that can decompress it.  Do you have some pointers to how
this works, please?  I've tried zlib decompressing all suffixes of the
file (to skip a header) but with no luck so far.

My end goal is to check on the server that objects are correct after
they have been uploaded.


Best Regards,

Phil

-- 
Phil Wise, ATS Advanced Telematic Systems GmbH
Kantstrasse 162, 10623 Berlin
Managing Directors: Dirk Pöschl, Armin G. Schmidt
Register Court: HRB 151501 B, Amtsgericht Charlottenburg


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]