Skip to content

Expose weak-crypto feature from openssl-src #1415

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

Closed
wants to merge 1 commit into from

Conversation

mloebel
Copy link
Contributor

@mloebel mloebel commented Feb 15, 2021

Added to openssl-src in alexcrichton/openssl-src-rs#68

@sfackler
Copy link
Owner

I'm not sure this is necessary - someone that desires this can add their own dependency on openssl-src and enable the feature.

@mloebel
Copy link
Contributor Author

mloebel commented Feb 18, 2021

Hm, it makes sense not to add the openssl feature because there is no high level API that makes use of the weak crypto algorithms, but it would be good for openssl-sys to have it. Or at least, if I'm not mistaken then some of the bindings I added in #1416 are for legacy algorithms.

@sfackler
Copy link
Owner

Having it in openssl-sys is just kind of confusing though, IMO. openssl and openssl-sys both enable APIs based on what the underlying OpenSSL build has, but someone may expect that they need to enable this feature. Instead, it switches them over to linking to a vendored OpenSSL which they may not want at all!

@mloebel
Copy link
Contributor Author

mloebel commented Feb 18, 2021

Hm, I might have misunderstood how the feature and cfg system is set up here. But based on what you said, is this right?

  • openssl_sys detects #defines of the used version of OpenSSL and enables internal cfg directives as needed.
  • Which means it can automatically detect if weak algorithms are enabled, and does not need to be told up-front.
  • That way we can either use an system OpenSSL, or a self-build one via the vendored flag, and it recognizes what is possible automatically.
  • In case that we want to vendor OpenSSL, we can enable openssl_src features by depending on it, without going through openssl_sys, because cargo de-duplicates dependencies and merges features.

If this is right, then this PR is indeed unneeded, and I'm sorry for the trouble. :)

@sfackler
Copy link
Owner

Yep, that's correct. It definitely makes sense to add features to openssl-src to control various build-time flags in OpenSSL, but they just don't need to be propagated upstream in Cargo.

@mloebel
Copy link
Contributor Author

mloebel commented Feb 18, 2021

Alright, I'll close this then, and remove the same commits from #1416

@mloebel mloebel closed this Feb 18, 2021
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