Skip to content

another attempt to fix quic loading when chacha is missing#3447

Merged
nibanks merged 2 commits intomicrosoft:mainfrom
wfurt:chacha2
Feb 22, 2023
Merged

another attempt to fix quic loading when chacha is missing#3447
nibanks merged 2 commits intomicrosoft:mainfrom
wfurt:chacha2

Conversation

@wfurt
Copy link
Member

@wfurt wfurt commented Feb 17, 2023

The problem is fact that EVP_chacha20_poly1305 is also referenced from ossl_init_ssl_base. That is linked statically but the dependency may be missing.

The fix is to override that function and return CXPLAT_CHACHA20_POLY1305_ALG_HANDLE e.g. point at the original implementation. The ossl_init_ssl_base may run before the CxPlatCryptInitialize loads. I check and the EVP_add_cipher would silently ignore if NULL is passed in.

contributes to #3422

@wfurt wfurt requested a review from a team as a code owner February 17, 2023 01:58
@nibanks
Copy link
Collaborator

nibanks commented Feb 17, 2023

How do we validate these changes in automation?

@wfurt
Copy link
Member Author

wfurt commented Feb 17, 2023

How do we validate these changes in automation?

I was thinking about it quite a bit recently. I think the only good way is to add more platform coverage e.g. run BVT on more OSes (or containers). In ideal case you would support & test the oldest OS that .NET (or any other important scenario) need. I think the static linking eliminates dependencies so variations would not give you much. Basic run with SystemCrypto would be sufficient. Probably even just platform subset & TLS.

From the recent issues that would be Centos7, Alpine Linux & Ubuntu 18.04.

cc @ManickaP for any more insight.

@nibanks
Copy link
Collaborator

nibanks commented Feb 22, 2023

Going to merge this as is, but we should look into adding at least some test coverage for this stuff.

@nibanks nibanks merged commit f9b2988 into microsoft:main Feb 22, 2023
@wfurt
Copy link
Member Author

wfurt commented Feb 23, 2023

thanks @nibanks. Opened #3460 for tracking

@wfurt wfurt deleted the chacha2 branch February 23, 2023 04:19
nibanks added a commit that referenced this pull request Mar 16, 2023
* make chacha optional on Linux (#3423)

* another attempt to fix quic loading when chacha is missing (#3447)

* Update src/platform/crypt_openssl.c

* CxPlatCryptInitialize

* CxPlatCryptUninitialize

---------

Co-authored-by: Nick Banks <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants