Fixes for SSLEngine.setWant/NeedClientAuth() and choosing key alias chooseEngineClient/ServerAlias()#172
Merged
JacobBarthelmeh merged 2 commits intowolfSSL:masterfrom Feb 15, 2024
Conversation
981a941 to
fe25e5c
Compare
…ine and choosing of key alias with chooseEngineClient/ServerAlias()
fe25e5c to
1d0b807
Compare
Member
Author
|
Rebased on top of master, so new GitHub actions are run on this. |
JacobBarthelmeh
approved these changes
Feb 15, 2024
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 PR makes fixes around how a server-side SSLEngine handles client authentication, as well as how wolfJSSE calls X509KeyManager/X509ExtendedKeyManager objects to choose a private key alias to be used to load the client/server private key:
WolfSSLEnginesetWantClientAuth(true)was previously too restrictive whensetNeedClientAuth(false). This meant that when a server application requested client authentication, but instructed the JSSE layer to not to be a failure if the client did not send a certificate (ie withsetWantClientAuth(true), we were requiring the client send a certificate and would error out. This PR loosens that requirement to match expected behavior withsetWantClientAuth().X509ExtendedKeyManager, which has two new methods for selecting the key alias to be used for loading the client/server private key (chooseEngineClientAlias(),chooseEngineServerAlias()). This PR finishes that support by calling the correct alias selector method where appropriate. Since some of these methods accept aSocketorSSLEngineas parameter, loading of the private key has been delayed fromSSLContextcreation later to when theSSLSocketorSSLEngineis created.ZD 17248