lws/openssl-wrapper: Align ssl_handshake and openssl standard return values#3441
Open
ThePassionate wants to merge 3 commits intowarmcat:mainfrom
Open
lws/openssl-wrapper: Align ssl_handshake and openssl standard return values#3441ThePassionate wants to merge 3 commits intowarmcat:mainfrom
ThePassionate wants to merge 3 commits intowarmcat:mainfrom
Conversation
Co-developed-by: Gemini 2.5 Pro
…values standard return code of ssl_handshake list following: 0 The TLS/SSL handshake was not successful but was shut down controlled and by the specifications of the TLS/SSL protocol. Call SSL_get_error() with the return value ret to find out the reason. 1 The TLS/SSL handshake was successfully completed, a TLS/SSL connection has been established. <0 The TLS/SSL handshake was not successful because a fatal error occurred either at the protocol level or a connection failure occurred. The shutdown was not clean. It can also occur of action is need to continue the operation for non-blocking BIOs. Call SSL_get_error() with the return value ret to find out the reason. so ssl_error_read/write should return -1. Signed-off-by: makejian <makejian@xiaomi.com>
Member
|
I notice that we change the return code meaning, but we don't adapt the caller. Since mbedtls works today, are we sure that is a good idea? |
37dca44 to
b4c7439
Compare
c5ef352 to
46b045e
Compare
1faedc3 to
efb9f35
Compare
a0c73c1 to
7c9d4bc
Compare
217e720 to
4f15c21
Compare
2b74af4 to
5f77374
Compare
a677221 to
0c67054
Compare
f5fa440 to
278c671
Compare
580b993 to
c837e3f
Compare
260929d to
f06bf53
Compare
fb3f410 to
d8c745e
Compare
de6b829 to
73d7e58
Compare
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.
https://docs.openssl.org/1.0.2/man3/SSL_do_handshake/#return-values
standard return code of ssl_handshake list following:
0:
The TLS/SSL handshake was not successful but was shut down controlled and by the specifications of the TLS/SSL protocol. Call SSL_get_error() with the return value ret to find out the reason.
1:
The TLS/SSL handshake was successfully completed, a TLS/SSL connection has been established.
<0:
The TLS/SSL handshake was not successful because a fatal error occurred either at the protocol level or a connection failure occurred. The shutdown was not clean. It can also occur of action is need to continue the operation for non-blocking BIOs. Call SSL_get_error() with the return value ret to find out the reason.
so ssl_error_read/write should return -1.
Also mapping ssl->err from mbedtls error to openssl error, not return mbedtls error directly.