Skip to content
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

certified key selection not working in all cases #236

Open
icing opened this issue Nov 15, 2021 · 0 comments
Open

certified key selection not working in all cases #236

icing opened this issue Nov 15, 2021 · 0 comments
Labels
bug Something isn't working invalid This doesn't seem right question Further information is requested

Comments

@icing
Copy link
Collaborator

icing commented Nov 15, 2021

The certified key selection implemented by rustls_client_hello_select_certified_key() currently does not take the limitations of the later defined rustls_connection into account. This leads to handshake failures.

Assuming you have a server with 2 certified keys: P-384 and RSA.
The rustls_server_config has:

  • TLS 1.2 and 1.3 enabled
  • All 1.3 ciphers and only the RSA 1.2 ciphers

A client connecting with TLS 1.2, the rustls_client_hello_select_certified_key() will chose the P-384 certified key (since the client has the necessary ciphers), create the rustls_connection, start the handshake and fail. The connection simply is unable to do RSA with the P-384 certified key.

The fix would be for rustls_client_hello_select_certified_key() to take the server ciphers into account as well. This is a bit awkward, since the certified key needs to be selected before the rustls_connection for the handshake is created.

At the moment, this is a rare scenario. But selecting the certified key on incomplete understanding of the TLS properties involved, could lead to more common failures in the future. When a new rustls version is released and disables ciphers or particular combinations of them.

Supporting multiple certified keys in a server was helpful in the introduction of EC. The continued support of such a feature via rustls_client_hello_select_certified_key() carries good intentions, however this case shows that it is incomplete.

I guess, either certified key selection is implemented deep inside the rustls handshake itself or it needs to be abandoned.

Opinions?

PS. minor detail: the error of such a failure gives [7107] peer is incompatible: reason omitted. Where does this reason omitted come from? In the rustls code I see only cases of this error with descriptions.

@icing icing added bug Something isn't working invalid This doesn't seem right question Further information is requested labels Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant