-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
OpenSSL 3.0 has removed ERR_GET_FUNC
#57674
Comments
Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq, @GrabYourPitchforks Issue DetailsIt was removed in a beta release of OpenSSL 3.0: openssl/openssl@561e5cd But runtime is still using it: runtime/src/libraries/Native/Unix/System.Security.Cryptography.Native/openssl.c Line 1081 in 49c74ee
cc @bartonjs
|
See openssl/openssl#16254 for more information about why this removal still lets builds succeed (with warnings) but breaks .NET at runtime. |
Huh, I'm rather surprised that we're not failing the build in that case. |
See openssl/openssl#16254 for why. It's not just us, httpd (mod_ssl) broke too: openssl/openssl#16004 (comment). |
Yeah, I mean "I'm surprised we're not already compiling with no-implicit-functions" (or whatever the flag would be) |
Oh. Well, the not-build failures I got were with my own WIP PR (dotnet/corefx#43078), so maybe I messed up somewhere? Edit: only libunwind is using that flag atm: $ git rev-parse HEAD
57e1c232ee4ce5a5a4413de4fc66544e4e346a62
$ ag no-implicit
src/libraries/Native/Unix/System.IO.Compression.Native/CMakeLists.txt
55: set_source_files_properties(${NATIVECOMPRESSION_SOURCES} PROPERTIES COMPILE_FLAGS -Wno-implicit-fallthrough)
src/libraries/Native/Unix/CMakeLists.txt
76: add_compile_options(-Wno-implicit-int-float-conversion)
src/coreclr/pal/src/libunwind/CMakeLists.txt
37: add_compile_options(-Wno-implicit-fallthrough)
44: add_compile_options(-Wno-implicit-function-declaration)
58: add_compile_options(-Wno-implicit-function-declaration)
78: add_compile_options(-Wno-implicit-function-declaration)
|
@omajid Not sure about the libunwind part: (There's a fairly long and boring story why GCC defaults haven't changed yet. It's very hard to do without causing major and totally non-obvious breakage because of the way the changed default causes configure checks to fail unexpectedly. And of course those failing checks automatically disable the tests for the disabled feature, too, so you end up with clean builds that pass the test suite, but can miss rather important functionality.) |
@bartonjs a CI job that builds runtime against OpenSSL 3.0 beta (without any build flag customizations) fails as expected:
I think the silent failures were a 3.1-specific thing due to my backport. |
A bit of a look inside my brain here.
PR coming soon. |
Here's the gist of it, if you want to try it out early. It's missing the portable function binding step, and I'll probably restore part of the comment. @@ -1068,22 +1070,22 @@ int32_t CryptoNative_LookupFriendlyNameByOid(const char* oidValue, const char**
return -2;
}
+ // First, check if oidValue parses as an OID dotted decimal.
+ int i = a2d_ASN1_OBJECT(NULL, 0, oidValue, -1);
+
+ if (i <= 0)
+ {
+ ERR_clear_error();
+ return 0;
+ }
+
// Do a lookup with no_name set. The purpose of this function is to map only the
// dotted decimal to the friendly name. "sha1" in should not result in "sha1" out.
oid = OBJ_txt2obj(oidValue, 1);
- if (!oid)
+ if (oid == NULL)
{
- unsigned long err = ERR_peek_last_error();
-
- // If the most recent error pushed onto the error queue is NOT from OID parsing
- // then signal for an exception to be thrown.
- if (err != 0 && ERR_GET_FUNC(err) != ASN1_F_A2D_ASN1_OBJECT)
- {
- return -1;
- }
-
- return 0;
+ return -1;
} |
Thanks for the fix! I can confirm the change fixes the build for me! |
It was removed in a beta release of OpenSSL 3.0: openssl/openssl@561e5cd
But runtime is still using it:
runtime/src/libraries/Native/Unix/System.Security.Cryptography.Native/openssl.c
Line 1081 in 49c74ee
cc @bartonjs
The text was updated successfully, but these errors were encountered: