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

sha1 checksum of zip is compared with md5 #253

Closed
epu opened this issue Apr 22, 2015 · 6 comments
Closed

sha1 checksum of zip is compared with md5 #253

epu opened this issue Apr 22, 2015 · 6 comments

Comments

@epu
Copy link

epu commented Apr 22, 2015

Install-ChocolateyZipPackage fails when passing a valid sha1 checksum with checksumType set to 'sha1', but succeeds with an md5 checksum/checksumType.

The error asserts that an md5 comparison was done, even though I passed in 'sha1' as the checksumType.

Is there a test already covering this case?

See https://github.com/epu/epu-choco-pkg/blob/master/premake.portable/tools/chocolateyinstall.ps1

@ferventcoder
Copy link
Member

I'm confused. The link you sent shows checksumType = 'md5' https://github.com/epu/epu-choco-pkg/blob/master/premake.portable/tools/chocolateyinstall.ps1#L7

Was that after fixing it?

@epu
Copy link
Author

epu commented Apr 22, 2015

Yeah, that's my workaround. If you uncomment the sha1 version and comment out the md5 version, it breaks.

@ferventcoder
Copy link
Member

Ah sorry, glossed right over the commented stuff.

@ferventcoder ferventcoder added this to the 0.9.9.6 milestone Apr 22, 2015
@epu
Copy link
Author

epu commented Apr 22, 2015

Oh! I learned a new github link trick! (link to file with line number). Thanks!

@ferventcoder
Copy link
Member

Might have found the issue. Was setting checksumType to the 64 bit version, which was empty. All because $url64 defaulted to $url.

@ferventcoder ferventcoder self-assigned this May 2, 2015
ferventcoder added a commit to ferventcoder/choco that referenced this issue May 2, 2015
Due to defaulting `$url64bit` to `$url`, `$checksumType` was converting
to the 64 bit checksumtype, even if it was empty. Which causes
checksumtype to default to md5, no matter what the checksumtype passed
in is.

Move the checksumType setting for x64 into the check if the urls for 32
bit and 64 bit are different. Additionally, ensure that the
checksumtype64 is not empty.
@epu
Copy link
Author

epu commented May 3, 2015

Ah, nice catch.

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

No branches or pull requests

3 participants