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

Use New MD5 API Function #791

Merged
merged 3 commits into from
Sep 11, 2023
Merged

Use New MD5 API Function #791

merged 3 commits into from
Sep 11, 2023

Conversation

rgmiller
Copy link
Contributor

Description

Change the OpenSSL MD5 API function from the deprecated MD5 to the new EVP_Digest. Also added a check for EVP_Digest to the configure script. This PR fixes issue #723.

Motivation and Context

As of OpenSSL v3, the MD5 function is deprecated and generates a warning at compile time if it's used.

How Has This Been Tested?

Ran existing unit tests on an Ubuntu 22.04 system.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Testing (addition of new tests or update to current tests)
  • Documentation (a change to man pages or other documentation)

Checklist:

  • My code follows the UnifyFS code style requirements.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • All commit messages are properly formatted.

Newer versions of the OpenSSL library have deprecated the MD5() API
function in favor of the EVP_* functions.  This commit replaces MD5()
with EVP_Digest().

Note: The new function generates the same hash values as the old
function.
Add a check in the configure script to make sure the OpenSSL library
does have the EVP_Digest() function that we now need.
m4/openssl.m4 Show resolved Hide resolved
@MichaelBrim
Copy link
Collaborator

@rgmiller I just found more uses of MD5_xxxx() functions in util/unifyfs-stage/src/unifyfs-stage-transfer.c. This PR should probably move those calls over to the EVP_xxxx() ones as well.

@rgmiller
Copy link
Contributor Author

@MichaelBrim That's interesting. Those functions don't generate warnings at build time. Maybe they aren't deprecated the way MD5() is? I'll take a look...

@rgmiller
Copy link
Contributor Author

Mystery sort-of solved: I don't see deprecation warnings for the functions in unifyfs-stage-transfer.c because in my build environment, unifyfs-stage is built using the spack-provided version of OpenSSL (which is v1.1.1 and hasn't yet deprecated the functions).

Now the new question is: why is one part of UnifyFS built against the system-provided OpenSSL, while another part is build against a spack-built version?

Newer versions of the OpenSSL library have deprecated the MD5 API
functions in favor of the EVP_* functions.  This commit is essentially
the same as c9516ac, but for the unifyfs-stage util.
@adammoody adammoody merged commit 087bf1b into LLNL:dev Sep 11, 2023
6 checks passed
@rgmiller rgmiller deleted the update_md5_api branch September 22, 2023 15:38
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.

3 participants