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

feat: Warn about future removal of insecure hashes #4132

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

twpayne
Copy link
Owner

@twpayne twpayne commented Dec 10, 2024

I'd like to remove insecure hashes/checksums in the future.

I suspect that these are rarely used, but I don't want to break people who are relying on this feature now, so this PR only adds a warning for now.

@twpayne twpayne requested a review from halostatue December 10, 2024 00:58
Copy link
Collaborator

@halostatue halostatue left a comment

Choose a reason for hiding this comment

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

It looks good, but I think a more subtle approach with size is called for.

@@ -1692,20 +1703,23 @@ func (s *SourceState) getExternalData(
var errs []error

if external.Checksum.Size != 0 {
s.warnFunc("%s: warning: insecure size check will be removed, use a secure hash like SHA256 instead\n", externalRelPath)
Copy link
Collaborator

Choose a reason for hiding this comment

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

size should be permitted in conjunction with the more secure sha256 et al as it would help prevent length extension attacks. (IIRC, sha384 is resistant.)

Copy link
Owner Author

Choose a reason for hiding this comment

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

Thanks for the review. I've update the PR to allow size when specified with a secure hash like SHA256, SHA384, or SHA512.

@twpayne twpayne force-pushed the prep-remove-insecure-hashes branch from 06ebe0b to 830fcb8 Compare December 11, 2024 23:04
@twpayne twpayne merged commit dac078f into master Dec 11, 2024
30 checks passed
@twpayne twpayne deleted the prep-remove-insecure-hashes branch December 11, 2024 23:14
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants