Skip to content

Fix openssl tls initialize not verifying server vs client state checks #2606

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

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

thhous-msft
Copy link
Contributor

@thhous-msft thhous-msft commented Apr 4, 2022

Description

These states should be matched, and this is checked in schannel

Testing

Existing tests will likely cover this, although they are going to fail. I'm on my slow system so using CI to find failures.

Documentation

No

@thhous-msft thhous-msft requested a review from a team as a code owner April 4, 2022 18:25
nibanks
nibanks previously approved these changes Apr 4, 2022
anrossi
anrossi previously approved these changes Apr 4, 2022
@nibanks
Copy link
Collaborator

nibanks commented Apr 6, 2022

This is breaking down-level tests:

Handshake/WithHandshakeArgs6.ConnectClientCertificate/1
Handshake/WithHandshakeArgs6.ConnectClientCertificate/3

https://github.com/microsoft/msquic/runs/5821817654?check_suite_focus=true

@thhous-msft thhous-msft dismissed stale reviews from anrossi and nibanks via 15b0919 April 15, 2022 19:32
@thhous-msft
Copy link
Contributor Author

So this bug is actually user visible. It basically means that openssl builds ignore the flag, and will happily apply a server credential to a client. I think this is a bug worth fixing, and backporting down to 2.0 for the downlevel tests to pass.

@nibanks
Copy link
Collaborator

nibanks commented Apr 16, 2022

So this bug is actually user visible. It basically means that openssl builds ignore the flag, and will happily apply a server credential to a client. I think this is a bug worth fixing, and backporting down to 2.0 for the downlevel tests to pass.

I agree. Let's fix this in release/2.0 first. Do we want to fully publish a new release, or "cheat" and just update the test binaries for 2.0.2?

@thhous-msft
Copy link
Contributor Author

Lets just push a release. I'll finish up the fix, and then work on a backport.

@thhous-msft
Copy link
Contributor Author

@anrossi I'm going to need your help finishing this. The pfx certificate does not properly validate.

@anrossi
Copy link
Contributor

anrossi commented Apr 25, 2022

Talked with Thad about how to unblock him and finish this up. It's going to be a larger change to fix the tests, but worth it long-term.

Comment on lines +1178 to +1182
QuicTraceEvent(
LibraryErrorStatus,
"[ lib] ERROR, %u, %s.",
(unsigned int)QUIC_STATUS_INVALID_PARAMETER,
"NULL Pkcs12 passed to CxPlatGetTestCertificate");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
QuicTraceEvent(
LibraryErrorStatus,
"[ lib] ERROR, %u, %s.",
(unsigned int)QUIC_STATUS_INVALID_PARAMETER,
"NULL Pkcs12 passed to CxPlatGetTestCertificate");
QuicTraceEvent(
LibraryErrorStatus,
"[ lib] ERROR, %u, %s.",
(unsigned int)QUIC_STATUS_INVALID_PARAMETER,
"NULL Pkcs12 passed to CxPlatGetTestCertificate");

@thhous-msft
Copy link
Contributor Author

This PR is nowhere near ready to go. There is a ton to do. We need to get a pcks12 writer into the C code to actually complete it.

@nibanks nibanks marked this pull request as draft June 29, 2022 14:50
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.

3 participants