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

Lint: ensure checksum is present and not MD5 #304

Merged
merged 1 commit into from
May 14, 2024

Conversation

hannesm
Copy link
Contributor

@hannesm hannesm commented May 10, 2024

Dear valued developers,

I hereby propose another lint check for the amazing opam-repo-ci -- namely something that ensures that all artifacts include a checksum that is not MD5. MD5 is since years not a secure digest, but forgeable. We should ensure the opam package system is not extended with more packages that include this weak hash algorithm.

Since I have not succeeded to compile opam-repo-ci locally, I'd await your (or the CI) feedback on this change.

Also, since this is a new check, I'm happy to hear your opinion about it.

A new lint check is introduced which checks that all artifacts
(url, extra_sources, extra_files) include a non-MD5 checksum.

The motivation is to get rid of weak hash algorithms used all
over the ecosystem.
@benmandrew
Copy link
Contributor

Looks good to me, thanks!

Just to clarify, we'd still like to allow MD5, just not without SHA-256 or -512?

@hannesm
Copy link
Contributor Author

hannesm commented May 13, 2024

Looks good to me, thanks!

Just to clarify, we'd still like to allow MD5, just not without SHA-256 or -512?

That's what the current PR does, exactly. This is based on the observation that opam checks all provided checksums (and not only one). I'd be happy if someone could independently verify that this is the case (I did so more than a year ago, leading to https://opam.ocaml.org/blog/opam-2-1-5-local-cache/).

I'd as well be fine to have a stricter check, but I'd guess we should adapt opam-publish first to not emit md5 (and sha512) checksums, but only emit sha512.

@benmandrew
Copy link
Contributor

Looks like it does check every single one, so no harm in including MD5 if stronger hashes are present. Thank you for the contribution!

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.

2 participants