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

SHA512 hash - Linux App image wrong value #4713

Closed
AltCoiFish opened this issue Feb 22, 2021 · 5 comments
Closed

SHA512 hash - Linux App image wrong value #4713

AltCoiFish opened this issue Feb 22, 2021 · 5 comments

Comments

@AltCoiFish
Copy link

AltCoiFish commented Feb 22, 2021

-$ cat latest-linux.yml

version: 0.81.1
files:

  • url: Polkadot-JS-Apps-0.81.1.AppImage
    sha512: oIMoSoy2SVTtHQLmuk9XXFHII50W/iahh8ShxqcKpJX/O3wk3Dc8uLRTzds3zo0ELEisse86VgN56PUPydJpaQ==
    size: 89387265
    blockMapSize: 94485
    path: Polkadot-JS-Apps-0.81.1.AppImage
    sha512: oIMoSoy2SVTtHQLmuk9XXFHII50W/iahh8ShxqcKpJX/O3wk3Dc8uLRTzds3zo0ELEisse86VgN56PUPydJpaQ==
    releaseDate: '2021-02-22T10:00:15.479Z

based on the lastest version https://github.com/polkadot-js/apps/releases/tag/v0.81.1 is:

_$ sha512sum Polkadot-JS-Apps-0.81.1.AppImage
a083284a8cb64954ed1d02e6ba4f575c51c8239d16fe26a187c4a1c6a70aa495ff3b7c24dc373cb8b453cddb37ce8d042c48acb1ef3a560379e8f50fc9d26969 Polkadot-JS-Apps-0.81.1.AppImage

@jacogr
Copy link
Member

jacogr commented Feb 22, 2021

The sha512 is base64 encoded. When I put this in the JS console of the apps UI -

// output
console.log(
  // convert bytes to hex
  util.u8aToHex(
   // decode base64
    hashing.base64Decode(
      'oIMoSoy2SVTtHQLmuk9XXFHII50W/iahh8ShxqcKpJX/O3wk3Dc8uLRTzds3zo0ELEisse86VgN56PUPydJpaQ=='
    ),
    // don't add the 0x in-front
    -1, false
  )
)

the output is -

a083284a8cb64954ed1d02e6ba4f575c51c8239d16fe26a187c4a1c6a70aa495ff3b7c24dc373cb8b453cddb37ce8d042c48acb1ef3a560379e8f50fc9d26969

Don't ask me why the sha512 is base64 encoded there. The packager itself does that.

@AltCoiFish
Copy link
Author

The sha512 is base64 encoded. When I put this in the JS console of the apps UI -

Sounds reasonable, not sure if everyone did know the hash was base64 encoded, as I was used to get plain sha2256 or sha512 hashes on open-source software.

Could we add the base64 information in : latest-linux.yml ?

@AltCoiFish
Copy link
Author

closing it, as this might be helpful for new user checking the hash values before downloading it.

@jacogr
Copy link
Member

jacogr commented Feb 22, 2021

That is all part of the Electron packager and it uses that information to manage the auto-updates. So we cannot mess with the format there at all. As much as I also find it weird.

So there should be a one-liner that does sha -> bytes -> base64 that can be clearly documented for checks. Something along these lines -

$ sha512sum Polkadot-JS-Apps-0.81.1.AppImage | xxd -r -p | base64

@polkadot-js-bot
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Jun 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants