From: Jonathan Dieter Date: Sat, 5 Feb 2022 16:08:45 +0000 (+0000) Subject: Make clear that compressed chunk checksum can be 0s X-Git-Tag: archive/raspbian/1.2.1+ds1-1+rpi1^2~7^2~1^2^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8dfaca25a3948b21e4da6cbdb4a991ca6bca9e53;p=zchunk.git Make clear that compressed chunk checksum can be 0s Also, fix a small bug Signed-off-by: Jonathan Dieter --- diff --git a/src/unzck.c b/src/unzck.c index 2b6ad96..fd4af6f 100644 --- a/src/unzck.c +++ b/src/unzck.c @@ -200,7 +200,7 @@ int main (int argc, char *argv[]) { int ret = zck_get_chunk_valid(dict); if(ret < 1) { if(ret == -1) - LOG_ERROR("Data checksum failed verification\n"); + LOG_ERROR("Dictionary checksum failed verification\n"); else LOG_ERROR("%s", zck_get_error(zck)); goto error2; diff --git a/zchunk_format.txt b/zchunk_format.txt index ecaf278..d1dfe48 100644 --- a/zchunk_format.txt +++ b/zchunk_format.txt @@ -179,6 +179,9 @@ Chunk checksum This is the checksum of the compressed chunk, used to detect whether any two chunks are identical. + NOTE: If flag 2 is set, this checksum must be set to 0s if and only if this + particular chunk is stored uncompressed in the file. + NOTE: Uncompressed chunk checksum will only exist if flag 2 is set to 1 Uncompressed chunk checksum This is the checksum of the uncompressed chunk, used to detect whether a chunk @@ -187,7 +190,10 @@ Uncompressed chunk checksum Chunk length This is an integer containing the length of the chunk. -Uncompressed dict length + NOTE: If flag 2 is set and this particular chunk is stored uncompressed, this + must be the same as the uncompressed chunk length + +Uncompressed chunk length This is an integer containing the length of the chunk after it has been decompressed.