Fix build of s2n_random.c if OPENSSL_NO_ENGINE#4705
Fix build of s2n_random.c if OPENSSL_NO_ENGINE#4705neverpanic wants to merge 1 commit intoaws:mainfrom
Conversation
OpenSSL does not create the `openssl/engine.h` header when compiled with the `no-engine` option, which creates the `OPENSSL_NO_ENGINE` preprocessor symbol.
|
Hi @neverpanic ! Thanks for the PR, and sorry for the delay in review. I just want to verify that this works locally before approving it. I should have an update tomorrow! |
|
Hi @neverpanic , could you provide more details about the exact issue that you were encountering and how to reproduce it?
I am having difficulty reproducing the issue. I checked out the latest version of openssl and compiled from source using I double checked the openssl config with However, this does appear to generate the header file. And I can successfully build and test s2n-tls |
|
My apologies, I should have verified my assumptions. Turns out OpenSSL does always install the header, but CentOS 10 Stream hides it, because it does not want to offer ENGINE support, but also did not outright want to break existing binaries compiled on other platforms, so does not actually build with This breaks building against ENGINE symbols (i.e., removes the API), which is the intended outcome, but preserves the ABI for binary compatibility. You can use the There's an additional use of |
Oh, very interesting. Is it necessary to do both? On mainline openssl, all the symbols in My explicit ask would be: If centos's goal is to prevent libraries from building against openssl engine features, I think that they could do this less disruptively by only editing Edit: My own comment made me suspicious, because if |
Unfortunately undeclared functions are not always treated as errors by compilers. Missing includes are.
Builds that ignore warnings about undeclared symbols would likely still pass and continue to use the ENGINE functionality if the header was present. |
|
Sorry for the delay in response. I've been discussing this over with the team, and we're a little worried about the PR. From my earlier investigation, s2n-tls already supports OPENSSL_NO_ENGINE. What it doesn't support is the platform specific modifications that CentOS Stream 10 makes to the OpenSSL installation. As a general rule we try and avoid narrow #ifdef's, especially for things that we aren't testing/validating in CI. This all feels rather "non-standard", which is something we also try to avoid 😄 I'm curious if this has affected any other libraries? My expectation is that this change would break a decent number of other libraries, since openssl/engine.h has always been unconditionally available. |
It's a pretty even split, I'd say. There are quite a few components that never include |
|
Hi @neverpanic, After discussion with the team, we will be closing this PR. This is part of our general policy of not accepting any fixes that we don’t have continuously validated in CI. Additionally, we have concerns about adding build complexity to support such a narrow usecase. Please do let us know if you find any issues with the OPENSSL_NO_ENGINE support. We expect to gracefully handle that case and we’d be happy to help debug those! |
Resolved issues:
Resolves awslabs/aws-crt-python#583
Description of changes:
OpenSSL does not create the
openssl/engine.hheader when compiled with theno-engineoption, which creates theOPENSSL_NO_ENGINEpreprocessor symbol.Call-outs:
I have not tested this.
Testing:
How is this change tested (unit tests, fuzz tests, etc.)? Are there any testing steps to be verified by the reviewer?
Is this a refactor change? If so, how have you proved that the intended behavior hasn't changed?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.