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

archive/zip: CRC32 data descriptor and central directory entry need no longer match in go1.17 #49089

Closed
saracen opened this issue Oct 20, 2021 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@saracen
Copy link
Contributor

saracen commented Oct 20, 2021

What version of Go are you using (go version)?

$ go version
go version go1.17 darwin/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What did you do?

Before 1.17, if a zip file's central directory entry's CRC32 value was different to it's data descriptor entry, ErrChecksum would be returned.

I've written a test with such behaviour. This fails with 1.17, but succeeds for 1.16.
https://play.golang.org/p/103JOqe-uKp

What did you expect to see?

I don't think it was intentional for this to be changed, therefore, both CRC32 entries should still be checked against each other.

What did you see instead?

If a data descriptor is present, only it's CRC32 field is taken into consideration.

@cherrymui cherrymui added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 20, 2021
@cherrymui cherrymui added this to the Go1.18 milestone Oct 20, 2021
@cherrymui
Copy link
Member

cc @dsnet @bradfitz

@gopherbot
Copy link

Change https://golang.org/cl/357489 mentions this issue: archive/zip: fix data descriptor reads and checksum matches

@golang golang locked and limited conversation to collaborators Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants