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
security: Refactor some utility functions in TSI for better internal use #29728
Conversation
…r_protect_flush`, and `ssl_protector_unprotect` to utility functions for internal use.
@@ -1053,6 +1053,272 @@ void ssl_tsi_test_do_handshake_with_custom_bio_pair() { | |||
tsi_test_fixture_destroy(fixture); | |||
} | |||
|
|||
absl::Status void do_handshake_helper(SSL** out_client, SSL** out_server) { |
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 function used anywhere?
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.
This is only used in ssl_transport_security_util_test.cc
.
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.
Thank you for making the changes, and apologize for the delay(sorry, really too many things on my plate now).
It looks good overall, except some minor items. I've made some comments on the test structure. Once that's solved, I can enable the tests for you :)
std::size_t server_buffer_offset; | ||
}; | ||
|
||
TEST_P(FlowTest, TestWorkFlows) { |
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.
The names could be more specific here...what kind of flow are we testing? Roughly how do we execute our tests? You can put some comments above to make it more clear...
/*writebuf2=*/0), | ||
1); | ||
SSL_set_bio(server_ssl, server_ssl_bio, server_ssl_bio); | ||
|
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.
one small nit: can we please remove all the unnecessary blank spaces in this PR? If you intend the blank space to be a "logical breakpoint", you can add a comment explaining what the next block will do. Otherwise I think it's safe to just remove these blank spaces, and same thing for all the other files.
@markdroth Hi Mark, would you mind taking a second look at the style&semantics of this change? Thank you so much! |
They should be fixed now. |
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.
@zeromath Thank you so much for the great work! The failing test seems irrelevant.
Merging the pull request now...
Factor out the function body of
ssl_protector_protect
,ssl_protector_protect_flush
, andssl_protector_unprotect
to utility functions for internal use.@ZhenLian