ulikunitz / xz

Pure golang package for reading and writing xz-compressed files
Other
484 stars 45 forks source link

Checksum None is valid #27

Closed blacktop closed 4 years ago

blacktop commented 4 years ago

I'm trying to decompress iOS OTA files and they are failing your flags check. They appear to have "None" checksum.

https://tukaani.org/xz/xz-file-format-1.0.4.txt

2.1.1.2. Stream Flags

        The first byte of Stream Flags is always a null byte. In the
        future, this byte may be used to indicate a new Stream version
        or other Stream properties.

        The second byte of Stream Flags is a bit field:

            Bit(s)  Mask  Description
             0-3    0x0F  Type of Check (see Section 3.4):
                              ID    Size      Check name
                              0x00   0 bytes  None
                              0x01   4 bytes  CRC32
                              0x02   4 bytes  (Reserved)
                              0x03   4 bytes  (Reserved)
                              0x04   8 bytes  CRC64
                              0x05   8 bytes  (Reserved)
                              0x06   8 bytes  (Reserved)
                              0x07  16 bytes  (Reserved)
                              0x08  16 bytes  (Reserved)
                              0x09  16 bytes  (Reserved)
                              0x0A  32 bytes  SHA-256
                              0x0B  32 bytes  (Reserved)
                              0x0C  32 bytes  (Reserved)
                              0x0D  64 bytes  (Reserved)
                              0x0E  64 bytes  (Reserved)
                              0x0F  64 bytes  (Reserved)
             4-7    0xF0  Reserved for future use; MUST be zero for now.

Thank you for a great pkg!

ulikunitz commented 4 years ago

Thanks for reporting. I have to look into that.

ulikunitz commented 4 years ago

You are right. The code doesn't support the None Check ID and the spec says it SHOULD be supported. I have to look into that.

ulikunitz commented 4 years ago

I have created release v.0.5.7. Please check whether it works for you.

blacktop commented 4 years ago

It works great!! Thank you for such a fast response and elegant solution!!