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

configure digest to use in opamDirTrack #4158

Open
hannesm opened this issue Apr 25, 2020 · 1 comment
Open

configure digest to use in opamDirTrack #4158

hannesm opened this issue Apr 25, 2020 · 1 comment

Comments

@hannesm
Copy link
Member

hannesm commented Apr 25, 2020

The opamHash module is in the same opam-core library, and already provides the required functionality. But opamDirTrack uses Digest (from the OCaml stdlib) directly. Is there a reason for this?

If not, it'd be great to be able to select which hash kind to use for DirTrack (maybe via a new field in opamCoreConfig.t?). This would be especially useful for tools such as orb (where maybe some threat models are ruling out to use MD5).

Another option would be to reuse the precise_tracking field, and store a opamHash.t option in there instead of a bool.

@rjbou
Copy link
Collaborator

rjbou commented Apr 27, 2020

It is possible to add an argument to OpamDirTrack function, that has as default precise_tracking. In that case, the hash format check can be done only at OpamDirTrack level, as OpamStd.Core can't depend on OpamHash.

For Digest use, i'll ping @AltGr . Note that those hashes would be needed on a bunch of files, and default sha256 & sha512 call openssl for each computation, if OPAMUSEOPENSSL/use_openssl is not set to false. Otherwise, it's the internal implementation in OpamSHA.

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

No branches or pull requests

2 participants