ddup: remove openssl dependency (#535) - #681
Open
jeking3 wants to merge 1 commit into
Open
Conversation
The `ddup` command uses SHA256 to identify files with identical content and prints each duplicate's digest to stdout. Because that digest is user-visible output, changing the hash algorithm would be a breaking change. Instead, we vendor a permissively-licensed (public-domain), portable SHA256 implementation to sever the dependency on openssl. This lets us build on newer operating systems that have dropped the openssl 1.1 low-level SHA API. The SHA256 implementation is from Brad Conte's public domain solution and a known-answer regression test was added. This builds under ubuntu 26.04 inside a continer. In the future, if a higher-performing content comparison is desired, it can be added via a new command-line option and/or by embedding the hash choice into any future output or cache format, defaulting to SHA256. That default could change in a later major release, and SHA256 eventually dropped. This fixes hpc#535. Signed-off-by: Jim King <jimk@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
ddupcommand uses SHA256 to identify files with identical content and prints each duplicate's digest to stdout. Because that digest is user-visible output, changing the hash algorithm could be a breaking change. Instead, we leverage a permissively-licensed (public-domain), portable SHA256 implementation to sever the dependency on openssl. This lets us build on newer operating systems that have dropped the openssl 1.1 low-level SHA API. This builds under ubuntu 26.04 inside a container, for example.The SHA256 implementation is from Brad Conte's public domain solution and a known-answer regression test was added.
In the future, if a higher-performing content comparison is desired, it can be added via a new command-line option and/or by embedding the hash choice into any future output or cache format, defaulting to SHA256. That default could change in a later major release.
This fixes #535.