-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Change the template hash function to SHA-256. #2719
Conversation
The technical idea is sound. Could the change from SHA-1 to SHA-256 be more of a staged rollout? (i.e., migrate a good chunk of the existing casks to SHA-256 so that people who look at code examples see SHA-256, add a deprecation warning, then upgrade the docs and the template?) How did Homebrew handle the obsolescence of MD5? For the CONTRIBUTING.md, I'd suggest more comprehensive edits, like:
I think making the sort of changes you're making in the docs and in the cask template could confuse users. The code examples in CONTRIBUTING.md still use |
i think it is less confusing if we do this change it in one step - not in a transition period. (if its scriptable to get all ~700 SHA1 changed) |
@muescha For new contributors, definitely. As an existing contributor, I'm going to have to break old habits, even though I know perfectly well how to get a SHA-256 hash (and I wrote the blurb in CONTRIBUTING.md on how to do that). It would be helpful to have a more explicit deprecation of SHA-1 hashes than this commit and discussion. Implicit deprecation does not suffice; without the commit message, I would continue to submit casks with SHA-1 hashes until someone pointed out the deprecation, and then I would add a deprecation warning to the docs anyway in a PR. Scripting is probably the most practical way to migrate, even though the premise of this changeset suggests that perhaps we shouldn't completely trust the SHA-1 hashes we currently have, despite the lack of practical attacks on SHA-1. |
To be clear, I wasn't suggesting deprecating SHA-1 in Although git can't change at this point, new applications might as well use SHA-256 where possible, and If it would be more desirable for all casks to use the same hash, I don't object. I just thought suggesting it as the default for new casks was the right starting place for a pull request. |
👍 on the merits. Checksums have a purpose. Weaker hashes are less able to meet that purpose. But there's no need to change the Casks all at once. This patch is the right approach -- just change the docs, removing mentions of sha1. For consistency, it should also change We could (if it is agreed) deprecate sha1 in some future release. Then (possibly) remove them in another, later release. Smooth transitions are good. Nothing wrong with @goxberry continuing to submit SHA1s. Also, nothing wrong with @lgarron planning for the future. |
Amended the commit to include a change in "Good things to Know". |
@rolandwalker @lgarron I agree with the change on the merits, too. I don't think migrating all casks now is necessary, and I think that planning for the future is a good thing. I am all for new casks using SHA-256. Since I like the change and want to see it succeed with a minimum of issues, I'm interested in making the transition clear, which is why I'm advocating for the sake of consistency that the code examples in CONTRIBUTING.md also be changed (along with their corresponding casks). I would also prefer that we note more explicitly that there is going to be a transition because the defaults are changing. I don't object if we don't make that transition explicit because I'll adjust. |
I've updated the top of Does anyone still feel this should be documented more explicitly? I think the current PR is relatively clear about things. |
@lgarron Looks good to me. Thanks for editing for consistency! |
@phinze I suppose you should weigh in with a ruling. |
👑 great discussion and solid conclusions. let's start the process! 🚀 |
Change the template hash function to SHA-256.
I accidentally missed this in Homebrew#2719.
Following up on Homebrew#2719. MD5 checksums are * nowhere mentioned in our docs * not used in any existing Cask * deprecated in Homebrew Therefore it seems sensible to delete this code.
SHA-1 is slowly losing its footing, and SHA-256 is a better choice going forward. (SHA3/Keccak is still not finalized.)
SHA-256 is already supported by
homebrew-cask
in exactly the same way as SHA-1. In fact, my submitted casks have been using SHA-256.This pull request doesn't break any functionality (casks with SHA-1 hashes will continue to work), but the template from
brew cask create
will now have a field for SHA-256 by default.