GithubHelp home page GithubHelp logo

chocolatey / checksum Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 13.0 2.1 MB

Validates MD5/SHA1 CheckSums on the command line.

License: Apache License 2.0

Shell 5.49% C# 80.60% Batchfile 2.00% PowerShell 11.92%

checksum's Introduction

THIS REPOSITORY IS DEPRECATED

See https://github.com/chocolatey/choco for further development

Chocolatey NuGet (like apt-get, but for Windows) Build status

Chocolatey Logo

WEBSITE

Chocolatey.org

LICENSE

Apache 2.0 - see docs/legal (just LEGAL in the zip folder)

INFO

##Please see the wiki

SOURCE REQUIREMENTS

  • .NET Framework 4.0
  • PowerShell 2.0+

CREDITS

See docs/legal/CREDITS (just LEGAL/Credits in the zip folder)

checksum's People

Contributors

admiringworm avatar corbob avatar ferventcoder avatar gep13 avatar stefanscherer avatar thecakeisnaoh avatar vexx32 avatar windos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

checksum's Issues

Uplift to .Net framework 4.8

Description

Switch to use .NET Framework 4.8, rather than the currently targeted 4.0.

Why Is It Needed

Chocolatey CLI is moving to use .NET Framework 4.8, and checksum should be upgraded as well.

Related Issues and Tickets

Acceptance Tests

All tests, unit, integration, and Pester tests, all continue to work as expected.

Done Checklist

  • Documentation has been updated.
  • Automated tests have been added to cover this bug.
  • Manual tests have been added to cover this bug.

Invalid: Argument parsing and hash type currently not complete/functional

I was trying to simply use the first of only two real mandatory switches - the file path:

C:\temp> checksum --hashtype=sha256 -f="c:\temp\rhash-1.3.5-1-win64.zip"
-f=c:\temp\rhash-1.3.5-1-win64.zip: The given path's format is not supported.
C:\temp> checksum -f="c:\temp\rhash-1.3.5-1-win64.zip"
-f=c:\temp\rhash-1.3.5-1-win64.zip: The given path's format is not supported.
C:\temp> checksum --file="c:\temp\rhash-1.3.5-1-win64.zip"
--file=c:\temp\rhash-1.3.5-1-win64.zip: The given path's format is not supported.
C:\temp> checksum --file='c:\temp\rhash-1.3.5-1-win64.zip'
--file=c:\temp\rhash-1.3.5-1-win64.zip: The given path's format is not supported.
C:\temp> checksum --file=c:\temp\rhash-1.3.5-1-win64.zip
--file=c:\temp\rhash-1.3.5-1-win64.zip: The given path's format is not supported.
C:\temp> checksum rhash-1.3.5-1-win64.zip
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip

...and then I read the "parse_arguments_and_set_up_configuration" code and see that you have not coded handling the path (yet?).

Then I just wanted to hash SHA256, so I try the second switch:

C:\temp> checksum .\rhash-1.3.5-1-win64.zip
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum .\rhash-1.3.5-1-win64.zip -t sha256
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum .\rhash-1.3.5-1-win64.zip -t=sha256
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum .\rhash-1.3.5-1-win64.zip -t 'sha256'
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum --hashtype=sha256 rhash-1.3.5-1-win64.zip
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum --hashtype=sha256 -f=rhash-1.3.5-1-win64.zip
C:\temp> checksum rhash-1.3.5-1-win64.zip
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum rhash-1.3.5-1-win64.zip --hashtype sha256
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum rhash-1.3.5-1-win64.zip --hashtype=sha256
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum rhash-1.3.5-1-win64.zip --hashtype="sha256"
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum rhash-1.3.5-1-win64.zip --hashtype "sha256"
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum rhash-1.3.5-1-win64.zip -t sha256
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum rhash-1.3.5-1-win64.zip -t "sha256"
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip
C:\temp> checksum rhash-1.3.5-1-win64.zip -t="sha256"
a965d954b7ef97d0801eb267a830aedd *rhash-1.3.5-1-win64.zip

....and then after fighting with it, I jumped back here and read the code for the "parse_arguments_and_set_up_configuration" method and immediately saw that you simply have not coded any handling for the hash type (yet?)......not sure the status of this little util but you may want to just note in the util's help and/or the readme that it only currently computes MD5 and the switches do not work and maybe a mention of whether there are plans to do so etc.

