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

[autoupdate] base64 hash extraction length #2852

Merged
merged 2 commits into from
Dec 6, 2018

Conversation

Ash258
Copy link
Contributor

@Ash258 Ash258 commented Dec 5, 2018

sha512 encoded hash length for Franz is 88 characters length and autoupdate just dont extract it's value.

If anyone have better fix, feel free to edit.

Relate ScoopInstaller/Extras#1487

sha512 encoded hash length for [Franz](https://github.com/meetfranz/franz/releases/download/v5.0.0-beta.19/latest.yml) is 88 characters length and autoupdate just dont extract it's value.

If anyone have better fix, feel free to edit.
Copy link
Member

@rasa rasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hash is base64 encoded, so the mask will need to change from ^[a-fA-F0-9]+$ to ^[a-zA-Z0-9+/]+=?=?=?$
We’ll also have to add logic to check for this type of hash, yes?

@Ash258
Copy link
Contributor Author

Ash258 commented Dec 6, 2018

No. It's already implemeted. (04c9dde)

@r15ch13
Copy link
Member

r15ch13 commented Dec 6, 2018

Actually, it would be enough to fix the condition.
from: $hash.length -in @(32, 40, 64, 128)
to: $hash.length -notin @(32, 40, 64, 128)

This check prevents overwriting $hash with garbage if the result in $base64 contains valid base64 characters but not a real hash. It's just a safety net, I messed up 😁

@Ash258
Copy link
Contributor Author

Ash258 commented Dec 6, 2018

Ok. Tested with -notin variant with franz and rambox pro (from extras) and it's working 👍
Do you know some others manifests, which have encoded hashes?

@r15ch13 r15ch13 merged commit 614b327 into ScoopInstaller:master Dec 6, 2018
@Ash258 Ash258 deleted the patch-1 branch December 6, 2018 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants