Skip to content

Adds WITH_OPENSSL build option#598

Open
jonathanspw wants to merge 1 commit into
openSUSE:masterfrom
jonathanspw:compute_hashes_using_openssl
Open

Adds WITH_OPENSSL build option#598
jonathanspw wants to merge 1 commit into
openSUSE:masterfrom
jonathanspw:compute_hashes_using_openssl

Conversation

@jonathanspw

Copy link
Copy Markdown

If it is ON, OpenSSL will be used instead of internal implementation of computing hashes (MD5, SHA1, SHA224, SHA256, SHA384, SHA512).

Original patch by Jaroslav Rohel jrohel@redhat.com. I've done rebasing work to get it compatible with the current master branch.

This has been carried downstream in CentOS/RHEL for a while but we see no reason why it cannot be upstreamed.

https://gitlab.com/redhat/centos-stream/rpms/libsolv/-/merge_requests/28

If it is ON, OpenSSL will be used instead of internal implementation
of computing hashes (MD5, SHA1, SHA224, SHA256, SHA384, SHA512).
@jonathanspw jonathanspw force-pushed the compute_hashes_using_openssl branch from 3f7e6e3 to 8e10473 Compare September 8, 2025 20:22
@Conan-Kudo

Copy link
Copy Markdown
Member

Why is "patch.patch" checked in?

ppisar added a commit to ppisar/libsolv that referenced this pull request Jun 18, 2026
It adds WITH_OPENSSL build option, defaulting to OFF.  If it is ON,
OpenSSL will be used for computing hashes (MD5, SHA1, SHA224, SHA256,
SHA384, SHA512) instead of the internal implementation.

This patch intentionally uses OpenSSL API which has not been
deprecated in OpenSSL 3 and 4. It calls these functions added in these
OpenSSL version:

    EVP_MD_CTX_dup()        since 3.1.0
    EVP_DigestInit_ex2()    since 3.0.0
    EVP_MD_CTX_new()        since 1.1.0
    EVP_sha512()            since 1.1.0
    EVP_DigestFinal_ex()    since 1.0.0

The EVP_MD_CTX_dup() could be trivialy reimplemented, but since
3.0.0 users can easily upgrade to 3.1.0, I set a minimal required
OpenSSL version to 3.1.0.

This patch is based on Jaroslav Rohel <jrohel@redhat.com> and Jonathan
Wright <jonathan@almalinux.org> work
<openSUSE#598> which used the
deprecated OpenSSL API.
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