Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checksum None is valid #27

Closed
blacktop opened this issue Feb 23, 2020 · 4 comments
Closed

Checksum None is valid #27

blacktop opened this issue Feb 23, 2020 · 4 comments

Comments

@blacktop
Copy link

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
Copy link
Owner

Thanks for reporting. I have to look into that.

@ulikunitz
Copy link
Owner

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 added a commit that referenced this issue Feb 24, 2020
Issue #27 reported the problem that an xz file didn't have a checksum.
This commit adds a test.
ulikunitz added a commit that referenced this issue Feb 24, 2020
The check-ID None is valid and SHOULD be supported according to the
xz specification. This commit modifies the Reader to support the
check-ID None.

A new simple hash noneHash is introduced, which makes the
implementation quite elegant. For performance reasons we avoid the
writing into the hash during decompression.

Fixes issue #27 - #27
ulikunitz added a commit that referenced this issue Feb 24, 2020
So far we didn't support the check-ID None for Writer. To request it I
added a NoCheckSum boolean to the configuration, because CRC64 should
still be used as a default.

The commit is related to issue #27 - #27
@ulikunitz
Copy link
Owner

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

@blacktop
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants