aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/security
diff options
context:
space:
mode:
authorGravatar Noah Eisen <ncteisen@google.com>2018-02-09 09:34:04 -0800
committerGravatar Noah Eisen <ncteisen@google.com>2018-02-09 09:34:04 -0800
commit4d20a666850b732cf1562487fb5f46ab9654105f (patch)
tree9059162d0f125e02780f506c2476d5d9bbc0eb7d /src/core/lib/security
parentcddf6f838aa48c8d5c9f75cee5a8ed8abdcb25b9 (diff)
Run clang fmt
Diffstat (limited to 'src/core/lib/security')
-rw-r--r--src/core/lib/security/context/security_context.cc24
-rw-r--r--src/core/lib/security/credentials/composite/composite_credentials.cc17
-rw-r--r--src/core/lib/security/credentials/credentials.cc7
-rw-r--r--src/core/lib/security/credentials/credentials_metadata.cc4
-rw-r--r--src/core/lib/security/credentials/fake/fake_credentials.cc19
-rw-r--r--src/core/lib/security/credentials/google_default/google_default_credentials.cc9
-rw-r--r--src/core/lib/security/credentials/iam/iam_credentials.cc6
-rw-r--r--src/core/lib/security/credentials/jwt/json_token.cc3
-rw-r--r--src/core/lib/security/credentials/jwt/jwt_credentials.cc4
-rw-r--r--src/core/lib/security/credentials/jwt/jwt_verifier.cc22
-rw-r--r--src/core/lib/security/credentials/oauth2/oauth2_credentials.cc29
-rw-r--r--src/core/lib/security/credentials/plugin/plugin_credentials.cc16
-rw-r--r--src/core/lib/security/credentials/ssl/ssl_credentials.cc39
-rw-r--r--src/core/lib/security/transport/client_auth_filter.cc20
-rw-r--r--src/core/lib/security/transport/lb_targets_info.cc8
-rw-r--r--src/core/lib/security/transport/secure_endpoint.cc10
-rw-r--r--src/core/lib/security/transport/security_connector.cc37
-rw-r--r--src/core/lib/security/transport/security_handshaker.cc19
18 files changed, 165 insertions, 128 deletions
diff --git a/src/core/lib/security/context/security_context.cc b/src/core/lib/security/context/security_context.cc
index cd8fabea28..c7e212bb21 100644
--- a/src/core/lib/security/context/security_context.cc
+++ b/src/core/lib/security/context/security_context.cc
@@ -44,8 +44,8 @@ grpc_call_error grpc_call_set_credentials(grpc_call* call,
gpr_log(GPR_ERROR, "Method is client-side only.");
return GRPC_CALL_ERROR_NOT_ON_SERVER;
}
- ctx = static_cast<grpc_client_security_context*>(grpc_call_context_get(
- call, GRPC_CONTEXT_SECURITY));
+ ctx = static_cast<grpc_client_security_context*>(
+ grpc_call_context_get(call, GRPC_CONTEXT_SECURITY));
if (ctx == nullptr) {
ctx = grpc_client_security_context_create();
ctx->creds = grpc_call_credentials_ref(creds);
@@ -80,13 +80,14 @@ void grpc_auth_context_release(grpc_auth_context* context) {
/* --- grpc_client_security_context --- */
grpc_client_security_context* grpc_client_security_context_create(void) {
- return static_cast<grpc_client_security_context*>(gpr_zalloc(
- sizeof(grpc_client_security_context)));
+ return static_cast<grpc_client_security_context*>(
+ gpr_zalloc(sizeof(grpc_client_security_context)));
}
void grpc_client_security_context_destroy(void* ctx) {
grpc_core::ExecCtx exec_ctx;
- grpc_client_security_context* c = static_cast<grpc_client_security_context*>(ctx);
+ grpc_client_security_context* c =
+ static_cast<grpc_client_security_context*>(ctx);
grpc_call_credentials_unref(c->creds);
GRPC_AUTH_CONTEXT_UNREF(c->auth_context, "client_security_context");
if (c->extension.instance != nullptr && c->extension.destroy != nullptr) {
@@ -98,12 +99,13 @@ void grpc_client_security_context_destroy(void* ctx) {
/* --- grpc_server_security_context --- */
grpc_server_security_context* grpc_server_security_context_create(void) {
- return static_cast<grpc_server_security_context*>(gpr_zalloc(
- sizeof(grpc_server_security_context)));
+ return static_cast<grpc_server_security_context*>(
+ gpr_zalloc(sizeof(grpc_server_security_context)));
}
void grpc_server_security_context_destroy(void* ctx) {
- grpc_server_security_context* c = static_cast<grpc_server_security_context*>(ctx);
+ grpc_server_security_context* c =
+ static_cast<grpc_server_security_context*>(ctx);
GRPC_AUTH_CONTEXT_UNREF(c->auth_context, "server_security_context");
if (c->extension.instance != nullptr && c->extension.destroy != nullptr) {
c->extension.destroy(c->extension.instance);
@@ -258,9 +260,9 @@ static void ensure_auth_context_capacity(grpc_auth_context* ctx) {
if (ctx->properties.count == ctx->properties.capacity) {
ctx->properties.capacity =
GPR_MAX(ctx->properties.capacity + 8, ctx->properties.capacity * 2);
- ctx->properties.array = static_cast<grpc_auth_property*>(gpr_realloc(
- ctx->properties.array,
- ctx->properties.capacity * sizeof(grpc_auth_property)));
+ ctx->properties.array = static_cast<grpc_auth_property*>(
+ gpr_realloc(ctx->properties.array,
+ ctx->properties.capacity * sizeof(grpc_auth_property)));
}
}
diff --git a/src/core/lib/security/credentials/composite/composite_credentials.cc b/src/core/lib/security/credentials/composite/composite_credentials.cc
index 248177a178..ea2c4e208f 100644
--- a/src/core/lib/security/credentials/composite/composite_credentials.cc
+++ b/src/core/lib/security/credentials/composite/composite_credentials.cc
@@ -40,7 +40,8 @@ typedef struct {
} grpc_composite_call_credentials_metadata_context;
static void composite_call_destruct(grpc_call_credentials* creds) {
- grpc_composite_call_credentials* c = reinterpret_cast<grpc_composite_call_credentials*>(creds);
+ grpc_composite_call_credentials* c =
+ reinterpret_cast<grpc_composite_call_credentials*>(creds);
for (size_t i = 0; i < c->inner.num_creds; i++) {
grpc_call_credentials_unref(c->inner.creds_array[i]);
}
@@ -75,10 +76,11 @@ static bool composite_call_get_request_metadata(
grpc_auth_metadata_context auth_md_context,
grpc_credentials_mdelem_array* md_array, grpc_closure* on_request_metadata,
grpc_error** error) {
- grpc_composite_call_credentials* c = reinterpret_cast<grpc_composite_call_credentials*>(creds);
+ grpc_composite_call_credentials* c =
+ reinterpret_cast<grpc_composite_call_credentials*>(creds);
grpc_composite_call_credentials_metadata_context* ctx;
- ctx = static_cast<grpc_composite_call_credentials_metadata_context*>(gpr_zalloc(
- sizeof(grpc_composite_call_credentials_metadata_context)));
+ ctx = static_cast<grpc_composite_call_credentials_metadata_context*>(
+ gpr_zalloc(sizeof(grpc_composite_call_credentials_metadata_context)));
ctx->composite_creds = c;
ctx->pollent = pollent;
ctx->auth_md_context = auth_md_context;
@@ -106,7 +108,8 @@ static bool composite_call_get_request_metadata(
static void composite_call_cancel_get_request_metadata(
grpc_call_credentials* creds, grpc_credentials_mdelem_array* md_array,
grpc_error* error) {
- grpc_composite_call_credentials* c = reinterpret_cast<grpc_composite_call_credentials*>(creds);
+ grpc_composite_call_credentials* c =
+ reinterpret_cast<grpc_composite_call_credentials*>(creds);
for (size_t i = 0; i < c->inner.num_creds; ++i) {
grpc_call_credentials_cancel_get_request_metadata(
c->inner.creds_array[i], md_array, GRPC_ERROR_REF(error));
@@ -145,8 +148,8 @@ grpc_call_credentials* grpc_composite_call_credentials_create(
GPR_ASSERT(reserved == nullptr);
GPR_ASSERT(creds1 != nullptr);
GPR_ASSERT(creds2 != nullptr);
- c = static_cast<grpc_composite_call_credentials*>(gpr_zalloc(
- sizeof(grpc_composite_call_credentials)));
+ c = static_cast<grpc_composite_call_credentials*>(
+ gpr_zalloc(sizeof(grpc_composite_call_credentials)));
c->base.type = GRPC_CALL_CREDENTIALS_TYPE_COMPOSITE;
c->base.vtable = &composite_call_credentials_vtable;
gpr_ref_init(&c->base.refcount, 1);
diff --git a/src/core/lib/security/credentials/credentials.cc b/src/core/lib/security/credentials/credentials.cc
index c1ca881292..17f7de58be 100644
--- a/src/core/lib/security/credentials/credentials.cc
+++ b/src/core/lib/security/credentials/credentials.cc
@@ -40,8 +40,8 @@
grpc_credentials_metadata_request* grpc_credentials_metadata_request_create(
grpc_call_credentials* creds) {
grpc_credentials_metadata_request* r =
- static_cast<grpc_credentials_metadata_request*>(gpr_zalloc(
- sizeof(grpc_credentials_metadata_request)));
+ static_cast<grpc_credentials_metadata_request*>(
+ gpr_zalloc(sizeof(grpc_credentials_metadata_request)));
r->creds = grpc_call_credentials_ref(creds);
return r;
}
@@ -149,7 +149,8 @@ static void credentials_pointer_arg_destroy(void* p) {
}
static void* credentials_pointer_arg_copy(void* p) {
- return grpc_channel_credentials_ref(static_cast<grpc_channel_credentials*>(p));
+ return grpc_channel_credentials_ref(
+ static_cast<grpc_channel_credentials*>(p));
}
static int credentials_pointer_cmp(void* a, void* b) { return GPR_ICMP(a, b); }
diff --git a/src/core/lib/security/credentials/credentials_metadata.cc b/src/core/lib/security/credentials/credentials_metadata.cc
index 76e856f48e..250e384155 100644
--- a/src/core/lib/security/credentials/credentials_metadata.cc
+++ b/src/core/lib/security/credentials/credentials_metadata.cc
@@ -33,8 +33,8 @@ static void mdelem_list_ensure_capacity(grpc_credentials_mdelem_array* list,
while (new_size < target_size) {
new_size *= 2;
}
- list->md =
- static_cast<grpc_mdelem*>(gpr_realloc(list->md, sizeof(grpc_mdelem) * new_size));
+ list->md = static_cast<grpc_mdelem*>(
+ gpr_realloc(list->md, sizeof(grpc_mdelem) * new_size));
}
void grpc_credentials_mdelem_array_add(grpc_credentials_mdelem_array* list,
diff --git a/src/core/lib/security/credentials/fake/fake_credentials.cc b/src/core/lib/security/credentials/fake/fake_credentials.cc
index b4f0dfdbdc..3b29db2efa 100644
--- a/src/core/lib/security/credentials/fake/fake_credentials.cc
+++ b/src/core/lib/security/credentials/fake/fake_credentials.cc
@@ -59,8 +59,8 @@ static grpc_server_credentials_vtable
grpc_channel_credentials* grpc_fake_transport_security_credentials_create(
void) {
- grpc_channel_credentials* c =
- static_cast<grpc_channel_credentials*>(gpr_zalloc(sizeof(grpc_channel_credentials)));
+ grpc_channel_credentials* c = static_cast<grpc_channel_credentials*>(
+ gpr_zalloc(sizeof(grpc_channel_credentials)));
c->type = GRPC_CHANNEL_CREDENTIALS_TYPE_FAKE_TRANSPORT_SECURITY;
c->vtable = &fake_transport_security_credentials_vtable;
gpr_ref_init(&c->refcount, 1);
@@ -69,8 +69,8 @@ grpc_channel_credentials* grpc_fake_transport_security_credentials_create(
grpc_server_credentials* grpc_fake_transport_security_server_credentials_create(
void) {
- grpc_server_credentials* c =
- static_cast<grpc_server_credentials*>(gpr_malloc(sizeof(grpc_server_credentials)));
+ grpc_server_credentials* c = static_cast<grpc_server_credentials*>(
+ gpr_malloc(sizeof(grpc_server_credentials)));
memset(c, 0, sizeof(grpc_server_credentials));
c->type = GRPC_CHANNEL_CREDENTIALS_TYPE_FAKE_TRANSPORT_SECURITY;
gpr_ref_init(&c->refcount, 1);
@@ -97,7 +97,8 @@ const char* grpc_fake_transport_get_expected_targets(
/* -- Metadata-only test credentials. -- */
static void md_only_test_destruct(grpc_call_credentials* creds) {
- grpc_md_only_test_credentials* c = reinterpret_cast<grpc_md_only_test_credentials*>(creds);
+ grpc_md_only_test_credentials* c =
+ reinterpret_cast<grpc_md_only_test_credentials*>(creds);
GRPC_MDELEM_UNREF(c->md);
}
@@ -105,7 +106,8 @@ static bool md_only_test_get_request_metadata(
grpc_call_credentials* creds, grpc_polling_entity* pollent,
grpc_auth_metadata_context context, grpc_credentials_mdelem_array* md_array,
grpc_closure* on_request_metadata, grpc_error** error) {
- grpc_md_only_test_credentials* c = reinterpret_cast<grpc_md_only_test_credentials*>(creds);
+ grpc_md_only_test_credentials* c =
+ reinterpret_cast<grpc_md_only_test_credentials*>(creds);
grpc_credentials_mdelem_array_add(md_array, c->md);
if (c->is_async) {
GRPC_CLOSURE_SCHED(on_request_metadata, GRPC_ERROR_NONE);
@@ -126,8 +128,9 @@ static grpc_call_credentials_vtable md_only_test_vtable = {
grpc_call_credentials* grpc_md_only_test_credentials_create(
const char* md_key, const char* md_value, bool is_async) {
- grpc_md_only_test_credentials* c = static_cast<grpc_md_only_test_credentials*>(gpr_zalloc(
- sizeof(grpc_md_only_test_credentials)));
+ grpc_md_only_test_credentials* c =
+ static_cast<grpc_md_only_test_credentials*>(
+ gpr_zalloc(sizeof(grpc_md_only_test_credentials)));
c->base.type = GRPC_CALL_CREDENTIALS_TYPE_OAUTH2;
c->base.vtable = &md_only_test_vtable;
gpr_ref_init(&c->base.refcount, 1);
diff --git a/src/core/lib/security/credentials/google_default/google_default_credentials.cc b/src/core/lib/security/credentials/google_default/google_default_credentials.cc
index dd7d52d750..65455f94b3 100644
--- a/src/core/lib/security/credentials/google_default/google_default_credentials.cc
+++ b/src/core/lib/security/credentials/google_default/google_default_credentials.cc
@@ -60,7 +60,8 @@ typedef struct {
static void on_compute_engine_detection_http_response(void* user_data,
grpc_error* error) {
- compute_engine_detector* detector = static_cast<compute_engine_detector*>(user_data);
+ compute_engine_detector* detector =
+ static_cast<compute_engine_detector*>(user_data);
if (error == GRPC_ERROR_NONE && detector->response.status == 200 &&
detector->response.hdr_count > 0) {
/* Internet providers can return a generic response to all requests, so
@@ -98,7 +99,8 @@ static int is_stack_running_on_compute_engine() {
on compute engine. */
grpc_millis max_detection_delay = GPR_MS_PER_SEC;
- grpc_pollset* pollset = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
+ grpc_pollset* pollset =
+ static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
grpc_pollset_init(pollset, &g_polling_mu);
detector.pollent = grpc_polling_entity_create_from_pollset(pollset);
detector.is_done = 0;
@@ -171,7 +173,8 @@ static grpc_error* create_default_creds_from_path(
goto end;
}
json = grpc_json_parse_string_with_len(
- reinterpret_cast<char*>GRPC_SLICE_START_PTR(creds_data), GRPC_SLICE_LENGTH(creds_data));
+ reinterpret_cast<char*> GRPC_SLICE_START_PTR(creds_data),
+ GRPC_SLICE_LENGTH(creds_data));
if (json == nullptr) {
error = grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed to parse JSON"),
diff --git a/src/core/lib/security/credentials/iam/iam_credentials.cc b/src/core/lib/security/credentials/iam/iam_credentials.cc
index 20f4ff95f5..7f19fbc785 100644
--- a/src/core/lib/security/credentials/iam/iam_credentials.cc
+++ b/src/core/lib/security/credentials/iam/iam_credentials.cc
@@ -28,7 +28,8 @@
#include <grpc/support/sync.h>
static void iam_destruct(grpc_call_credentials* creds) {
- grpc_google_iam_credentials* c = reinterpret_cast<grpc_google_iam_credentials*>(creds);
+ grpc_google_iam_credentials* c =
+ reinterpret_cast<grpc_google_iam_credentials*>(creds);
grpc_credentials_mdelem_array_destroy(&c->md_array);
}
@@ -38,7 +39,8 @@ static bool iam_get_request_metadata(grpc_call_credentials* creds,
grpc_credentials_mdelem_array* md_array,
grpc_closure* on_request_metadata,
grpc_error** error) {
- grpc_google_iam_credentials* c = reinterpret_cast<grpc_google_iam_credentials*>(creds);
+ grpc_google_iam_credentials* c =
+ reinterpret_cast<grpc_google_iam_credentials*>(creds);
grpc_credentials_mdelem_array_append(md_array, &c->md_array);
return true;
}
diff --git a/src/core/lib/security/credentials/jwt/json_token.cc b/src/core/lib/security/credentials/jwt/json_token.cc
index eae1be17fd..f7c9f57808 100644
--- a/src/core/lib/security/credentials/jwt/json_token.cc
+++ b/src/core/lib/security/credentials/jwt/json_token.cc
@@ -219,7 +219,8 @@ static char* dot_concat_and_free_strings(char* str1, char* str2) {
size_t str1_len = strlen(str1);
size_t str2_len = strlen(str2);
size_t result_len = str1_len + 1 /* dot */ + str2_len;
- char* result = static_cast<char*>(gpr_malloc(result_len + 1 /* NULL terminated */));
+ char* result =
+ static_cast<char*>(gpr_malloc(result_len + 1 /* NULL terminated */));
char* current = result;
memcpy(current, str1, str1_len);
current += str1_len;
diff --git a/src/core/lib/security/credentials/jwt/jwt_credentials.cc b/src/core/lib/security/credentials/jwt/jwt_credentials.cc
index 44101acd78..05c08a68b0 100644
--- a/src/core/lib/security/credentials/jwt/jwt_credentials.cc
+++ b/src/core/lib/security/credentials/jwt/jwt_credentials.cc
@@ -123,8 +123,8 @@ grpc_service_account_jwt_access_credentials_create_from_auth_json_key(
gpr_log(GPR_ERROR, "Invalid input for jwt credentials creation");
return nullptr;
}
- c = static_cast<grpc_service_account_jwt_access_credentials*>(gpr_zalloc(
- sizeof(grpc_service_account_jwt_access_credentials)));
+ c = static_cast<grpc_service_account_jwt_access_credentials*>(
+ gpr_zalloc(sizeof(grpc_service_account_jwt_access_credentials)));
c->base.type = GRPC_CALL_CREDENTIALS_TYPE_JWT;
gpr_ref_init(&c->base.refcount, 1);
c->base.vtable = &jwt_vtable;
diff --git a/src/core/lib/security/credentials/jwt/jwt_verifier.cc b/src/core/lib/security/credentials/jwt/jwt_verifier.cc
index 3d7541f4c9..f5c1ada6ca 100644
--- a/src/core/lib/security/credentials/jwt/jwt_verifier.cc
+++ b/src/core/lib/security/credentials/jwt/jwt_verifier.cc
@@ -82,8 +82,9 @@ static grpc_json* parse_json_part_from_jwt(const char* str, size_t len,
gpr_log(GPR_ERROR, "Invalid base64.");
return nullptr;
}
- json = grpc_json_parse_string_with_len(reinterpret_cast<char*>GRPC_SLICE_START_PTR(*buffer),
- GRPC_SLICE_LENGTH(*buffer));
+ json = grpc_json_parse_string_with_len(
+ reinterpret_cast<char*> GRPC_SLICE_START_PTR(*buffer),
+ GRPC_SLICE_LENGTH(*buffer));
if (json == nullptr) {
grpc_slice_unref_internal(*buffer);
gpr_log(GPR_ERROR, "JSON parsing error.");
@@ -347,7 +348,8 @@ static verifier_cb_ctx* verifier_cb_ctx_create(
const char* signed_jwt, size_t signed_jwt_len, void* user_data,
grpc_jwt_verification_done_cb cb) {
grpc_core::ExecCtx exec_ctx;
- verifier_cb_ctx* ctx = static_cast<verifier_cb_ctx*>(gpr_zalloc(sizeof(verifier_cb_ctx)));
+ verifier_cb_ctx* ctx =
+ static_cast<verifier_cb_ctx*>(gpr_zalloc(sizeof(verifier_cb_ctx)));
ctx->verifier = verifier;
ctx->pollent = grpc_polling_entity_create_from_pollset(pollset);
ctx->header = header;
@@ -754,8 +756,8 @@ const char* grpc_jwt_issuer_email_domain(const char* issuer) {
if (dot == nullptr || dot == email_domain) return email_domain;
GPR_ASSERT(dot > email_domain);
/* There may be a subdomain, we just want the domain. */
- dot = static_cast<const char*>(gpr_memrchr((void*)email_domain, '.',
- static_cast<size_t>(dot - email_domain)));
+ dot = static_cast<const char*>(gpr_memrchr(
+ (void*)email_domain, '.', static_cast<size_t>(dot - email_domain)));
if (dot == nullptr) return email_domain;
return dot + 1;
}
@@ -861,7 +863,8 @@ void grpc_jwt_verifier_verify(grpc_jwt_verifier* verifier,
cb != nullptr);
dot = strchr(cur, '.');
if (dot == nullptr) goto error;
- json = parse_json_part_from_jwt(cur, static_cast<size_t>(dot - cur), &header_buffer);
+ json = parse_json_part_from_jwt(cur, static_cast<size_t>(dot - cur),
+ &header_buffer);
if (json == nullptr) goto error;
header = jose_header_from_json(json, header_buffer);
if (header == nullptr) goto error;
@@ -869,7 +872,8 @@ void grpc_jwt_verifier_verify(grpc_jwt_verifier* verifier,
cur = dot + 1;
dot = strchr(cur, '.');
if (dot == nullptr) goto error;
- json = parse_json_part_from_jwt(cur, static_cast<size_t>(dot - cur), &claims_buffer);
+ json = parse_json_part_from_jwt(cur, static_cast<size_t>(dot - cur),
+ &claims_buffer);
if (json == nullptr) goto error;
claims = grpc_jwt_claims_from_json(json, claims_buffer);
if (claims == nullptr) goto error;
@@ -898,8 +902,8 @@ grpc_jwt_verifier* grpc_jwt_verifier_create(
/* We know at least of one mapping. */
v->allocated_mappings = 1 + num_mappings;
- v->mappings = static_cast<email_key_mapping*>(gpr_malloc(v->allocated_mappings *
- sizeof(email_key_mapping)));
+ v->mappings = static_cast<email_key_mapping*>(
+ gpr_malloc(v->allocated_mappings * sizeof(email_key_mapping)));
verifier_put_mapping(v, GRPC_GOOGLE_SERVICE_ACCOUNTS_EMAIL_DOMAIN,
GRPC_GOOGLE_SERVICE_ACCOUNTS_KEY_URL_PREFIX);
/* User-Provided mappings. */
diff --git a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
index b4fb9a43e7..afae7d8f2f 100644
--- a/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
+++ b/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
@@ -128,7 +128,8 @@ grpc_oauth2_token_fetcher_credentials_parse_server_response(
}
if (response->body_length > 0) {
- null_terminated_body = static_cast<char*>(gpr_malloc(response->body_length + 1));
+ null_terminated_body =
+ static_cast<char*>(gpr_malloc(response->body_length + 1));
null_terminated_body[response->body_length] = '\0';
memcpy(null_terminated_body, response->body, response->body_length);
}
@@ -269,8 +270,8 @@ static bool oauth2_token_fetcher_get_request_metadata(
// Couldn't get the token from the cache.
// Add request to c->pending_requests and start a new fetch if needed.
grpc_oauth2_pending_get_request_metadata* pending_request =
- static_cast<grpc_oauth2_pending_get_request_metadata*>(gpr_malloc(
- sizeof(*pending_request)));
+ static_cast<grpc_oauth2_pending_get_request_metadata*>(
+ gpr_malloc(sizeof(*pending_request)));
pending_request->md_array = md_array;
pending_request->on_request_metadata = on_request_metadata;
pending_request->pollent = pollent;
@@ -371,8 +372,8 @@ static void compute_engine_fetch_oauth2(
grpc_call_credentials* grpc_google_compute_engine_credentials_create(
void* reserved) {
grpc_oauth2_token_fetcher_credentials* c =
- static_cast<grpc_oauth2_token_fetcher_credentials*>(gpr_malloc(
- sizeof(grpc_oauth2_token_fetcher_credentials)));
+ static_cast<grpc_oauth2_token_fetcher_credentials*>(
+ gpr_malloc(sizeof(grpc_oauth2_token_fetcher_credentials)));
GRPC_API_TRACE("grpc_compute_engine_credentials_create(reserved=%p)", 1,
(reserved));
GPR_ASSERT(reserved == nullptr);
@@ -401,7 +402,8 @@ static void refresh_token_fetch_oauth2(
grpc_httpcli_context* httpcli_context, grpc_polling_entity* pollent,
grpc_iomgr_cb_func response_cb, grpc_millis deadline) {
grpc_google_refresh_token_credentials* c =
- reinterpret_cast<grpc_google_refresh_token_credentials*>(metadata_req->creds);
+ reinterpret_cast<grpc_google_refresh_token_credentials*>(
+ metadata_req->creds);
grpc_http_header header = {(char*)"Content-Type",
(char*)"application/x-www-form-urlencoded"};
grpc_httpcli_request request;
@@ -437,8 +439,8 @@ grpc_refresh_token_credentials_create_from_auth_refresh_token(
gpr_log(GPR_ERROR, "Invalid input for refresh token credentials creation");
return nullptr;
}
- c = static_cast<grpc_google_refresh_token_credentials*>(gpr_zalloc(
- sizeof(grpc_google_refresh_token_credentials)));
+ c = static_cast<grpc_google_refresh_token_credentials*>(
+ gpr_zalloc(sizeof(grpc_google_refresh_token_credentials)));
init_oauth2_token_fetcher(&c->base, refresh_token_fetch_oauth2);
c->base.base.vtable = &refresh_token_vtable;
c->refresh_token = refresh_token;
@@ -478,7 +480,8 @@ grpc_call_credentials* grpc_google_refresh_token_credentials_create(
//
static void access_token_destruct(grpc_call_credentials* creds) {
- grpc_access_token_credentials* c = reinterpret_cast<grpc_access_token_credentials*>(creds);
+ grpc_access_token_credentials* c =
+ reinterpret_cast<grpc_access_token_credentials*>(creds);
GRPC_MDELEM_UNREF(c->access_token_md);
}
@@ -486,7 +489,8 @@ static bool access_token_get_request_metadata(
grpc_call_credentials* creds, grpc_polling_entity* pollent,
grpc_auth_metadata_context context, grpc_credentials_mdelem_array* md_array,
grpc_closure* on_request_metadata, grpc_error** error) {
- grpc_access_token_credentials* c = reinterpret_cast<grpc_access_token_credentials*>(creds);
+ grpc_access_token_credentials* c =
+ reinterpret_cast<grpc_access_token_credentials*>(creds);
grpc_credentials_mdelem_array_add(md_array, c->access_token_md);
return true;
}
@@ -503,8 +507,9 @@ static grpc_call_credentials_vtable access_token_vtable = {
grpc_call_credentials* grpc_access_token_credentials_create(
const char* access_token, void* reserved) {
- grpc_access_token_credentials* c = static_cast<grpc_access_token_credentials*>(gpr_zalloc(
- sizeof(grpc_access_token_credentials)));
+ grpc_access_token_credentials* c =
+ static_cast<grpc_access_token_credentials*>(
+ gpr_zalloc(sizeof(grpc_access_token_credentials)));
GRPC_API_TRACE(
"grpc_access_token_credentials_create(access_token=<redacted>, "
"reserved=%p)",
diff --git a/src/core/lib/security/credentials/plugin/plugin_credentials.cc b/src/core/lib/security/credentials/plugin/plugin_credentials.cc
index 89f94f9e6d..ddb86e153b 100644
--- a/src/core/lib/security/credentials/plugin/plugin_credentials.cc
+++ b/src/core/lib/security/credentials/plugin/plugin_credentials.cc
@@ -34,7 +34,8 @@
grpc_core::TraceFlag grpc_plugin_credentials_trace(false, "plugin_credentials");
static void plugin_destruct(grpc_call_credentials* creds) {
- grpc_plugin_credentials* c = reinterpret_cast<grpc_plugin_credentials*>(creds);
+ grpc_plugin_credentials* c =
+ reinterpret_cast<grpc_plugin_credentials*>(creds);
gpr_mu_destroy(&c->mu);
if (c->plugin.state != nullptr && c->plugin.destroy != nullptr) {
c->plugin.destroy(c->plugin.state);
@@ -147,13 +148,14 @@ static bool plugin_get_request_metadata(grpc_call_credentials* creds,
grpc_credentials_mdelem_array* md_array,
grpc_closure* on_request_metadata,
grpc_error** error) {
- grpc_plugin_credentials* c = reinterpret_cast<grpc_plugin_credentials*>(creds);
+ grpc_plugin_credentials* c =
+ reinterpret_cast<grpc_plugin_credentials*>(creds);
bool retval = true; // Synchronous return.
if (c->plugin.get_metadata != nullptr) {
// Create pending_request object.
grpc_plugin_credentials_pending_request* pending_request =
- static_cast<grpc_plugin_credentials_pending_request*>(gpr_zalloc(
- sizeof(*pending_request)));
+ static_cast<grpc_plugin_credentials_pending_request*>(
+ gpr_zalloc(sizeof(*pending_request)));
pending_request->creds = c;
pending_request->md_array = md_array;
pending_request->on_request_metadata = on_request_metadata;
@@ -225,7 +227,8 @@ static bool plugin_get_request_metadata(grpc_call_credentials* creds,
static void plugin_cancel_get_request_metadata(
grpc_call_credentials* creds, grpc_credentials_mdelem_array* md_array,
grpc_error* error) {
- grpc_plugin_credentials* c = reinterpret_cast<grpc_plugin_credentials*>(creds);
+ grpc_plugin_credentials* c =
+ reinterpret_cast<grpc_plugin_credentials*>(creds);
gpr_mu_lock(&c->mu);
for (grpc_plugin_credentials_pending_request* pending_request =
c->pending_requests;
@@ -252,7 +255,8 @@ static grpc_call_credentials_vtable plugin_vtable = {
grpc_call_credentials* grpc_metadata_credentials_create_from_plugin(
grpc_metadata_credentials_plugin plugin, void* reserved) {
- grpc_plugin_credentials* c = static_cast<grpc_plugin_credentials*>(gpr_zalloc(sizeof(*c)));
+ grpc_plugin_credentials* c =
+ static_cast<grpc_plugin_credentials*>(gpr_zalloc(sizeof(*c)));
GRPC_API_TRACE("grpc_metadata_credentials_create_from_plugin(reserved=%p)", 1,
(reserved));
GPR_ASSERT(reserved == nullptr);
diff --git a/src/core/lib/security/credentials/ssl/ssl_credentials.cc b/src/core/lib/security/credentials/ssl/ssl_credentials.cc
index 4237039274..a4fce25f3a 100644
--- a/src/core/lib/security/credentials/ssl/ssl_credentials.cc
+++ b/src/core/lib/security/credentials/ssl/ssl_credentials.cc
@@ -85,8 +85,8 @@ static void ssl_build_config(const char* pem_root_certs,
if (pem_key_cert_pair != nullptr) {
GPR_ASSERT(pem_key_cert_pair->private_key != nullptr);
GPR_ASSERT(pem_key_cert_pair->cert_chain != nullptr);
- config->pem_key_cert_pair = static_cast<tsi_ssl_pem_key_cert_pair*>(gpr_zalloc(
- sizeof(tsi_ssl_pem_key_cert_pair)));
+ config->pem_key_cert_pair = static_cast<tsi_ssl_pem_key_cert_pair*>(
+ gpr_zalloc(sizeof(tsi_ssl_pem_key_cert_pair)));
config->pem_key_cert_pair->cert_chain =
gpr_strdup(pem_key_cert_pair->cert_chain);
config->pem_key_cert_pair->private_key =
@@ -97,8 +97,8 @@ static void ssl_build_config(const char* pem_root_certs,
grpc_channel_credentials* grpc_ssl_credentials_create(
const char* pem_root_certs, grpc_ssl_pem_key_cert_pair* pem_key_cert_pair,
void* reserved) {
- grpc_ssl_credentials* c =
- static_cast<grpc_ssl_credentials*>(gpr_zalloc(sizeof(grpc_ssl_credentials)));
+ grpc_ssl_credentials* c = static_cast<grpc_ssl_credentials*>(
+ gpr_zalloc(sizeof(grpc_ssl_credentials)));
GRPC_API_TRACE(
"grpc_ssl_credentials_create(pem_root_certs=%s, "
"pem_key_cert_pair=%p, "
@@ -123,7 +123,8 @@ struct grpc_ssl_server_credentials_options {
};
static void ssl_server_destruct(grpc_server_credentials* creds) {
- grpc_ssl_server_credentials* c = reinterpret_cast<grpc_ssl_server_credentials*>(creds);
+ grpc_ssl_server_credentials* c =
+ reinterpret_cast<grpc_ssl_server_credentials*>(creds);
grpc_tsi_ssl_pem_key_cert_pairs_destroy(c->config.pem_key_cert_pairs,
c->config.num_key_cert_pairs);
gpr_free(c->config.pem_root_certs);
@@ -143,8 +144,8 @@ tsi_ssl_pem_key_cert_pair* grpc_convert_grpc_to_tsi_cert_pairs(
tsi_ssl_pem_key_cert_pair* tsi_pairs = nullptr;
if (num_key_cert_pairs > 0) {
GPR_ASSERT(pem_key_cert_pairs != nullptr);
- tsi_pairs = static_cast<tsi_ssl_pem_key_cert_pair*>(gpr_zalloc(
- num_key_cert_pairs * sizeof(tsi_ssl_pem_key_cert_pair)));
+ tsi_pairs = static_cast<tsi_ssl_pem_key_cert_pair*>(
+ gpr_zalloc(num_key_cert_pairs * sizeof(tsi_ssl_pem_key_cert_pair)));
}
for (size_t i = 0; i < num_key_cert_pairs; i++) {
GPR_ASSERT(pem_key_cert_pairs[i].private_key != nullptr);
@@ -174,15 +175,15 @@ grpc_ssl_server_certificate_config* grpc_ssl_server_certificate_config_create(
const grpc_ssl_pem_key_cert_pair* pem_key_cert_pairs,
size_t num_key_cert_pairs) {
grpc_ssl_server_certificate_config* config =
- static_cast<grpc_ssl_server_certificate_config*>(gpr_zalloc(
- sizeof(grpc_ssl_server_certificate_config)));
+ static_cast<grpc_ssl_server_certificate_config*>(
+ gpr_zalloc(sizeof(grpc_ssl_server_certificate_config)));
if (pem_root_certs != nullptr) {
config->pem_root_certs = gpr_strdup(pem_root_certs);
}
if (num_key_cert_pairs > 0) {
GPR_ASSERT(pem_key_cert_pairs != nullptr);
- config->pem_key_cert_pairs = static_cast<grpc_ssl_pem_key_cert_pair*>(gpr_zalloc(
- num_key_cert_pairs * sizeof(grpc_ssl_pem_key_cert_pair)));
+ config->pem_key_cert_pairs = static_cast<grpc_ssl_pem_key_cert_pair*>(
+ gpr_zalloc(num_key_cert_pairs * sizeof(grpc_ssl_pem_key_cert_pair)));
}
config->num_key_cert_pairs = num_key_cert_pairs;
for (size_t i = 0; i < num_key_cert_pairs; i++) {
@@ -217,8 +218,8 @@ grpc_ssl_server_credentials_create_options_using_config(
gpr_log(GPR_ERROR, "Certificate config must not be NULL.");
goto done;
}
- options = static_cast<grpc_ssl_server_credentials_options*>(gpr_zalloc(
- sizeof(grpc_ssl_server_credentials_options)));
+ options = static_cast<grpc_ssl_server_credentials_options*>(
+ gpr_zalloc(sizeof(grpc_ssl_server_credentials_options)));
options->client_certificate_request = client_certificate_request;
options->certificate_config = config;
done:
@@ -235,14 +236,14 @@ grpc_ssl_server_credentials_create_options_using_config_fetcher(
}
grpc_ssl_server_certificate_config_fetcher* fetcher =
- static_cast<grpc_ssl_server_certificate_config_fetcher*>(gpr_zalloc(
- sizeof(grpc_ssl_server_certificate_config_fetcher)));
+ static_cast<grpc_ssl_server_certificate_config_fetcher*>(
+ gpr_zalloc(sizeof(grpc_ssl_server_certificate_config_fetcher)));
fetcher->cb = cb;
fetcher->user_data = user_data;
grpc_ssl_server_credentials_options* options =
- static_cast<grpc_ssl_server_credentials_options*>(gpr_zalloc(
- sizeof(grpc_ssl_server_credentials_options)));
+ static_cast<grpc_ssl_server_credentials_options*>(
+ gpr_zalloc(sizeof(grpc_ssl_server_credentials_options)));
options->client_certificate_request = client_certificate_request;
options->certificate_config_fetcher = fetcher;
@@ -307,8 +308,8 @@ grpc_server_credentials* grpc_ssl_server_credentials_create_with_options(
goto done;
}
- c = static_cast<grpc_ssl_server_credentials*>(gpr_zalloc(
- sizeof(grpc_ssl_server_credentials)));
+ c = static_cast<grpc_ssl_server_credentials*>(
+ gpr_zalloc(sizeof(grpc_ssl_server_credentials)));
c->base.type = GRPC_CHANNEL_CREDENTIALS_TYPE_SSL;
gpr_ref_init(&c->base.refcount, 1);
c->base.vtable = &ssl_server_vtable;
diff --git a/src/core/lib/security/transport/client_auth_filter.cc b/src/core/lib/security/transport/client_auth_filter.cc
index b5171acc87..d2313807ff 100644
--- a/src/core/lib/security/transport/client_auth_filter.cc
+++ b/src/core/lib/security/transport/client_auth_filter.cc
@@ -93,7 +93,8 @@ static void add_error(grpc_error** combined, grpc_error* error) {
}
static void on_credentials_metadata(void* arg, grpc_error* input_error) {
- grpc_transport_stream_op_batch* batch = static_cast<grpc_transport_stream_op_batch*>(arg);
+ grpc_transport_stream_op_batch* batch =
+ static_cast<grpc_transport_stream_op_batch*>(arg);
grpc_call_element* elem =
static_cast<grpc_call_element*>(batch->handler_private.extra_arg);
call_data* calld = static_cast<call_data*>(elem->call_data);
@@ -173,9 +174,8 @@ static void send_security_metadata(grpc_call_element* elem,
call_data* calld = static_cast<call_data*>(elem->call_data);
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
grpc_client_security_context* ctx =
- static_cast<grpc_client_security_context*>(batch->payload
- ->context[GRPC_CONTEXT_SECURITY]
- .value);
+ static_cast<grpc_client_security_context*>(
+ batch->payload->context[GRPC_CONTEXT_SECURITY].value);
grpc_call_credentials* channel_call_creds =
chand->security_connector->request_metadata_creds;
int call_creds_has_md = (ctx != nullptr) && (ctx->creds != nullptr);
@@ -231,7 +231,8 @@ static void send_security_metadata(grpc_call_element* elem,
}
static void on_host_checked(void* arg, grpc_error* error) {
- grpc_transport_stream_op_batch* batch = static_cast<grpc_transport_stream_op_batch*>(arg);
+ grpc_transport_stream_op_batch* batch =
+ static_cast<grpc_transport_stream_op_batch*>(arg);
grpc_call_element* elem =
static_cast<grpc_call_element*>(batch->handler_private.extra_arg);
call_data* calld = static_cast<call_data*>(elem->call_data);
@@ -283,9 +284,8 @@ static void auth_start_transport_stream_op_batch(
grpc_client_security_context_destroy;
}
grpc_client_security_context* sec_ctx =
- static_cast<grpc_client_security_context*>(batch->payload
- ->context[GRPC_CONTEXT_SECURITY]
- .value);
+ static_cast<grpc_client_security_context*>(
+ batch->payload->context[GRPC_CONTEXT_SECURITY].value);
GRPC_AUTH_CONTEXT_UNREF(sec_ctx->auth_context, "client auth filter");
sec_ctx->auth_context =
GRPC_AUTH_CONTEXT_REF(chand->auth_context, "client_auth_filter");
@@ -400,8 +400,8 @@ static grpc_error* init_channel_elem(grpc_channel_element* elem,
/* initialize members */
chand->security_connector =
- reinterpret_cast<grpc_channel_security_connector*>(GRPC_SECURITY_CONNECTOR_REF(
- sc, "client_auth_filter"));
+ reinterpret_cast<grpc_channel_security_connector*>(
+ GRPC_SECURITY_CONNECTOR_REF(sc, "client_auth_filter"));
chand->auth_context =
GRPC_AUTH_CONTEXT_REF(auth_context, "client_auth_filter");
return GRPC_ERROR_NONE;
diff --git a/src/core/lib/security/transport/lb_targets_info.cc b/src/core/lib/security/transport/lb_targets_info.cc
index 84a72731c9..67a3c7449d 100644
--- a/src/core/lib/security/transport/lb_targets_info.cc
+++ b/src/core/lib/security/transport/lb_targets_info.cc
@@ -32,8 +32,9 @@ static void targets_info_destroy(void* p) {
grpc_slice_hash_table_unref(static_cast<grpc_slice_hash_table*>(p));
}
static int targets_info_cmp(void* a, void* b) {
- return grpc_slice_hash_table_cmp(static_cast<const grpc_slice_hash_table*>(a),
- static_cast<const grpc_slice_hash_table*>(b));
+ return grpc_slice_hash_table_cmp(
+ static_cast<const grpc_slice_hash_table*>(a),
+ static_cast<const grpc_slice_hash_table*>(b));
}
static const grpc_arg_pointer_vtable server_to_balancer_names_vtable = {
targets_info_copy, targets_info_destroy, targets_info_cmp};
@@ -51,7 +52,8 @@ grpc_slice_hash_table* grpc_lb_targets_info_find_in_args(
grpc_channel_args_find(args, GRPC_ARG_LB_SECURE_NAMING_MAP);
if (targets_info_arg != nullptr) {
GPR_ASSERT(targets_info_arg->type == GRPC_ARG_POINTER);
- return static_cast<grpc_slice_hash_table*>(targets_info_arg->value.pointer.p);
+ return static_cast<grpc_slice_hash_table*>(
+ targets_info_arg->value.pointer.p);
}
return nullptr;
}
diff --git a/src/core/lib/security/transport/secure_endpoint.cc b/src/core/lib/security/transport/secure_endpoint.cc
index a63dbc07c8..f72f8b6121 100644
--- a/src/core/lib/security/transport/secure_endpoint.cc
+++ b/src/core/lib/security/transport/secure_endpoint.cc
@@ -205,7 +205,8 @@ static void on_read(void* user_data, grpc_error* error) {
ep->read_buffer,
grpc_slice_split_head(
&ep->read_staging_buffer,
- static_cast<size_t>(cur - GRPC_SLICE_START_PTR(ep->read_staging_buffer))));
+ static_cast<size_t>(
+ cur - GRPC_SLICE_START_PTR(ep->read_staging_buffer))));
}
}
@@ -324,8 +325,8 @@ static void endpoint_write(grpc_endpoint* secure_ep, grpc_slice_buffer* slices,
&ep->output_buffer,
grpc_slice_split_head(
&ep->write_staging_buffer,
- static_cast<size_t>(cur -
- GRPC_SLICE_START_PTR(ep->write_staging_buffer))));
+ static_cast<size_t>(
+ cur - GRPC_SLICE_START_PTR(ep->write_staging_buffer))));
}
}
}
@@ -403,7 +404,8 @@ grpc_endpoint* grpc_secure_endpoint_create(
grpc_endpoint* transport, grpc_slice* leftover_slices,
size_t leftover_nslices) {
size_t i;
- secure_endpoint* ep = static_cast<secure_endpoint*>(gpr_malloc(sizeof(secure_endpoint)));
+ secure_endpoint* ep =
+ static_cast<secure_endpoint*>(gpr_malloc(sizeof(secure_endpoint)));
ep->base.vtable = &vtable;
ep->wrapped_ep = transport;
ep->protector = protector;
diff --git a/src/core/lib/security/transport/security_connector.cc b/src/core/lib/security/transport/security_connector.cc
index e9a2d23535..bd5da1bbd2 100644
--- a/src/core/lib/security/transport/security_connector.cc
+++ b/src/core/lib/security/transport/security_connector.cc
@@ -498,7 +498,8 @@ grpc_channel_security_connector* grpc_fake_channel_security_connector_create(
grpc_call_credentials* request_metadata_creds, const char* target,
const grpc_channel_args* args) {
grpc_fake_channel_security_connector* c =
- static_cast<grpc_fake_channel_security_connector*>(gpr_zalloc(sizeof(*c)));
+ static_cast<grpc_fake_channel_security_connector*>(
+ gpr_zalloc(sizeof(*c)));
gpr_ref_init(&c->base.base.refcount, 1);
c->base.base.url_scheme = GRPC_FAKE_SECURITY_URL_SCHEME;
c->base.base.vtable = &fake_channel_vtable;
@@ -518,8 +519,8 @@ grpc_channel_security_connector* grpc_fake_channel_security_connector_create(
grpc_server_security_connector* grpc_fake_server_security_connector_create(
grpc_server_credentials* server_creds) {
grpc_server_security_connector* c =
- static_cast<grpc_server_security_connector*>(gpr_zalloc(
- sizeof(grpc_server_security_connector)));
+ static_cast<grpc_server_security_connector*>(
+ gpr_zalloc(sizeof(grpc_server_security_connector)));
gpr_ref_init(&c->base.refcount, 1);
c->base.vtable = &fake_server_vtable;
c->base.url_scheme = GRPC_FAKE_SECURITY_URL_SCHEME;
@@ -597,8 +598,8 @@ static void ssl_channel_add_handshakers(grpc_channel_security_connector* sc,
static const char** fill_alpn_protocol_strings(size_t* num_alpn_protocols) {
GPR_ASSERT(num_alpn_protocols != nullptr);
*num_alpn_protocols = grpc_chttp2_num_alpn_versions();
- const char** alpn_protocol_strings =
- static_cast<const char**>(gpr_malloc(sizeof(const char*) * (*num_alpn_protocols)));
+ const char** alpn_protocol_strings = static_cast<const char**>(
+ gpr_malloc(sizeof(const char*) * (*num_alpn_protocols)));
for (size_t i = 0; i < *num_alpn_protocols; i++) {
alpn_protocol_strings[i] = grpc_chttp2_get_alpn_version_index(i);
}
@@ -632,8 +633,8 @@ static bool try_replace_server_handshaker_factory(
cert_pairs, config->num_key_cert_pairs, config->pem_root_certs,
get_tsi_client_certificate_request_type(
server_creds->config.client_certificate_request),
- ssl_cipher_suites(), alpn_protocol_strings, static_cast<uint16_t>(num_alpn_protocols),
- &new_handshaker_factory);
+ ssl_cipher_suites(), alpn_protocol_strings,
+ static_cast<uint16_t>(num_alpn_protocols), &new_handshaker_factory);
gpr_free(cert_pairs);
gpr_free((void*)alpn_protocol_strings);
@@ -850,8 +851,8 @@ tsi_peer tsi_shallow_peer_from_ssl_auth_context(
while (grpc_auth_property_iterator_next(&it) != nullptr) max_num_props++;
if (max_num_props > 0) {
- peer.properties = static_cast<tsi_peer_property*>(gpr_malloc(max_num_props *
- sizeof(tsi_peer_property)));
+ peer.properties = static_cast<tsi_peer_property*>(
+ gpr_malloc(max_num_props * sizeof(tsi_peer_property)));
it = grpc_auth_context_property_iterator(auth_context);
while ((prop = grpc_auth_property_iterator_next(&it)) != nullptr) {
if (strcmp(prop->name, GRPC_X509_SAN_PROPERTY_NAME) == 0) {
@@ -963,7 +964,8 @@ const char* grpc_get_default_ssl_roots(void) {
gpr_once_init(&once, init_default_pem_root_certs);
return GRPC_SLICE_IS_EMPTY(default_pem_root_certs)
? nullptr
- : reinterpret_cast<const char*>GRPC_SLICE_START_PTR(default_pem_root_certs);
+ : reinterpret_cast<const char*>
+ GRPC_SLICE_START_PTR(default_pem_root_certs);
}
grpc_security_status grpc_ssl_channel_security_connector_create(
@@ -994,8 +996,8 @@ grpc_security_status grpc_ssl_channel_security_connector_create(
pem_root_certs = config->pem_root_certs;
}
- c = static_cast<grpc_ssl_channel_security_connector*>(gpr_zalloc(
- sizeof(grpc_ssl_channel_security_connector)));
+ c = static_cast<grpc_ssl_channel_security_connector*>(
+ gpr_zalloc(sizeof(grpc_ssl_channel_security_connector)));
gpr_ref_init(&c->base.base.refcount, 1);
c->base.base.vtable = &ssl_channel_vtable;
@@ -1017,8 +1019,8 @@ grpc_security_status grpc_ssl_channel_security_connector_create(
config->pem_key_cert_pair->cert_chain != nullptr;
result = tsi_create_ssl_client_handshaker_factory(
has_key_cert_pair ? config->pem_key_cert_pair : nullptr, pem_root_certs,
- ssl_cipher_suites(), alpn_protocol_strings, static_cast<uint16_t>(num_alpn_protocols),
- &c->client_handshaker_factory);
+ ssl_cipher_suites(), alpn_protocol_strings,
+ static_cast<uint16_t>(num_alpn_protocols), &c->client_handshaker_factory);
if (result != TSI_OK) {
gpr_log(GPR_ERROR, "Handshaker factory creation failed with %s.",
tsi_result_to_string(result));
@@ -1039,8 +1041,8 @@ static grpc_ssl_server_security_connector*
grpc_ssl_server_security_connector_initialize(
grpc_server_credentials* server_creds) {
grpc_ssl_server_security_connector* c =
- static_cast<grpc_ssl_server_security_connector*>(gpr_zalloc(
- sizeof(grpc_ssl_server_security_connector)));
+ static_cast<grpc_ssl_server_security_connector*>(
+ gpr_zalloc(sizeof(grpc_ssl_server_security_connector)));
gpr_ref_init(&c->base.base.refcount, 1);
c->base.base.url_scheme = GRPC_SSL_URL_SCHEME;
c->base.base.vtable = &ssl_server_vtable;
@@ -1078,7 +1080,8 @@ grpc_security_status grpc_ssl_server_security_connector_create(
get_tsi_client_certificate_request_type(
server_credentials->config.client_certificate_request),
ssl_cipher_suites(), alpn_protocol_strings,
- static_cast<uint16_t>(num_alpn_protocols), &c->server_handshaker_factory);
+ static_cast<uint16_t>(num_alpn_protocols),
+ &c->server_handshaker_factory);
gpr_free((void*)alpn_protocol_strings);
if (result != TSI_OK) {
gpr_log(GPR_ERROR, "Handshaker factory creation failed with %s.",
diff --git a/src/core/lib/security/transport/security_handshaker.cc b/src/core/lib/security/transport/security_handshaker.cc
index 2e7c3570b6..b37392ab81 100644
--- a/src/core/lib/security/transport/security_handshaker.cc
+++ b/src/core/lib/security/transport/security_handshaker.cc
@@ -68,8 +68,8 @@ typedef struct {
static size_t move_read_buffer_into_handshake_buffer(security_handshaker* h) {
size_t bytes_in_read_buffer = h->args->read_buffer->length;
if (h->handshake_buffer_size < bytes_in_read_buffer) {
- h->handshake_buffer =
- static_cast<uint8_t*>(gpr_realloc(h->handshake_buffer, bytes_in_read_buffer));
+ h->handshake_buffer = static_cast<uint8_t*>(
+ gpr_realloc(h->handshake_buffer, bytes_in_read_buffer));
h->handshake_buffer_size = bytes_in_read_buffer;
}
size_t offset = 0;
@@ -408,15 +408,16 @@ static const grpc_handshaker_vtable security_handshaker_vtable = {
static grpc_handshaker* security_handshaker_create(
tsi_handshaker* handshaker, grpc_security_connector* connector) {
- security_handshaker* h =
- static_cast<security_handshaker*>(gpr_zalloc(sizeof(security_handshaker)));
+ security_handshaker* h = static_cast<security_handshaker*>(
+ gpr_zalloc(sizeof(security_handshaker)));
grpc_handshaker_init(&security_handshaker_vtable, &h->base);
h->handshaker = handshaker;
h->connector = GRPC_SECURITY_CONNECTOR_REF(connector, "handshake");
gpr_mu_init(&h->mu);
gpr_ref_init(&h->refs, 1);
h->handshake_buffer_size = GRPC_INITIAL_HANDSHAKE_BUFFER_SIZE;
- h->handshake_buffer = static_cast<uint8_t*>(gpr_malloc(h->handshake_buffer_size));
+ h->handshake_buffer =
+ static_cast<uint8_t*>(gpr_malloc(h->handshake_buffer_size));
GRPC_CLOSURE_INIT(&h->on_handshake_data_sent_to_peer,
on_handshake_data_sent_to_peer, h,
grpc_schedule_on_exec_ctx);
@@ -469,8 +470,8 @@ static void client_handshaker_factory_add_handshakers(
grpc_handshaker_factory* handshaker_factory, const grpc_channel_args* args,
grpc_handshake_manager* handshake_mgr) {
grpc_channel_security_connector* security_connector =
- reinterpret_cast<grpc_channel_security_connector*>(grpc_security_connector_find_in_args(
- args));
+ reinterpret_cast<grpc_channel_security_connector*>(
+ grpc_security_connector_find_in_args(args));
grpc_channel_security_connector_add_handshakers(security_connector,
handshake_mgr);
}
@@ -479,8 +480,8 @@ static void server_handshaker_factory_add_handshakers(
grpc_handshaker_factory* hf, const grpc_channel_args* args,
grpc_handshake_manager* handshake_mgr) {
grpc_server_security_connector* security_connector =
- reinterpret_cast<grpc_server_security_connector*>(grpc_security_connector_find_in_args(
- args));
+ reinterpret_cast<grpc_server_security_connector*>(
+ grpc_security_connector_find_in_args(args));
grpc_server_security_connector_add_handshakers(security_connector,
handshake_mgr);
}