Create verify_peer_options when creating ssl credentials to support a peer verification callback#15274
Conversation
|
|
|
include/grpc/grpc_security.h
Outdated
There was a problem hiding this comment.
Please give proper comments about this struct. Instead of int (*verify_peer_callback)(const char*, const char*, void*), use e.g.,
int (*verify_peer_callback)(const char* target_name, const char* peer_pem, void* userdata)
and explain each parameter and return value.
Also I assume this callback is blocking, right?
There was a problem hiding this comment.
Yes, the callback is blocking. I added that clarification (along with a bunch of other detail) to comments.
include/grpc/grpc_security.h
Outdated
There was a problem hiding this comment.
You probably can make const verify_peer_options* verify_options
There was a problem hiding this comment.
Also add a comment about this new parameter.
include/grpc/grpc_security.h
Outdated
There was a problem hiding this comment.
Leftover from a prior iteration of this changeset. Removed.
There was a problem hiding this comment.
add const to verify_peer_options*
There was a problem hiding this comment.
In the case verify_options is nullptr, config->verify_options is uninitialized, it is safer to set memset config->verify_options to nullptr.
There was a problem hiding this comment.
You need to run clang-format.
tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh
There was a problem hiding this comment.
You probably want to also include callback_status code in the error.
There was a problem hiding this comment.
nit: you need to format this line.
There was a problem hiding this comment.
use static_cast<char*>gpr_malloc(p->value.length + 1)
|
Thanks much @JackOfMostTrades for contribution, a few comments first. |
|
Thanks for the feedback @jiangtaoli2016 ! I've done a first pass at cleanup based on your comments. |
863ea4b to
fe8b465
Compare
jiangtaoli2016
left a comment
There was a problem hiding this comment.
Thanks much for revision. This looks much better. LGTM
|
@markdroth Please take a look when you have time. |
|
|
|
Please add a test for this new API. Reviewed 15 of 22 files at r1, 7 of 7 files at r2. Comments from Reviewable |
|
|
@markdroth I've added a new test |
|
Thanks. The test looks pretty good. I have just a couple of minor comments. Reviewed 8 of 8 files at r3. build.yaml, line 2756 at r3 (raw file):
Please also add this target to test/core/handshake/verify_peer_options.cc, line 203 at r3 (raw file):
Can use test/core/handshake/verify_peer_options.cc, line 208 at r3 (raw file):
Same here. Comments from Reviewable |
|
Good feedback, thanks. Added a commit with the cleanup. |
|
This looks great! Please squash your commits, and then we can run the tests and make sure everything is happy. Reviewed 2 of 2 files at r4. Comments from Reviewable |
35bf47f to
c219ef9
Compare
|
Cool, commits squashed and pushed. |
|
|
|
9dea026 to
75a36de
Compare
|
The new test looks like it's behaving now, so I've rebased, resolved conflicts, and squashed. |
|
It looks like your commit is accidentally changing the subproject commit for boringssl and boringssl-with-bazel. Can you please fix that? |
|
|
|
…expose a verification callback option. These options are not yet exposed to languages outside of core.
75a36de to
68eff58
Compare
Oops, fixed that. |
|
|
|
|
This looks to me, but I'll let @jiangtaoli2016 give final approval. |
|
Looks good to me. Thanks @JackOfMostTrades for contribution. |
|
@markdroth Could you merge? |
This PR is split from #12656 to include just the updates to core components.