It looked like a cool quick console util that does what some of my PS module functions do so figured it could come in handy. Maybe if I get some time I can do a quick pull and help you finish it. :(

Add required VERIFICATION.txt file

As part of submitting a package to the Chocolatey Community Repository, a reasonably new requirement is that if it is an embedded package, that it contains a VERIFICATION.txt file, explaining how the binary files can be verified.

This wasn't in place that last time we pushed checksum to the CCR, so we need to get this added., otherwise, it can't be approved.

TeamCity Build Definition Required

Is Your Feature Request Related To A Problem? Please describe.

N/A

Describe The Solution. Why is it needed?

As part of improvements to Chocolatey Software build processes, we're moving build definitions into code where possible.
This will allow us to import the build to any of the TeamCity servers we need to.

Additional Context.

N/A

Related Issues

BuildProcess - Replace UppercuT build scripts

Description

Replace the UppercuT build scripts with Cake or a similar tool that allows updated build tools.

Why Is It Needed

The UppercuT build scripts are showing their age with being unable to work with newer versions of the .Net build process.

Related Issues and Tickets

GitHub issue for Open Source Chocolatey
GitLab issue for Chocolatey Licensed Extension

Acceptance Tests

  • Replace build.bat and test.bat with new scripts.
  • Ensure that building and testing still works as expected.

Done Checklist

  • Documentation has been updated.
  • Build scripts have been updated.

Does not work on file paths with apostrophe(s)

What You Are Seeing?

Checksum is stripping apostrophe(s) from file paths, and therefore not finding the file to checksum.

What is Expected?

That checksum.exe will work on file paths that contain apostrophe(s).

How Did You Get This To Happen? (Steps to Reproduce)

  1. Create a Windows 10 offline user called Mark's and it to an administrator account
  2. Log in as Mark's
  3. Run choco install 4k-video-downloader

Output Log

Log

Verifying package provided checksum of 'bd60576f083e250245978fff6030e7bf8e448fda4b24dd7715b2f67d5c3d9e47' for 'C:\Users\Mark's\AppData\Local\Temp\chocolatey\4k-video-downloader\4.20.4\4k-video-downloaderInstall.MSI'.
Running Get-ChecksumValid -file 'C:\Users\Mark's\AppData\Local\Temp\chocolatey\4k-video-downloader\4.20.4\4k-video-downloaderInstall.MSI' -checksum 'bd60576f083e250245978fff6030e7bf8e448fda4b24dd7715b2f67d5c3d9e47' -checksumType 'sha256' -originalUrl 'https://dl.4kdownload.com/app/4kvideodownloader_4.20.4_x64.msi?source=chocolatey'
checksum.exe found at 'C:\ProgramData\chocolatey\helpers\..\tools\checksum.exe'
Executing command ['C:\ProgramData\chocolatey\helpers\..\tools\checksum.exe' -c="bd60576f083e250245978fff6030e7bf8e448fda4b24dd7715b2f67d5c3d9e47" -t="sha256" -f="C:\Users\Mark's\AppData\Local\Temp\chocolatey\4k-video-downloader\4.20.4\4k-video-downloaderInstall.MSI"]
File 'C:\Users\Marks\AppData\Local\Temp\chocolatey\4k-video-downloader\4.20.4\4k-video-downloaderInstall.MSI' doesn't exist.
Command ['C:\ProgramData\chocolatey\helpers\..\tools\checksum.exe' -c="bd60576f083e250245978fff6030e7bf8e448fda4b24dd7715b2f67d5c3d9e47" -t="sha256" -f="C:\Users\Mark's\AppData\Local\Temp\chocolatey\4k-video-downloader\4.20.4\4k-video-downloaderInstall.MSI"] exited with '1'.
ERROR: Checksum for 'C:\Users\Mark's\AppData\Local\Temp\chocolatey\4k-video-downloader\4.20.4\4k-video-downloaderInstall.MSI' did not meet 'bd60576f083e250245978fff6030e7bf8e448fda4b24dd7715b2f67d5c3d9e47' for checksum type 'sha256'. Consider passing the actual checksums through with --checksum --checksum64 once you validate the checksums are appropriate. A less secure option is to pass --ignore-checksums if necessary.
 at Get-ChecksumValid, C:\ProgramData\chocolatey\helpers\functions\Get-CheckSumValid.ps1: line 210
at Get-ChocolateyWebFile, C:\ProgramData\chocolatey\helpers\functions\Get-ChocolateyWebFile.ps1: line 385
at Install-ChocolateyPackage, C:\ProgramData\chocolatey\helpers\functions\Install-ChocolateyPackage.ps1: line 402
at <ScriptBlock>, C:\ProgramData\chocolatey\lib\4k-video-downloader\tools\chocolateyinstall.ps1: line 25
at <ScriptBlock>, C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1: line 49
at <ScriptBlock>, <No file>: line 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.