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

Remove INVALID_CALL from mid-handshake error message #291

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

TheJokr
Copy link
Contributor

@TheJokr TheJokr commented Nov 12, 2024

Mid-handshake errors that occur before certificate verification currently look like this:

TLS handshake failed: cert verification failed - Invalid certificate verification context [WRONG_VERSION_NUMBER]

Despite no certificate even being received yet, the error complains about a failed verification. The cause here is that cert verification failed is only omitted if the verification result is OK. The default in BoringSSL before verification runs is INVALID_CALL, however.

INVALID_CALL is set/returned in these places:

It is not used anywhere else as a verification result code. To improve the error message, this commit adds INVALID_CALL as a verification result for which no additional error is dislayed.

Mid-handshake errors that occur before certificate verification
currently look like this:

```
TLS handshake failed: cert verification failed - Invalid certificate verification context [WRONG_VERSION_NUMBER]
```

Despite no certificate even being received yet, the error complains
about a failed verification. The cause here is that `cert verification
failed` is only omitted if the verification result is `OK`. The default
in BoringSSL before verification runs is `INVALID_CALL`, however.

`INVALID_CALL` is set/returned in these places:
- https://github.com/google/boringssl/blob/44b3df6f03d85c901767250329c571db405122d5/src/ssl/internal.h#L3904
- https://github.com/google/boringssl/blob/44b3df6f03d85c901767250329c571db405122d5/src/ssl/ssl_session.cc#L396
- https://github.com/google/boringssl/blob/44b3df6f03d85c901767250329c571db405122d5/src/ssl/ssl_x509.cc#L713

It is not used anywhere else as a verification result code. To improve
the error message, this commit adds `INVALID_CALL` as a verification
result for which no additional error is dislayed.
Copy link
Collaborator

@kornelski kornelski left a comment

Choose a reason for hiding this comment

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

This doesn't change the verification logic, only error message text, so it's safe to do it.

@kornelski kornelski merged commit baede6c into cloudflare:master Jan 6, 2025
@TheJokr TheJokr deleted the lblocher/handshake-err branch January 7, 2025 10:20
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