Add dynamic shim for SSL_CTX_set_options and SSL_set_options#67030
Merged
Conversation
This works around ABI breaking change made between OpenSSL 1.1 and 3.0 where argument type and return type was changed from unsigned long to uint64_t, which caused issues on arm32 architectures with OpenSSL 3.0 installed.
|
Tagging subscribers to this area: @dotnet/ncl, @vcsjones Issue DetailsThis works around ABI breaking change made between OpenSSL 1.1 and 3.0 where argument type and return type was changed from unsigned long to uint64_t, which caused issues on arm32 architectures with OpenSSL 3.0 installed. Fixes #66310
|
Member
Author
|
I compiled the changes locally and can confirm that they work on the arm32 machine with OpenSSL 3.0 used in the original repro |
wfurt
reviewed
Mar 23, 2022
bartonjs
reviewed
Mar 23, 2022
Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
Co-authored-by: Tomas Weinfurt <tweinfurt@yahoo.com>
bartonjs
approved these changes
Mar 25, 2022
Member
Author
|
/backport to release/6.0 release/5.0 |
Contributor
|
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/2040311583 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This works around ABI breaking change made between OpenSSL 1.1 and 3.0 where argument type and return type was changed from unsigned long to uint64_t, which caused issues on arm32 architectures with OpenSSL 3.0 installed.
I tried to solve it in a way that does not require explicit knowledge of "I can't call
SSL_set_optionsdirectly, I must use that dynamic shim", so if we are compiling withFEATURE_DISTRO_AGNOSTIC_SSL,SSL_CTX_set_optionsandSSL_set_optionsmacros are redefined inpal_ssl.cto point to the dynamic shims.Unfortunately, I didn't find a reasonable way to redefine these macros globally (see this GodBolt for my attempt). But I don't expect these functions to be ever called from other files.
Fixes #66310