-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add mbedtls_ssl_is_handshake_over() #5653
Conversation
2566728
to
ebfbcd7
Compare
Add function to query if SSL handshake is over or not, in order to determine when to stop calling mbedtls_ssl_handshake_step among other things. Document function, and add warnings that the previous method of ascertaining if handshake was over is now deprecated, and may break in future releases. Signed-off-by: Paul Elliott <[email protected]>
ebfbcd7
to
1a42822
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. Didn't find more occurrences of conditions including MBEDTLS_SSL_HANDSHAKE_OVER
that could be handled by mbedtls_ssl_is_handshake_over()
.
Only found potential style issue. Please check review comment for details.
Switch over to using the new function both internally and in tests. Signed-off-by: Paul Elliott <[email protected]>
1a42822
to
27b0d94
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
OpenCI seems stuck on resources, but the internal CI fully passed, which is enough. |
* | ||
* \param ssl SSL context | ||
* | ||
* \return \c 1 if handshake is over, \c 0 if it is still ongoing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this only the initial handshake, or also renegotiations? Can this function return 0 during a renegotiation?
I have noticed that unlike mbedtls_ssl_conf_sni, mbedtls_ssl_conf_cert_cb doesn't allow passing an opaque pointer to the callback. This is very inconvenient when the ssl context is contained in a struct that is needed in the callback. Is it still possible to align the cert callback to accept an opaque pointer, like the sni callback? Edit: I filed a new issue #5910 |
Description
Add an accessor function so that the user can tell at what point the SSL handshake is over, and thus at what point they should stop calling mbedtls_ssl_handshake_step().
Change over all internal and test checks to use this function.
Status
READY
Requires Backporting
NO
Migrations
NO
Todos
Steps to test or reproduce
test_suite_ssl and ssl_opt.sh should both run clean.