altcp_tls: set errno to EPERM when handshake fails #66
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.
When a TLS client connects to a server and the handshake fails due to certificate validation, no specific error code is returned to the caller. The TCP connection is simply closed. This is not very user-friendly. Instead the client application would probably want to notify the user of the security issue. For that purpose, set errno to EPERM to indicate that a validation error occured.
This change is upstreamed from U-Boot v2025.07-rc2-26-g9349fc2e9c7 [1].
Link: https://source.denx.de/u-boot/u-boot/-/commit/9349fc2e9c76d042f424edfa69cf421225bf0fcc [1]