aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Jiangtao Li <jiangtao@google.com>2017-08-02 09:59:20 -0700
committerGravatar GitHub <noreply@github.com>2017-08-02 09:59:20 -0700
commit54ecb5a4c25f4dfc043e11b1daae6448e2935006 (patch)
tree15a1b9680a9a94337f01e62d34d83a8eaa6c479d /src
parent0e4bfcfaa5feda2d0069904b21fd555546d1b323 (diff)
parent00b35e71808ba9c17a5edabd2390deed594f80b9 (diff)
Merge pull request #12021 from jiangtaoli2016/unused_bytes
Make tsi handshaker result unused bytes const
Diffstat (limited to 'src')
-rw-r--r--src/core/lib/security/transport/security_handshaker.c2
-rw-r--r--src/core/tsi/fake_transport_security.c2
-rw-r--r--src/core/tsi/transport_security.c2
-rw-r--r--src/core/tsi/transport_security.h3
-rw-r--r--src/core/tsi/transport_security_adapter.c2
-rw-r--r--src/core/tsi/transport_security_interface.h2
6 files changed, 7 insertions, 6 deletions
diff --git a/src/core/lib/security/transport/security_handshaker.c b/src/core/lib/security/transport/security_handshaker.c
index 239a211c0b..b9da6e16b2 100644
--- a/src/core/lib/security/transport/security_handshaker.c
+++ b/src/core/lib/security/transport/security_handshaker.c
@@ -147,7 +147,7 @@ static void on_peer_checked(grpc_exec_ctx *exec_ctx, void *arg,
goto done;
}
// Get unused bytes.
- unsigned char *unused_bytes = NULL;
+ const unsigned char *unused_bytes = NULL;
size_t unused_bytes_size = 0;
result = tsi_handshaker_result_get_unused_bytes(
h->handshaker_result, &unused_bytes, &unused_bytes_size);
diff --git a/src/core/tsi/fake_transport_security.c b/src/core/tsi/fake_transport_security.c
index 1280680663..810447313c 100644
--- a/src/core/tsi/fake_transport_security.c
+++ b/src/core/tsi/fake_transport_security.c
@@ -391,7 +391,7 @@ static tsi_result fake_handshaker_result_create_frame_protector(
}
static tsi_result fake_handshaker_result_get_unused_bytes(
- const tsi_handshaker_result *self, unsigned char **bytes,
+ const tsi_handshaker_result *self, const unsigned char **bytes,
size_t *bytes_size) {
fake_handshaker_result *result = (fake_handshaker_result *)self;
*bytes_size = result->unused_bytes_size;
diff --git a/src/core/tsi/transport_security.c b/src/core/tsi/transport_security.c
index be11d64472..2b1f4310c1 100644
--- a/src/core/tsi/transport_security.c
+++ b/src/core/tsi/transport_security.c
@@ -240,7 +240,7 @@ tsi_result tsi_handshaker_result_create_frame_protector(
}
tsi_result tsi_handshaker_result_get_unused_bytes(
- const tsi_handshaker_result *self, unsigned char **bytes,
+ const tsi_handshaker_result *self, const unsigned char **bytes,
size_t *bytes_size) {
if (self == NULL || bytes == NULL || bytes_size == NULL) {
return TSI_INVALID_ARGUMENT;
diff --git a/src/core/tsi/transport_security.h b/src/core/tsi/transport_security.h
index 4a56c25602..2c7db6bca9 100644
--- a/src/core/tsi/transport_security.h
+++ b/src/core/tsi/transport_security.h
@@ -90,7 +90,8 @@ typedef struct {
size_t *max_output_protected_frame_size,
tsi_frame_protector **protector);
tsi_result (*get_unused_bytes)(const tsi_handshaker_result *self,
- unsigned char **bytes, size_t *bytes_size);
+ const unsigned char **bytes,
+ size_t *bytes_size);
void (*destroy)(tsi_handshaker_result *self);
} tsi_handshaker_result_vtable;
diff --git a/src/core/tsi/transport_security_adapter.c b/src/core/tsi/transport_security_adapter.c
index a0564945e4..b6dc660c47 100644
--- a/src/core/tsi/transport_security_adapter.c
+++ b/src/core/tsi/transport_security_adapter.c
@@ -50,7 +50,7 @@ static tsi_result adapter_result_create_frame_protector(
}
static tsi_result adapter_result_get_unused_bytes(
- const tsi_handshaker_result *self, unsigned char **bytes,
+ const tsi_handshaker_result *self, const unsigned char **bytes,
size_t *byte_size) {
tsi_adapter_handshaker_result *impl = (tsi_adapter_handshaker_result *)self;
*bytes = impl->unused_bytes;
diff --git a/src/core/tsi/transport_security_interface.h b/src/core/tsi/transport_security_interface.h
index 137f8ee5c3..39ba8addc4 100644
--- a/src/core/tsi/transport_security_interface.h
+++ b/src/core/tsi/transport_security_interface.h
@@ -221,7 +221,7 @@ tsi_result tsi_handshaker_result_create_frame_protector(
Ownership of the bytes is retained by the handshaker result. As a
consequence, the caller must not free the bytes. */
tsi_result tsi_handshaker_result_get_unused_bytes(
- const tsi_handshaker_result *self, unsigned char **bytes,
+ const tsi_handshaker_result *self, const unsigned char **bytes,
size_t *byte_size);
/* This method releases the tsi_handshaker_handshaker object. After this method