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

Fix gzip decoding when FLG.FHCRC is set #11805

Merged
merged 2 commits into from Oct 29, 2021
Merged

Fix gzip decoding when FLG.FHCRC is set #11805

merged 2 commits into from Oct 29, 2021

Commits on Oct 28, 2021

  1. Fix gzip decoding when FLG.FHCRC is set

     
    Motivation:
    
    The current implementation is not respecting the spec at https://www.ietf.org/rfc/rfc1952, section 2.3.
    > If FHCRC is set, a CRC16 for the gzip header is present,
    > immediately before the compressed data. The CRC16 consists
    > of the two least significant bytes of the CRC32 for all
    > bytes of the gzip header up to and not including the CRC16.
    
    The implementation is reusing the CRC32 logic without taking the two least significant bytes.
    
    Modifications:
    
    Use a method that respects the spec.
     
    Result:
    
    When the FLG.FHCRC bit is set, the correct verification algorithm will be used.
    Alessandro Zoffoli committed Oct 28, 2021
    Copy the full SHA
    8ff8bf4 View commit details
    Browse the repository at this point in the history
  2. Save an extra allocation on CRC16

    Alessandro Zoffoli committed Oct 28, 2021
    Copy the full SHA
    47af932 View commit details
    Browse the repository at this point in the history