go/src/compress/gzip
Joe Tsai d0e8d3a7ae compress/gzip: fix Reader to properly check FHCRC
RFC 1952, section 3.2.3 says:
>>>
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.
<<<

Thus, instead of computing the CRC only over the first 10 bytes
of the header, we compute it over the whole header (minus CRC16).

Fixes #15070

Change-Id: I55703fd30b535b12abeb5e3962d4da0a86ed615a
Reviewed-on: https://go-review.googlesource.com/21466
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-04-14 23:45:51 +00:00
..
testdata all: zero mtimes in testdata gz files 2016-03-25 04:02:36 +00:00
gunzip.go compress/gzip: fix Reader to properly check FHCRC 2016-04-14 23:45:51 +00:00
gunzip_test.go compress/gzip: fix Reader to properly check FHCRC 2016-04-14 23:45:51 +00:00
gzip.go compress/gzip: fix Reader to properly check FHCRC 2016-04-14 23:45:51 +00:00
gzip_test.go
issue14937_test.go compress/gzip: clean up zero-mtimes test 2016-03-25 22:22:11 +00:00