aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/security
diff options
context:
space:
mode:
authorGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2015-01-15 23:16:20 -0800
committerGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2015-01-15 23:16:20 -0800
commit41325505e3606ce5f2a5565158a38298f3daa78a (patch)
treed2d28237003e311694fb2be531128d6505b4d06a /src/core/security
parentcffd920c3f64948df4106a5a455d808c4946842c (diff)
parentb222b4d978c19a786838b9d616f98c7d36be2deb (diff)
Merge pull request #79 from jboeuf/tsi_size_type
Changing size type in Transport Security (TSI) from uint32_t to size_t
Diffstat (limited to 'src/core/security')
-rw-r--r--src/core/security/secure_endpoint.c12
-rw-r--r--src/core/security/secure_transport_setup.c4
-rw-r--r--src/core/security/security_context.c4
3 files changed, 10 insertions, 10 deletions
diff --git a/src/core/security/secure_endpoint.c b/src/core/security/secure_endpoint.c
index 7f0fdf73c9..e73767c1aa 100644
--- a/src/core/security/secure_endpoint.c
+++ b/src/core/security/secure_endpoint.c
@@ -126,8 +126,8 @@ static void on_read(void *user_data, gpr_slice *slices, size_t nslices,
size_t message_size = GPR_SLICE_LENGTH(encrypted);
while (message_size > 0 || keep_looping) {
- gpr_uint32 unprotected_buffer_size_written = end - cur;
- gpr_uint32 processed_message_size = message_size;
+ size_t unprotected_buffer_size_written = end - cur;
+ size_t processed_message_size = message_size;
gpr_mu_lock(&ep->protector_mu);
result = tsi_frame_protector_unprotect(ep->protector, message_bytes,
&processed_message_size, cur,
@@ -245,8 +245,8 @@ static grpc_endpoint_write_status endpoint_write(grpc_endpoint *secure_ep,
gpr_uint8 *message_bytes = GPR_SLICE_START_PTR(plain);
size_t message_size = GPR_SLICE_LENGTH(plain);
while (message_size > 0) {
- gpr_uint32 protected_buffer_size_to_send = end - cur;
- gpr_uint32 processed_message_size = message_size;
+ size_t protected_buffer_size_to_send = end - cur;
+ size_t processed_message_size = message_size;
gpr_mu_lock(&ep->protector_mu);
result = tsi_frame_protector_protect(ep->protector, message_bytes,
&processed_message_size, cur,
@@ -268,9 +268,9 @@ static grpc_endpoint_write_status endpoint_write(grpc_endpoint *secure_ep,
if (result != TSI_OK) break;
}
if (result == TSI_OK) {
- gpr_uint32 still_pending_size;
+ size_t still_pending_size;
do {
- gpr_uint32 protected_buffer_size_to_send = end - cur;
+ size_t protected_buffer_size_to_send = end - cur;
gpr_mu_lock(&ep->protector_mu);
result = tsi_frame_protector_protect_flush(ep->protector, cur,
&protected_buffer_size_to_send,
diff --git a/src/core/security/secure_transport_setup.c b/src/core/security/secure_transport_setup.c
index 3df91ed8e7..50a6987fbf 100644
--- a/src/core/security/secure_transport_setup.c
+++ b/src/core/security/secure_transport_setup.c
@@ -131,7 +131,7 @@ static void send_handshake_bytes_to_peer(grpc_secure_transport_setup *s) {
grpc_endpoint_write_status write_status;
do {
- uint32_t to_send_size = s->handshake_buffer_size - offset;
+ size_t to_send_size = s->handshake_buffer_size - offset;
result = tsi_handshaker_get_bytes_to_send_to_peer(
s->handshaker, s->handshake_buffer + offset, &to_send_size);
offset += to_send_size;
@@ -174,7 +174,7 @@ static void on_handshake_data_received_from_peer(
void *setup, gpr_slice *slices, size_t nslices,
grpc_endpoint_cb_status error) {
grpc_secure_transport_setup *s = setup;
- uint32_t consumed_slice_size = 0;
+ size_t consumed_slice_size = 0;
tsi_result result = TSI_OK;
size_t i;
size_t num_left_overs;
diff --git a/src/core/security/security_context.c b/src/core/security/security_context.c
index fc722f2d82..421b81fd36 100644
--- a/src/core/security/security_context.c
+++ b/src/core/security/security_context.c
@@ -411,9 +411,9 @@ grpc_security_status grpc_ssl_server_security_context_create(
c->base.vtable = &ssl_server_vtable;
result = tsi_create_ssl_server_handshaker_factory(
(const unsigned char **)&config->pem_private_key,
- (const gpr_uint32 *)&config->pem_private_key_size,
+ &config->pem_private_key_size,
(const unsigned char **)&config->pem_cert_chain,
- (const gpr_uint32 *)&config->pem_cert_chain_size, 1,
+ &config->pem_cert_chain_size, 1,
config->pem_root_certs, config->pem_root_certs_size,
GRPC_SSL_CIPHER_SUITES, alpn_protocol_strings,
alpn_protocol_string_lengths, num_alpn_protocols, &c->handshaker_factory);