Skip to content

Fixes for SSLEngine.setWant/NeedClientAuth() and choosing key alias chooseEngineClient/ServerAlias()#172

Merged
JacobBarthelmeh merged 2 commits intowolfSSL:masterfrom
cconlon:needWantClientAuth
Feb 15, 2024
Merged

Fixes for SSLEngine.setWant/NeedClientAuth() and choosing key alias chooseEngineClient/ServerAlias()#172
JacobBarthelmeh merged 2 commits intowolfSSL:masterfrom
cconlon:needWantClientAuth

Conversation

@cconlon
Copy link
Copy Markdown
Member

@cconlon cconlon commented Jan 30, 2024

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:

  • WolfSSLEngine setWantClientAuth(true) was previously too restrictive when setNeedClientAuth(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 with setWantClientAuth(true), we were requiring the client send a certificate and would error out. This PR loosens that requirement to match expected behavior with setWantClientAuth().
  • We recently added support for 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 a Socket or SSLEngine as parameter, loading of the private key has been delayed from SSLContext creation later to when the SSLSocket or SSLEngine is created.

ZD 17248

@cconlon cconlon self-assigned this Jan 30, 2024
@cconlon cconlon force-pushed the needWantClientAuth branch from 981a941 to fe25e5c Compare January 31, 2024 00:04
@cconlon cconlon assigned JacobBarthelmeh and unassigned cconlon Feb 13, 2024
@cconlon
Copy link
Copy Markdown
Member Author

cconlon commented Feb 14, 2024

Rebased on top of master, so new GitHub actions are run on this.

@JacobBarthelmeh JacobBarthelmeh merged commit ecd67a4 into wolfSSL:master Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants