Skip to content

placement of sha256 checksums on releases page #10209

Closed

Description

sha256 checksums are not in a properly formatted files(or a file).
this makes it difficult to use them.


in case more information is required

example file( https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/SHA256SUMS ) with proper formatting.

58405101948aff46d5261e0a4d3e8f98ea3dc5366a9ada881ebe921eafd5f737  debian-edu-10.0.0-amd64-netinst.iso
de14801ab29ea71e606ff516e87b1ca68499de21098f994778f77121ea41323d  debian-mac-10.0.0-amd64-netinst.iso

most recent affected releases:
https://github.com/PowerShell/PowerShell/tree/v7.0.0-preview.2
https://github.com/PowerShell/PowerShell/releases/tag/v6.2.2
https://github.com/PowerShell/PowerShell/releases/tag/v6.1.5


current workaround(incomplete, not preferred):

  1. Scroll up or down till you find it. Select the checksums on releases page and click Inspect Element and the copy the contents of
<ul>...</ul>
  1. Remove the useless text ...

note- its not preferred because most people don't expect this to be how a popular project to provide checksums.

Activity

  1. added
    WG-Maintainers-Build
    Issue-Enhancement
    on Jul 23, 2019
  2. iSazonov commented on Jul 23, 2019

    @iSazonov
    Collaborator

    Travis Plunk (@TravisEz13) Is it possible to put all checksums in a file?

  3. TravisEz13 commented on Jul 24, 2019

    @TravisEz13
    Member

    @snow8gaia Can you contribute a PowerShell script which takes a directory and uses Get-FileHash to generate the format you want?

  4. vexx32 commented on Jul 26, 2019

    @vexx32
    Collaborator

    Would we need a single file or multiple checksum files, one for each zipfile? 🤔

  5. TravisEz13 commented on Jul 26, 2019

    @TravisEz13
    Member

    I think a single file is adequate as the file has the filenames in it.

  6. vexx32 commented on Jul 26, 2019

    @vexx32
    Collaborator

    If we assume we're doing something like the md5sum format we can fairly easily do this:

    $Path = "/folder/path"
    $OutputPath = Join-Path $Path 'hashes.md5'
    Get-ChildItem -Path $Path |
        Get-FileHash -Algorithm MD5 |
        ForEach-Object { "$($_.Hash) $($_.Path | Split-Path -Leaf)" } |
        Set-Content -Path $OutputPath

    The same can be done for any hashing format that Get-FileHash supports. According to the wiki pages for file verification, hash files typically just list each file on a line where each line contains a hash and a filename, separated by a single space.

    Pretty straightforward format to follow. :)

  7. TravisEz13 commented on Jul 27, 2019

    @TravisEz13
    Member

    This is what @snow8gaia provided. The syntax needs to be fixed, but we should use SHA256

    foreach ( $file in gci -File *.*  )
    { echo ( (Get-FileHash $file).Hash + '  ' + $file.name )  >> checksums.SHA256 }
  8. TravisEz13 commented on Jul 27, 2019

    @TravisEz13
    Member
    $Path = "/folder/path"
    $OutputPath = Join-Path $Path ‘hashes.sha256’
    $null = New-Item $OutputPath -ItemType File -Force
     foreach ($file in Get-ChildItem -Path $Path -File ){
         Get-FileHash -Algorithm SHA256 -Path $file |
         ForEach-Object { "$($_.Hash) $($file.Name)" } |
         Out-File -Path $OutputPath -Append
    }
  9. TravisEz13 commented on Aug 15, 2019

    @TravisEz13
    Member

    I think having one hash file per file would be confusing. I don't think that is a viable option. The format clearly supports multiple files in the hash file, so we can have one file with all the hashes.

  10. Chuxel commented on Sep 18, 2021

    @Chuxel

    Any update on this? I am having to download arm64 for Debian because there's no apt package in the Microsoft pool. There's no great way to verify automatically unless we parse html.

  11. added
    Needs-Triage
    on Sep 23, 2021
  12. TravisEz13 commented on Sep 23, 2021

    @TravisEz13
    Member

    I created #16147 to add the sha256 hashes.

  13. ghost removed
    Needs-Triage
    on Sep 24, 2021
  14. TravisEz13 commented on Sep 29, 2021

    @TravisEz13
    Member

    One difference, according to the file spec, we are supposed to add an * before the file name for binary files.

  15. TravisEz13 commented on Sep 29, 2021

    @TravisEz13
    Member

    Please provide feedback before the release of 7.2. After the release of 7.2, we will only backport changes which are not breaking.

    I only implemented sha256. If you want to implement another hash format, you have the file location and can look at the final code (a bug was found during the release so look at the file in master not the PR), and implement another hash.

  16. Chuxel commented on Sep 29, 2021

    @Chuxel

    SHA256 is fine from my perspective!

  17. TravisEz13 commented on Oct 2, 2021

    @TravisEz13
    Member

    We are going to be required to provide this format for the contents of our packages.
    Generating this should be simple as we will have a task to just generate this.
    Imagine this for packages, how much more difficult would this be to use?

    {
        "Outputs": [
            {
                "Source": "/Accessibility.dll",
                "AzureArtifactsHash": "044D5A90000300000004000000FFFF0000B800000000000000400000000000000000",
                "Sha256Hash": "CF21AA06D52BE85EE2C995BC475E0A90E773AC59B9621D95A53C172FD98DB87F"
            },
            {
                "Source": "/api-ms-win-core-datetime-l1-1-0.dll",
                "AzureArtifactsHash": "044D5A90000300000004000000FFFF0000B800000000000000400000000000000000",
                "Sha256Hash": "913EAAA7997A6AEE53574CFFB83F9C9C1700B1D8B46744A5E12D76A1E53376FD"
            },
            {
                "Source": "/zh-Hant/WindowsFormsIntegration.resources.dll",
                "AzureArtifactsHash": "044D5A90000300000004000000FFFF0000B800000000000000400000000000000000",
                "Sha256Hash": "143F539D34A0653DF145CF3592AA64D60A05147F00ABAC14A6F43E2B59708EC1"
            }
        ],
        "CloudBuildId": "101010",
        "Repo": "https://github.com/powershell/powershell",
        "Branch": "doentexist",
        "CommitId": "6ee476e9c6d25f12257f5f97635c77b586bff314",
        "Version": "7.2.10",
        "Timestamp": 1633150231
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-EnhancementResolution-FixedWG-Maintainers-Build

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions