transport_security_interface.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPC_CORE_TSI_TRANSPORT_SECURITY_INTERFACE_H
20 #define GRPC_CORE_TSI_TRANSPORT_SECURITY_INTERFACE_H
21 
23 
24 #include <stdint.h>
25 #include <stdlib.h>
26 
28 
29 /* --- tsi result --- */
30 
31 typedef enum {
32  TSI_OK = 0,
45  TSI_ASYNC = 13,
47  TSI_CLOSE_NOTIFY = 15, // Indicates that the connection should be closed.
48  TSI_DRAIN_BUFFER = 16, // Indicates that the buffer used to store handshake
49  // data should be drained.
50 } tsi_result;
51 
52 typedef enum {
59 
60 typedef enum {
61  // Default option
68 
69 typedef enum {
70  // TSI implementation provides a normal frame protector. The caller
71  // should invoke tsi_handshaker_result_create_frame_protector() to
72  // generate the frame protector.
74  // TSI implementation provides a zero-copy frame protector. The caller
75  // should invoke tsi_handshaker_result_create_zero_copy_grpc_protector()
76  // to generate the frame protector.
78  // TSI implementation provides both normal and zero-copy frame protectors.
79  // The caller should invoke either
80  // tsi_handshaker_result_create_frame_protector() or
81  // tsi_handshaker_result_create_zero_copy_grpc_protector() to generate
82  // the frame protector.
84  // TSI implementation does not provide any frame protector. This means
85  // that it is safe for the caller to send bytes unprotected on the wire.
88 
89 typedef enum {
93 
95 const char* tsi_security_level_to_string(tsi_security_level security_level);
96 
97 /* --- tsi tracing --- */
98 
100 
101 /* -- tsi_zero_copy_grpc_protector object --
102 
103  This object protects and unprotects grpc slice buffers with zero or minimized
104  memory copy once the handshake is done. Implementations of this object must be
105  thread compatible. This object depends on grpc and the details of this object
106  is defined in transport_security_grpc.h. */
107 
109 
110 /* --- tsi_frame_protector object ---
111 
112  This object protects and unprotects buffers once the handshake is done.
113  Implementations of this object must be thread compatible. */
114 
116 
117 /* Outputs protected frames.
118  - unprotected_bytes is an input only parameter and points to the data
119  to be protected.
120  - unprotected_bytes_size is an input/output parameter used by the caller to
121  specify how many bytes are available in unprotected_bytes. The output
122  value is the number of bytes consumed during the call.
123  - protected_output_frames points to a buffer allocated by the caller that
124  will be written.
125  - protected_output_frames_size is an input/output parameter used by the
126  caller to specify how many bytes are available in protected_output_frames.
127  As an output, this value indicates the number of bytes written.
128  - This method returns TSI_OK in case of success or a specific error code in
129  case of failure. Note that even if all the input unprotected bytes are
130  consumed, they may not have been processed into the returned protected
131  output frames. The caller should call the protect_flush method
132  to make sure that there are no more protected bytes buffered in the
133  protector.
134 
135  A typical way to call this method would be:
136 
137  ------------------------------------------------------------------------
138  unsigned char protected_buffer[4096];
139  size_t protected_buffer_size = sizeof(protected_buffer);
140  tsi_result result = TSI_OK;
141  while (message_size > 0) {
142  size_t protected_buffer_size_to_send = protected_buffer_size;
143  size_t processed_message_size = message_size;
144  result = tsi_frame_protector_protect(protector,
145  message_bytes,
146  &processed_message_size,
147  protected_buffer,
148  &protected_buffer_size_to_send);
149  if (result != TSI_OK) break;
150  send_bytes_to_peer(protected_buffer, protected_buffer_size_to_send);
151  message_bytes += processed_message_size;
152  message_size -= processed_message_size;
153 
154  // Don't forget to flush.
155  if (message_size == 0) {
156  size_t still_pending_size;
157  do {
158  protected_buffer_size_to_send = protected_buffer_size;
159  result = tsi_frame_protector_protect_flush(
160  protector, protected_buffer,
161  &protected_buffer_size_to_send, &still_pending_size);
162  if (result != TSI_OK) break;
163  send_bytes_to_peer(protected_buffer, protected_buffer_size_to_send);
164  } while (still_pending_size > 0);
165  }
166  }
167 
168  if (result != TSI_OK) HandleError(result);
169  ------------------------------------------------------------------------ */
171  const unsigned char* unprotected_bytes,
172  size_t* unprotected_bytes_size,
173  unsigned char* protected_output_frames,
174  size_t* protected_output_frames_size);
175 
176 /* Indicates that we need to flush the bytes buffered in the protector and get
177  the resulting frame.
178  - protected_output_frames points to a buffer allocated by the caller that
179  will be written.
180  - protected_output_frames_size is an input/output parameter used by the
181  caller to specify how many bytes are available in protected_output_frames.
182  - still_pending_bytes is an output parameter indicating the number of bytes
183  that still need to be flushed from the protector.*/
185  tsi_frame_protector* self, unsigned char* protected_output_frames,
186  size_t* protected_output_frames_size, size_t* still_pending_size);
187 
188 /* Outputs unprotected bytes.
189  - protected_frames_bytes is an input only parameter and points to the
190  protected frames to be unprotected.
191  - protected_frames_bytes_size is an input/output only parameter used by the
192  caller to specify how many bytes are available in protected_bytes. The
193  output value is the number of bytes consumed during the call.
194  Implementations will buffer up to a frame of protected data.
195  - unprotected_bytes points to a buffer allocated by the caller that will be
196  written.
197  - unprotected_bytes_size is an input/output parameter used by the caller to
198  specify how many bytes are available in unprotected_bytes. This
199  value is expected to be at most max_protected_frame_size minus overhead
200  which means that max_protected_frame_size is a safe bet. The output value
201  is the number of bytes actually written.
202  If *unprotected_bytes_size is unchanged, there may be more data remaining
203  to unprotect, and the caller should call this function again.
204 
205  - This method returns TSI_OK in case of success. Success includes cases where
206  there is not enough data to output a frame in which case
207  unprotected_bytes_size will be set to 0 and cases where the internal buffer
208  needs to be read before new protected data can be processed in which case
209  protected_frames_size will be set to 0. */
211  tsi_frame_protector* self, const unsigned char* protected_frames_bytes,
212  size_t* protected_frames_bytes_size, unsigned char* unprotected_bytes,
213  size_t* unprotected_bytes_size);
214 
215 /* Destroys the tsi_frame_protector object. */
217 
218 /* --- tsi_peer objects ---
219 
220  tsi_peer objects are a set of properties. The peer owns the properties. */
221 
222 /* This property is of type TSI_PEER_PROPERTY_STRING. */
223 #define TSI_CERTIFICATE_TYPE_PEER_PROPERTY "certificate_type"
224 
225 /* This property represents security level of a channel. */
226 #define TSI_SECURITY_LEVEL_PEER_PROPERTY "security_level"
227 
228 /* Property values may contain NULL characters just like C++ strings.
229  The length field gives the length of the string. */
230 typedef struct tsi_peer_property {
231  char* name;
232  struct {
233  char* data;
234  size_t length;
235  } value;
237 
238 struct tsi_peer {
241 };
242 /* Destructs the tsi_peer object. */
243 void tsi_peer_destruct(tsi_peer* self);
244 
245 /* --- tsi_handshaker_result object ---
246 
247  This object contains all necessary handshake results and data such as peer
248  info, negotiated keys, unused handshake bytes, when the handshake completes.
249  Implementations of this object must be thread compatible. */
250 
252 
253 /* This method extracts tsi peer. It returns TSI_OK assuming there is no fatal
254  error.
255  The caller is responsible for destructing the peer. */
257  tsi_peer* peer);
258 
259 /* This method indicates what type of frame protector is provided by the
260  TSI implementation. */
262  const tsi_handshaker_result* self,
263  tsi_frame_protector_type* frame_protector_type);
264 
265 /* This method creates a tsi_frame_protector object. It returns TSI_OK assuming
266  there is no fatal error.
267  The caller is responsible for destroying the protector. */
269  const tsi_handshaker_result* self, size_t* max_output_protected_frame_size,
270  tsi_frame_protector** protector);
271 
272 /* This method returns the unused bytes from the handshake. It returns TSI_OK
273  assuming there is no fatal error.
274  Ownership of the bytes is retained by the handshaker result. As a
275  consequence, the caller must not free the bytes. */
277  const tsi_handshaker_result* self, const unsigned char** bytes,
278  size_t* bytes_size);
279 
280 /* This method releases the tsi_handshaker_handshaker object. After this method
281  is called, no other method can be called on the object. */
283 
284 /* --- tsi_handshaker objects ----
285 
286  Implementations of this object must be thread compatible.
287 
288  ------------------------------------------------------------------------
289 
290  A typical usage supporting both synchronous and asynchronous TSI handshaker
291  implementations would be:
292 
293  ------------------------------------------------------------------------
294 
295  typedef struct {
296  tsi_handshaker *handshaker;
297  tsi_handshaker_result *handshaker_result;
298  unsigned char *handshake_buffer;
299  size_t handshake_buffer_size;
300  ...
301  } security_handshaker;
302 
303  void do_handshake(security_handshaker *h, ...) {
304  // Start the handshake by the calling do_handshake_next.
305  do_handshake_next(h, NULL, 0);
306  ...
307  }
308 
309  // This method is the callback function when data is received from the
310  // peer. This method will read bytes into the handshake buffer and call
311  // do_handshake_next.
312  void on_handshake_data_received_from_peer(void *user_data) {
313  security_handshaker *h = (security_handshaker *)user_data;
314  size_t bytes_received_size = h->handshake_buffer_size;
315  read_bytes_from_peer(h->handshake_buffer, &bytes_received_size);
316  do_handshake_next(h, h->handshake_buffer, bytes_received_size);
317  }
318 
319  // This method processes a step of handshake, calling tsi_handshaker_next.
320  void do_handshake_next(security_handshaker *h,
321  const unsigned char* bytes_received,
322  size_t bytes_received_size) {
323  tsi_result status = TSI_OK;
324  unsigned char *bytes_to_send = NULL;
325  size_t bytes_to_send_size = 0;
326  tsi_handshaker_result *result = NULL;
327  status = tsi_handshaker_next(
328  handshaker, bytes_received, bytes_received_size, &bytes_to_send,
329  &bytes_to_send_size, &result, on_handshake_next_done, h);
330  // If TSI handshaker is asynchronous, on_handshake_next_done will be
331  // executed inside tsi_handshaker_next.
332  if (status == TSI_ASYNC) return;
333  // If TSI handshaker is synchronous, invoke callback directly in this
334  // thread.
335  on_handshake_next_done(status, (void *)h, bytes_to_send,
336  bytes_to_send_size, result);
337  }
338 
339  // This is the callback function to execute after tsi_handshaker_next.
340  // It is passed to tsi_handshaker_next as a function parameter.
341  void on_handshake_next_done(
342  tsi_result status, void *user_data, const unsigned char *bytes_to_send,
343  size_t bytes_to_send_size, tsi_handshaker_result *result) {
344  security_handshaker *h = (security_handshaker *)user_data;
345  if (status == TSI_INCOMPLETE_DATA) {
346  // Schedule an asynchronous read from the peer. If handshake data are
347  // received, on_handshake_data_received_from_peer will be called.
348  async_read_from_peer(..., ..., on_handshake_data_received_from_peer);
349  return;
350  }
351  if (status != TSI_OK) return;
352 
353  if (bytes_to_send_size > 0) {
354  send_bytes_to_peer(bytes_to_send, bytes_to_send_size);
355  }
356 
357  if (result != NULL) {
358  // Handshake completed.
359  h->result = result;
360  // Check the Peer.
361  tsi_peer peer;
362  status = tsi_handshaker_result_extract_peer(result, &peer);
363  if (status != TSI_OK) return;
364  status = check_peer(&peer);
365  tsi_peer_destruct(&peer);
366  if (status != TSI_OK) return;
367 
368  // Create the protector.
369  tsi_frame_protector* protector = NULL;
370  status = tsi_handshaker_result_create_frame_protector(result, NULL,
371  &protector);
372  if (status != TSI_OK) return;
373 
374  // Do not forget to unprotect outstanding data if any.
375  ....
376  }
377  }
378  ------------------------------------------------------------------------ */
380 
381 /* TODO(jiangtaoli2016): Cleans up deprecated methods when we are ready. */
382 
383 /* TO BE DEPRECATED SOON. Use tsi_handshaker_next instead.
384  Gets bytes that need to be sent to the peer.
385  - bytes is the buffer that will be written with the data to be sent to the
386  peer.
387  - bytes_size is an input/output parameter specifying the capacity of the
388  bytes parameter as input and the number of bytes written as output.
389  Returns TSI_OK if all the data to send to the peer has been written or if
390  nothing has to be sent to the peer (in which base bytes_size outputs to 0),
391  otherwise returns TSI_INCOMPLETE_DATA which indicates that this method
392  needs to be called again to get all the bytes to send to the peer (there
393  was more data to write than the specified bytes_size). In case of a fatal
394  error in the handshake, another specific error code is returned. */
396  unsigned char* bytes,
397  size_t* bytes_size);
398 
399 /* TO BE DEPRECATED SOON. Use tsi_handshaker_next instead.
400  Processes bytes received from the peer.
401  - bytes is the buffer containing the data.
402  - bytes_size is an input/output parameter specifying the size of the data as
403  input and the number of bytes consumed as output.
404  Return TSI_OK if the handshake has all the data it needs to process,
405  otherwise return TSI_INCOMPLETE_DATA which indicates that this method
406  needs to be called again to complete the data needed for processing. In
407  case of a fatal error in the handshake, another specific error code is
408  returned. */
410  const unsigned char* bytes,
411  size_t* bytes_size);
412 
413 /* TO BE DEPRECATED SOON.
414  Gets the result of the handshaker.
415  Returns TSI_OK if the hanshake completed successfully and there has been no
416  errors. Returns TSI_HANDSHAKE_IN_PROGRESS if the handshaker is not done yet
417  but no error has been encountered so far. Otherwise the handshaker failed
418  with the returned error. */
420 
421 /* TO BE DEPRECATED SOON.
422  Returns 1 if the handshake is in progress, 0 otherwise. */
423 #define tsi_handshaker_is_in_progress(h) \
424  (tsi_handshaker_get_result((h)) == TSI_HANDSHAKE_IN_PROGRESS)
425 
426 /* TO BE DEPRECATED SOON. Use tsi_handshaker_result_extract_peer instead.
427  This method may return TSI_FAILED_PRECONDITION if
428  tsi_handshaker_is_in_progress returns 1, it returns TSI_OK otherwise
429  assuming the handshaker is not in a fatal error state.
430  The caller is responsible for destructing the peer. */
432 
433 /* TO BE DEPRECATED SOON. Use tsi_handshaker_result_create_frame_protector
434  instead.
435  This method creates a tsi_frame_protector object after the handshake phase
436  is done. After this method has been called successfully, the only method
437  that can be called on this object is Destroy.
438  - max_output_protected_frame_size is an input/output parameter specifying the
439  desired max output protected frame size as input and outputing the actual
440  max output frame size as the output. Passing NULL is OK and will result in
441  the implementation choosing the default maximum protected frame size. Note
442  that this size only applies to outgoing frames (generated with
443  tsi_frame_protector_protect) and not incoming frames (input of
444  tsi_frame_protector_unprotect).
445  - protector is an output parameter pointing to the newly created
446  tsi_frame_protector object.
447  This method may return TSI_FAILED_PRECONDITION if
448  tsi_handshaker_is_in_progress returns 1, it returns TSI_OK otherwise assuming
449  the handshaker is not in a fatal error state.
450  The caller is responsible for destroying the protector. */
452  tsi_handshaker* self, size_t* max_output_protected_frame_size,
453  tsi_frame_protector** protector);
454 
455 /* Callback function definition for tsi_handshaker_next.
456  - status indicates the status of the next operation.
457  - user_data is the argument to callback function passed from the caller.
458  - bytes_to_send is the data buffer to be sent to the peer.
459  - bytes_to_send_size is the size of data buffer to be sent to the peer.
460  - handshaker_result is the result of handshake when the handshake completes,
461  is NULL otherwise. */
463  tsi_result status, void* user_data, const unsigned char* bytes_to_send,
464  size_t bytes_to_send_size, tsi_handshaker_result* handshaker_result);
465 
466 /* Conduct a next step of the handshake.
467  - received_bytes is the buffer containing the data received from the peer.
468  - received_bytes_size is the size of the data received from the peer.
469  - bytes_to_send is the data buffer to be sent to the peer.
470  - bytes_to_send_size is the size of data buffer to be sent to the peer.
471  - handshaker_result is the result of handshake if the handshake completes.
472  - cb is the callback function defined above. It can be NULL for synchronous
473  TSI handshaker implementation.
474  - user_data is the argument to callback function passed from the caller.
475  This method returns TSI_ASYNC if the TSI handshaker implementation is
476  asynchronous, and in this case, the callback is guaranteed to run in another
477  thread owned by TSI. It returns TSI_OK if the handshake completes or if
478  there are data to send to the peer, otherwise returns TSI_INCOMPLETE_DATA
479  which indicates that this method needs to be called again with more data
480  from the peer. In case of a fatal error in the handshake, another specific
481  error code is returned.
482  The caller is responsible for destroying the handshaker_result. However,
483  the caller should not free bytes_to_send, as the buffer is owned by the
484  tsi_handshaker object. */
486  tsi_handshaker* self, const unsigned char* received_bytes,
487  size_t received_bytes_size, const unsigned char** bytes_to_send,
488  size_t* bytes_to_send_size, tsi_handshaker_result** handshaker_result,
489  tsi_handshaker_on_next_done_cb cb, void* user_data);
490 
491 /* This method shuts down a TSI handshake that is in progress.
492  *
493  * This method will be invoked when TSI handshake should be terminated before
494  * being finished in order to free any resources being used.
495  */
497 
498 /* This method releases the tsi_handshaker object. After this method is called,
499  no other method can be called on the object. */
501 
502 /* This method initializes the necessary shared objects used for tsi
503  implementation. */
504 void tsi_init();
505 
506 /* This method destroys the shared objects created by tsi_init. */
507 void tsi_destroy();
508 
509 #endif /* GRPC_CORE_TSI_TRANSPORT_SECURITY_INTERFACE_H */
trace.h
tsi_handshaker_result_destroy
void tsi_handshaker_result_destroy(tsi_handshaker_result *self)
Definition: transport_security.cc:288
TSI_DONT_REQUEST_CLIENT_CERTIFICATE
@ TSI_DONT_REQUEST_CLIENT_CERTIFICATE
Definition: transport_security_interface.h:62
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
tsi_peer::properties
tsi_peer_property * properties
Definition: transport_security_interface.h:239
tsi_frame_protector_protect_flush
tsi_result tsi_frame_protector_protect_flush(tsi_frame_protector *self, unsigned char *protected_output_frames, size_t *protected_output_frames_size, size_t *still_pending_size)
Definition: transport_security.cc:104
tsi_peer_property::value
struct tsi_peer_property::@48 value
TSI_TLS1_3
@ TSI_TLS1_3
Definition: transport_security_interface.h:91
tsi_handshaker_process_bytes_from_peer
tsi_result tsi_handshaker_process_bytes_from_peer(tsi_handshaker *self, const unsigned char *bytes, size_t *bytes_size)
Definition: transport_security.cc:159
tsi_handshaker
Definition: transport_security.h:84
TSI_SECURITY_MAX
@ TSI_SECURITY_MAX
Definition: transport_security_interface.h:57
TSI_INTERNAL_ERROR
@ TSI_INTERNAL_ERROR
Definition: transport_security_interface.h:39
tsi_tracing_enabled
grpc_core::TraceFlag tsi_tracing_enabled
tsi_handshaker_get_bytes_to_send_to_peer
tsi_result tsi_handshaker_get_bytes_to_send_to_peer(tsi_handshaker *self, unsigned char *bytes, size_t *bytes_size)
Definition: transport_security.cc:144
tsi_peer_property::length
size_t length
Definition: transport_security_interface.h:234
tsi_init
void tsi_init()
tsi_security_level_to_string
const char * tsi_security_level_to_string(tsi_security_level security_level)
Definition: transport_security.cc:70
TSI_FRAME_PROTECTOR_NORMAL
@ TSI_FRAME_PROTECTOR_NORMAL
Definition: transport_security_interface.h:73
status
absl::Status status
Definition: rls.cc:251
TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY
@ TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY
Definition: transport_security_interface.h:66
TSI_FAILED_PRECONDITION
@ TSI_FAILED_PRECONDITION
Definition: transport_security_interface.h:37
TSI_HANDSHAKE_SHUTDOWN
@ TSI_HANDSHAKE_SHUTDOWN
Definition: transport_security_interface.h:46
tsi_frame_protector_unprotect
tsi_result tsi_frame_protector_unprotect(tsi_frame_protector *self, const unsigned char *protected_frames_bytes, size_t *protected_frames_bytes_size, unsigned char *unprotected_bytes, size_t *unprotected_bytes_size)
Definition: transport_security.cc:119
TSI_FRAME_PROTECTOR_ZERO_COPY
@ TSI_FRAME_PROTECTOR_ZERO_COPY
Definition: transport_security_interface.h:77
TSI_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY
@ TSI_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY
Definition: transport_security_interface.h:63
TSI_UNKNOWN_ERROR
@ TSI_UNKNOWN_ERROR
Definition: transport_security_interface.h:33
tsi_frame_protector_protect
tsi_result tsi_frame_protector_protect(tsi_frame_protector *self, const unsigned char *unprotected_bytes, size_t *unprotected_bytes_size, unsigned char *protected_output_frames, size_t *protected_output_frames_size)
Definition: transport_security.cc:87
tsi_destroy
void tsi_destroy()
TSI_OK
@ TSI_OK
Definition: transport_security_interface.h:32
tsi_frame_protector_type
tsi_frame_protector_type
Definition: transport_security_interface.h:69
tsi_client_certificate_request_type
tsi_client_certificate_request_type
Definition: transport_security_interface.h:60
tsi_peer_destruct
void tsi_peer_destruct(tsi_peer *self)
Definition: transport_security.cc:320
TSI_TLS1_2
@ TSI_TLS1_2
Definition: transport_security_interface.h:90
tsi_tls_version
tsi_tls_version
Definition: transport_security_interface.h:89
tsi_handshaker_on_next_done_cb
void(* tsi_handshaker_on_next_done_cb)(tsi_result status, void *user_data, const unsigned char *bytes_to_send, size_t bytes_to_send_size, tsi_handshaker_result *handshaker_result)
Definition: transport_security_interface.h:462
tsi_result
tsi_result
Definition: transport_security_interface.h:31
TSI_PERMISSION_DENIED
@ TSI_PERMISSION_DENIED
Definition: transport_security_interface.h:35
tsi_peer_property::data
char * data
Definition: transport_security_interface.h:233
TSI_INTEGRITY_ONLY
@ TSI_INTEGRITY_ONLY
Definition: transport_security_interface.h:55
TSI_DRAIN_BUFFER
@ TSI_DRAIN_BUFFER
Definition: transport_security_interface.h:48
TSI_SECURITY_NONE
@ TSI_SECURITY_NONE
Definition: transport_security_interface.h:54
tsi_peer_property
struct tsi_peer_property tsi_peer_property
tsi_peer_property::name
char * name
Definition: transport_security_interface.h:231
tsi_handshaker_create_frame_protector
tsi_result tsi_handshaker_create_frame_protector(tsi_handshaker *self, size_t *max_output_protected_frame_size, tsi_frame_protector **protector)
Definition: transport_security.cc:196
TSI_UNIMPLEMENTED
@ TSI_UNIMPLEMENTED
Definition: transport_security_interface.h:38
stdint.h
grpc_core::TraceFlag
Definition: debug/trace.h:63
tsi_peer_property
Definition: transport_security_interface.h:230
TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY
@ TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY
Definition: transport_security_interface.h:65
tsi_handshaker_destroy
void tsi_handshaker_destroy(tsi_handshaker *self)
Definition: transport_security.cc:237
TSI_DATA_CORRUPTED
@ TSI_DATA_CORRUPTED
Definition: transport_security_interface.h:40
tsi_peer
Definition: transport_security_interface.h:238
tsi_handshaker_result_create_frame_protector
tsi_result tsi_handshaker_result_create_frame_protector(const tsi_handshaker_result *self, size_t *max_output_protected_frame_size, tsi_frame_protector **protector)
Definition: transport_security.cc:266
tsi_handshaker_extract_peer
tsi_result tsi_handshaker_extract_peer(tsi_handshaker *self, tsi_peer *peer)
Definition: transport_security.cc:182
TSI_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY
@ TSI_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY
Definition: transport_security_interface.h:64
TSI_INCOMPLETE_DATA
@ TSI_INCOMPLETE_DATA
Definition: transport_security_interface.h:36
bytes
uint8 bytes[10]
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream_unittest.cc:153
tsi_handshaker_get_result
tsi_result tsi_handshaker_get_result(tsi_handshaker *self)
Definition: transport_security.cc:174
tsi_handshaker_next
tsi_result tsi_handshaker_next(tsi_handshaker *self, const unsigned char *received_bytes, size_t received_bytes_size, const unsigned char **bytes_to_send, size_t *bytes_to_send_size, tsi_handshaker_result **handshaker_result, tsi_handshaker_on_next_done_cb cb, void *user_data)
Definition: transport_security.cc:215
TSI_ASYNC
@ TSI_ASYNC
Definition: transport_security_interface.h:45
tsi_security_level
tsi_security_level
Definition: transport_security_interface.h:52
tsi_result_to_string
const char * tsi_result_to_string(tsi_result result)
Definition: transport_security.cc:35
TSI_SECURITY_MIN
@ TSI_SECURITY_MIN
Definition: transport_security_interface.h:53
TSI_INVALID_ARGUMENT
@ TSI_INVALID_ARGUMENT
Definition: transport_security_interface.h:34
tsi_handshaker_result_get_unused_bytes
tsi_result tsi_handshaker_result_get_unused_bytes(const tsi_handshaker_result *self, const unsigned char **bytes, size_t *bytes_size)
Definition: transport_security.cc:277
tsi_handshaker_result_extract_peer
tsi_result tsi_handshaker_result_extract_peer(const tsi_handshaker_result *self, tsi_peer *peer)
Definition: transport_security.cc:244
TSI_OUT_OF_RESOURCES
@ TSI_OUT_OF_RESOURCES
Definition: transport_security_interface.h:44
TSI_CLOSE_NOTIFY
@ TSI_CLOSE_NOTIFY
Definition: transport_security_interface.h:47
TSI_PROTOCOL_FAILURE
@ TSI_PROTOCOL_FAILURE
Definition: transport_security_interface.h:42
tsi_handshaker_shutdown
void tsi_handshaker_shutdown(tsi_handshaker *self)
Definition: transport_security.cc:229
tsi_handshaker_result
Definition: transport_security.h:121
tsi_handshaker_result_get_frame_protector_type
tsi_result tsi_handshaker_result_get_frame_protector_type(const tsi_handshaker_result *self, tsi_frame_protector_type *frame_protector_type)
Definition: transport_security.cc:254
TSI_PRIVACY_AND_INTEGRITY
@ TSI_PRIVACY_AND_INTEGRITY
Definition: transport_security_interface.h:56
TSI_FRAME_PROTECTOR_NORMAL_OR_ZERO_COPY
@ TSI_FRAME_PROTECTOR_NORMAL_OR_ZERO_COPY
Definition: transport_security_interface.h:83
tsi_frame_protector
Definition: transport_security.h:51
tsi_zero_copy_grpc_protector
Definition: transport_security_grpc.h:79
cb
OPENSSL_EXPORT pem_password_cb * cb
Definition: pem.h:351
tsi_peer::property_count
size_t property_count
Definition: transport_security_interface.h:240
TSI_NOT_FOUND
@ TSI_NOT_FOUND
Definition: transport_security_interface.h:41
tsi_frame_protector_destroy
void tsi_frame_protector_destroy(tsi_frame_protector *self)
Definition: transport_security.cc:135
TSI_HANDSHAKE_IN_PROGRESS
@ TSI_HANDSHAKE_IN_PROGRESS
Definition: transport_security_interface.h:43
port_platform.h
TSI_FRAME_PROTECTOR_NONE
@ TSI_FRAME_PROTECTOR_NONE
Definition: transport_security_interface.h:86


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:40