ssl_transport_security_test.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2017 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 
20 
21 #include <stdbool.h>
22 #include <stdio.h>
23 #include <string.h>
24 
25 #include <openssl/crypto.h>
26 #include <openssl/err.h>
27 #include <openssl/pem.h>
28 
29 #include <grpc/grpc.h>
30 #include <grpc/support/alloc.h>
31 #include <grpc/support/log.h>
33 
41 
42 #define SSL_TSI_TEST_ALPN1 "foo"
43 #define SSL_TSI_TEST_ALPN2 "toto"
44 #define SSL_TSI_TEST_ALPN3 "baz"
45 #define SSL_TSI_TEST_ALPN_NUM 2
46 #define SSL_TSI_TEST_SERVER_KEY_CERT_PAIRS_NUM 2
47 #define SSL_TSI_TEST_BAD_SERVER_KEY_CERT_PAIRS_NUM 1
48 #define SSL_TSI_TEST_CREDENTIALS_DIR "src/core/tsi/test_creds/"
49 #define SSL_TSI_TEST_WRONG_SNI "test.google.cn"
50 
51 // OpenSSL 1.1 uses AES256 for encryption session ticket by default so specify
52 // different STEK size.
53 #if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(OPENSSL_IS_BORINGSSL)
54 const size_t kSessionTicketEncryptionKeySize = 80;
55 #else
57 #endif
58 
59 // Indicates the TLS version used for the test.
61 
62 typedef enum AlpnMode {
68 } AlpnMode;
69 
70 typedef struct ssl_alpn_lib {
72  const char** server_alpn_protocols;
73  const char** client_alpn_protocols;
76 } ssl_alpn_lib;
77 
78 typedef struct ssl_key_cert_lib {
82  char* root_cert;
91 
92 typedef struct ssl_tsi_test_fixture {
100  const char* session_ticket_key;
107 
109  ssl_tsi_test_fixture* ssl_fixture =
110  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
111  GPR_ASSERT(ssl_fixture != nullptr);
112  GPR_ASSERT(ssl_fixture->key_cert_lib != nullptr);
113  GPR_ASSERT(ssl_fixture->alpn_lib != nullptr);
114  ssl_key_cert_lib* key_cert_lib = ssl_fixture->key_cert_lib;
115  ssl_alpn_lib* alpn_lib = ssl_fixture->alpn_lib;
116  /* Create client handshaker factory. */
117  tsi_ssl_client_handshaker_options client_options;
118  client_options.pem_root_certs = key_cert_lib->root_cert;
119  if (ssl_fixture->force_client_auth) {
120  client_options.pem_key_cert_pair =
121  key_cert_lib->use_bad_client_cert
122  ? &key_cert_lib->bad_client_pem_key_cert_pair
123  : &key_cert_lib->client_pem_key_cert_pair;
124  }
125  if (alpn_lib->alpn_mode == ALPN_CLIENT_NO_SERVER ||
126  alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_OK ||
127  alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_MISMATCH) {
128  client_options.alpn_protocols = alpn_lib->client_alpn_protocols;
129  client_options.num_alpn_protocols = alpn_lib->num_client_alpn_protocols;
130  }
131  client_options.root_store =
132  key_cert_lib->use_root_store ? key_cert_lib->root_store : nullptr;
133  if (ssl_fixture->session_cache != nullptr) {
134  client_options.session_cache = ssl_fixture->session_cache;
135  }
136  client_options.min_tls_version = test_tls_version;
137  client_options.max_tls_version = test_tls_version;
139  &client_options, &ssl_fixture->client_handshaker_factory) ==
140  TSI_OK);
141  /* Create server handshaker factory. */
143  if (alpn_lib->alpn_mode == ALPN_SERVER_NO_CLIENT ||
144  alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_OK ||
145  alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_MISMATCH) {
146  server_options.alpn_protocols = alpn_lib->server_alpn_protocols;
147  server_options.num_alpn_protocols = alpn_lib->num_server_alpn_protocols;
148  if (alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_MISMATCH) {
149  server_options.num_alpn_protocols--;
150  }
151  }
152  server_options.pem_key_cert_pairs =
153  key_cert_lib->use_bad_server_cert
154  ? key_cert_lib->bad_server_pem_key_cert_pairs
155  : key_cert_lib->server_pem_key_cert_pairs;
156  server_options.num_key_cert_pairs =
157  key_cert_lib->use_bad_server_cert
158  ? key_cert_lib->bad_server_num_key_cert_pairs
159  : key_cert_lib->server_num_key_cert_pairs;
160  server_options.pem_client_root_certs = key_cert_lib->root_cert;
161  if (ssl_fixture->force_client_auth) {
162  server_options.client_certificate_request =
164  } else {
165  server_options.client_certificate_request =
167  }
168  server_options.session_ticket_key = ssl_fixture->session_ticket_key;
169  server_options.session_ticket_key_size = ssl_fixture->session_ticket_key_size;
170  server_options.min_tls_version = test_tls_version;
171  server_options.max_tls_version = test_tls_version;
173  &server_options, &ssl_fixture->server_handshaker_factory) ==
174  TSI_OK);
175  /* Create server and client handshakers. */
177  ssl_fixture->client_handshaker_factory,
178  ssl_fixture->server_name_indication,
179  ssl_fixture->network_bio_buf_size,
180  ssl_fixture->ssl_bio_buf_size,
181  &ssl_fixture->base.client_handshaker) == TSI_OK);
183  ssl_fixture->server_handshaker_factory,
184  ssl_fixture->network_bio_buf_size,
185  ssl_fixture->ssl_bio_buf_size,
186  &ssl_fixture->base.server_handshaker) == TSI_OK);
187 }
188 
189 static void check_alpn(ssl_tsi_test_fixture* ssl_fixture,
190  const tsi_peer* peer) {
191  GPR_ASSERT(ssl_fixture != nullptr);
192  GPR_ASSERT(ssl_fixture->alpn_lib != nullptr);
193  ssl_alpn_lib* alpn_lib = ssl_fixture->alpn_lib;
194  const tsi_peer_property* alpn_property =
196  if (alpn_lib->alpn_mode != ALPN_CLIENT_SERVER_OK) {
197  GPR_ASSERT(alpn_property == nullptr);
198  } else {
199  GPR_ASSERT(alpn_property != nullptr);
200  const char* expected_match = "baz";
201  GPR_ASSERT(memcmp(alpn_property->value.data, expected_match,
202  alpn_property->value.length) == 0);
203  }
204 }
205 
206 static void check_security_level(const tsi_peer* peer) {
207  const tsi_peer_property* security_level =
209  GPR_ASSERT(security_level != nullptr);
210  const char* expected_match = "TSI_PRIVACY_AND_INTEGRITY";
211  GPR_ASSERT(memcmp(security_level->value.data, expected_match,
212  security_level->value.length) == 0);
213 }
214 
215 static const tsi_peer_property*
217  const tsi_peer_property* cert_type_property =
219  GPR_ASSERT(cert_type_property != nullptr);
220  GPR_ASSERT(memcmp(cert_type_property->value.data, TSI_X509_CERTIFICATE_TYPE,
221  cert_type_property->value.length) == 0);
224  GPR_ASSERT(property != nullptr);
225  return property;
226 }
227 
229  tsi_peer* peer) {
230  const tsi_peer_property* session_reused =
232  GPR_ASSERT(session_reused != nullptr);
233  if (ssl_fixture->session_reused) {
234  GPR_ASSERT(strncmp(session_reused->value.data, "true",
235  session_reused->value.length) == 0);
236  } else {
237  GPR_ASSERT(strncmp(session_reused->value.data, "false",
238  session_reused->value.length) == 0);
239  }
240 }
241 
243  const tsi_peer_property* property =
245  const char* expected_match = "*.test.google.com.au";
246  GPR_ASSERT(memcmp(property->value.data, expected_match,
247  property->value.length) == 0);
250  nullptr);
251  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "foo.test.google.com.au") == 1);
252  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "bar.test.google.com.au") == 1);
253  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "BAR.TEST.GOOGLE.COM.AU") == 1);
254  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "Bar.Test.Google.Com.Au") == 1);
255  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "bAr.TeST.gOOgle.cOm.AU") == 1);
256  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "bar.test.google.blah") == 0);
257  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "foo.bar.test.google.com.au") ==
258  0);
259  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "test.google.com.au") == 0);
260  tsi_peer_destruct(peer);
261 }
262 
263 static bool check_property(tsi_peer* peer, const char* property_name,
264  const char* property_value) {
265  for (size_t i = 0; i < peer->property_count; i++) {
266  const tsi_peer_property* prop = &peer->properties[i];
267  if (strcmp(prop->name, property_name) == 0) {
268  if (strlen(property_value) == prop->value.length &&
269  memcmp(prop->value.data, property_value, prop->value.length) == 0) {
270  return true;
271  }
272  }
273  }
274  return false;
275 }
276 
278  const tsi_peer_property* property =
280  const char* expected_match = "*.test.google.com";
281  GPR_ASSERT(memcmp(property->value.data, expected_match,
282  property->value.length) == 0);
285  "*.test.google.fr") == 1);
288  "waterzooi.test.google.be") == 1);
289  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "foo.test.google.fr") == 1);
290  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "bar.test.google.fr") == 1);
291  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "waterzooi.test.google.be") == 1);
292  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "foo.test.youtube.com") == 1);
293  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "bar.foo.test.google.com") == 0);
294  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "test.google.fr") == 0);
295  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "tartines.test.google.be") == 0);
296  GPR_ASSERT(tsi_ssl_peer_matches_name(peer, "tartines.youtube.com") == 0);
297  tsi_peer_destruct(peer);
298 }
299 
300 static void check_client_peer(ssl_tsi_test_fixture* ssl_fixture,
301  tsi_peer* peer) {
302  GPR_ASSERT(ssl_fixture != nullptr);
303  GPR_ASSERT(ssl_fixture->alpn_lib != nullptr);
304  ssl_alpn_lib* alpn_lib = ssl_fixture->alpn_lib;
305  if (!ssl_fixture->force_client_auth) {
306  GPR_ASSERT(peer->property_count ==
307  (alpn_lib->alpn_mode == ALPN_CLIENT_SERVER_OK ? 3 : 2));
308  } else {
309  const tsi_peer_property* property =
311  const char* expected_match = "testclient";
312  GPR_ASSERT(memcmp(property->value.data, expected_match,
313  property->value.length) == 0);
314  }
315  tsi_peer_destruct(peer);
316 }
317 
319  ssl_tsi_test_fixture* ssl_fixture =
320  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
321  GPR_ASSERT(ssl_fixture != nullptr);
322  GPR_ASSERT(ssl_fixture->key_cert_lib != nullptr);
323  ssl_key_cert_lib* key_cert_lib = ssl_fixture->key_cert_lib;
324  tsi_peer peer;
325  // In TLS 1.3, the client-side handshake succeeds even if the client sends a
326  // bad certificate. In such a case, the server would fail the TLS handshake
327  // and send an alert to the client as the first application data message. In
328  // TLS 1.2, the client-side handshake will fail if the client sends a bad
329  // certificate.
330  //
331  // For OpenSSL versions < 1.1, TLS 1.3 is not supported, so the client-side
332  // handshake should succeed precisely when the server-side handshake
333  // succeeds.
334  bool expect_server_success =
335  !(key_cert_lib->use_bad_server_cert ||
336  (key_cert_lib->use_bad_client_cert && ssl_fixture->force_client_auth));
337 #if OPENSSL_VERSION_NUMBER >= 0x10100000
338  bool expect_client_success = test_tls_version == tsi_tls_version::TSI_TLS1_2
339  ? expect_server_success
340  : !key_cert_lib->use_bad_server_cert;
341 #else
342  bool expect_client_success = expect_server_success;
343 #endif
344  if (expect_client_success) {
346  ssl_fixture->base.client_result, &peer) == TSI_OK);
347  check_session_reusage(ssl_fixture, &peer);
348  check_alpn(ssl_fixture, &peer);
349  check_security_level(&peer);
350  if (ssl_fixture->server_name_indication == nullptr ||
351  strcmp(ssl_fixture->server_name_indication, SSL_TSI_TEST_WRONG_SNI) ==
352  0) {
353  // Expect server to use default server0.pem.
354  check_server0_peer(&peer);
355  } else {
356  // Expect server to use server1.pem.
357  check_server1_peer(&peer);
358  }
359  } else {
360  GPR_ASSERT(ssl_fixture->base.client_result == nullptr);
361  }
362  if (expect_server_success) {
364  ssl_fixture->base.server_result, &peer) == TSI_OK);
365  check_session_reusage(ssl_fixture, &peer);
366  check_alpn(ssl_fixture, &peer);
367  check_security_level(&peer);
368  check_client_peer(ssl_fixture, &peer);
369  } else {
370  GPR_ASSERT(ssl_fixture->base.server_result == nullptr);
371  }
372 }
373 
375  gpr_free(const_cast<char*>(kp.private_key));
376  gpr_free(const_cast<char*>(kp.cert_chain));
377 }
378 
380  ssl_tsi_test_fixture* ssl_fixture =
381  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
382  if (ssl_fixture == nullptr) {
383  return;
384  }
385  /* Destroy ssl_alpn_lib. */
386  ssl_alpn_lib* alpn_lib = ssl_fixture->alpn_lib;
387  for (size_t i = 0; i < alpn_lib->num_server_alpn_protocols; i++) {
388  gpr_free(const_cast<char*>(alpn_lib->server_alpn_protocols[i]));
389  }
390  gpr_free(alpn_lib->server_alpn_protocols);
391  for (size_t i = 0; i < alpn_lib->num_client_alpn_protocols; i++) {
392  gpr_free(const_cast<char*>(alpn_lib->client_alpn_protocols[i]));
393  }
394  gpr_free(alpn_lib->client_alpn_protocols);
395  gpr_free(alpn_lib);
396  /* Destroy ssl_key_cert_lib. */
397  ssl_key_cert_lib* key_cert_lib = ssl_fixture->key_cert_lib;
398  for (size_t i = 0; i < key_cert_lib->server_num_key_cert_pairs; i++) {
400  key_cert_lib->server_pem_key_cert_pairs[i]);
401  }
402  gpr_free(key_cert_lib->server_pem_key_cert_pairs);
403  for (size_t i = 0; i < key_cert_lib->bad_server_num_key_cert_pairs; i++) {
405  key_cert_lib->bad_server_pem_key_cert_pairs[i]);
406  }
410  key_cert_lib->bad_client_pem_key_cert_pair);
411  gpr_free(key_cert_lib->root_cert);
413  gpr_free(key_cert_lib);
414  if (ssl_fixture->session_cache != nullptr) {
416  }
417  /* Unreference others. */
419  ssl_fixture->server_handshaker_factory);
421  ssl_fixture->client_handshaker_factory);
422  gpr_free(ssl_fixture);
423 }
424 
425 static const struct tsi_test_fixture_vtable vtable = {
428 
429 static char* load_file(const char* dir_path, const char* file_name) {
430  char* file_path = static_cast<char*>(
431  gpr_zalloc(sizeof(char) * (strlen(dir_path) + strlen(file_name) + 1)));
432  memcpy(file_path, dir_path, strlen(dir_path));
433  memcpy(file_path + strlen(dir_path), file_name, strlen(file_name));
435  GPR_ASSERT(grpc_load_file(file_path, 1, &slice) == GRPC_ERROR_NONE);
438  gpr_free(file_path);
439  return data;
440 }
441 
443  ssl_tsi_test_fixture* ssl_fixture = grpc_core::Zalloc<ssl_tsi_test_fixture>();
444  tsi_test_fixture_init(&ssl_fixture->base);
445  ssl_fixture->base.test_unused_bytes = true;
446  ssl_fixture->base.vtable = &vtable;
447  /* Create ssl_key_cert_lib. */
448  ssl_key_cert_lib* key_cert_lib = grpc_core::Zalloc<ssl_key_cert_lib>();
449  key_cert_lib->use_bad_server_cert = false;
450  key_cert_lib->use_bad_client_cert = false;
451  key_cert_lib->use_root_store = false;
452  key_cert_lib->server_num_key_cert_pairs =
454  key_cert_lib->bad_server_num_key_cert_pairs =
456  key_cert_lib->server_pem_key_cert_pairs =
457  static_cast<tsi_ssl_pem_key_cert_pair*>(
459  key_cert_lib->server_num_key_cert_pairs));
460  key_cert_lib->bad_server_pem_key_cert_pairs =
461  static_cast<tsi_ssl_pem_key_cert_pair*>(
463  key_cert_lib->bad_server_num_key_cert_pairs));
464  key_cert_lib->server_pem_key_cert_pairs[0].private_key =
465  load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server0.key");
466  key_cert_lib->server_pem_key_cert_pairs[0].cert_chain =
467  load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server0.pem");
468  key_cert_lib->server_pem_key_cert_pairs[1].private_key =
469  load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server1.key");
470  key_cert_lib->server_pem_key_cert_pairs[1].cert_chain =
471  load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server1.pem");
472  key_cert_lib->bad_server_pem_key_cert_pairs[0].private_key =
473  load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "badserver.key");
474  key_cert_lib->bad_server_pem_key_cert_pairs[0].cert_chain =
475  load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "badserver.pem");
476  key_cert_lib->client_pem_key_cert_pair.private_key =
478  key_cert_lib->client_pem_key_cert_pair.cert_chain =
481  load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "badclient.key");
483  load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "badclient.pem");
484  key_cert_lib->root_cert = load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "ca.pem");
485  key_cert_lib->root_store =
487  GPR_ASSERT(key_cert_lib->root_store != nullptr);
488  ssl_fixture->key_cert_lib = key_cert_lib;
489  /* Create ssl_alpn_lib. */
490  ssl_alpn_lib* alpn_lib = grpc_core::Zalloc<ssl_alpn_lib>();
491  alpn_lib->server_alpn_protocols = static_cast<const char**>(
492  gpr_zalloc(sizeof(char*) * SSL_TSI_TEST_ALPN_NUM));
493  alpn_lib->client_alpn_protocols = static_cast<const char**>(
494  gpr_zalloc(sizeof(char*) * SSL_TSI_TEST_ALPN_NUM));
501  alpn_lib->alpn_mode = NO_ALPN;
502  ssl_fixture->alpn_lib = alpn_lib;
503  ssl_fixture->base.vtable = &vtable;
504  ssl_fixture->server_name_indication = nullptr;
505  ssl_fixture->session_reused = false;
506  ssl_fixture->session_ticket_key = nullptr;
507  ssl_fixture->session_ticket_key_size = 0;
508  ssl_fixture->force_client_auth = false;
509  ssl_fixture->network_bio_buf_size = 0;
510  ssl_fixture->ssl_bio_buf_size = 0;
511  return &ssl_fixture->base;
512 }
513 
515  gpr_log(GPR_INFO, "ssl_tsi_test_do_handshake_tiny_handshake_buffer");
517  fixture->handshake_buffer_size = TSI_TEST_TINY_HANDSHAKE_BUFFER_SIZE;
518  // Handshake buffer is too small to hold both handshake messages and the
519  // unused bytes.
520  fixture->test_unused_bytes = false;
523 }
524 
526  gpr_log(GPR_INFO, "ssl_tsi_test_do_handshake_small_handshake_buffer");
528  fixture->handshake_buffer_size = TSI_TEST_SMALL_HANDSHAKE_BUFFER_SIZE;
531 }
532 
534  gpr_log(GPR_INFO, "ssl_tsi_test_do_handshake");
538 }
539 
541  gpr_log(GPR_INFO, "ssl_tsi_test_do_handshake_with_root_store");
543  ssl_tsi_test_fixture* ssl_fixture =
544  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
545  ssl_fixture->key_cert_lib->use_root_store = true;
548 }
549 
551  gpr_log(GPR_INFO, "ssl_tsi_test_do_handshake_with_client_authentication");
553  ssl_tsi_test_fixture* ssl_fixture =
554  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
555  ssl_fixture->force_client_auth = true;
558 }
559 
561  gpr_log(
562  GPR_INFO,
563  "ssl_tsi_test_do_handshake_with_client_authentication_and_root_store");
565  ssl_tsi_test_fixture* ssl_fixture =
566  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
567  ssl_fixture->force_client_auth = true;
568  ssl_fixture->key_cert_lib->use_root_store = true;
571 }
572 
575  "ssl_tsi_test_do_handshake_with_server_name_indication_exact_domain");
576  /* server1 cert contains "waterzooi.test.google.be" in SAN. */
578  ssl_tsi_test_fixture* ssl_fixture =
579  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
580  ssl_fixture->server_name_indication =
581  const_cast<char*>("waterzooi.test.google.be");
584 }
585 
587  gpr_log(
588  GPR_INFO,
589  "ssl_tsi_test_do_handshake_with_server_name_indication_wild_star_domain");
590  /* server1 cert contains "*.test.google.fr" in SAN. */
592  ssl_tsi_test_fixture* ssl_fixture =
593  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
594  ssl_fixture->server_name_indication =
595  const_cast<char*>("juju.test.google.fr");
598 }
599 
602  "ssl_tsi_test_do_handshake_with_wrong_server_name_indication");
603  /* server certs do not contain "test.google.cn". */
605  ssl_tsi_test_fixture* ssl_fixture =
606  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
607  ssl_fixture->server_name_indication =
608  const_cast<char*>(SSL_TSI_TEST_WRONG_SNI);
611 }
612 
614  gpr_log(GPR_INFO, "ssl_tsi_test_do_handshake_with_bad_server_cert");
616  ssl_tsi_test_fixture* ssl_fixture =
617  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
618  ssl_fixture->key_cert_lib->use_bad_server_cert = true;
621 }
622 
624  gpr_log(GPR_INFO, "ssl_tsi_test_do_handshake_with_bad_client_cert");
626  ssl_tsi_test_fixture* ssl_fixture =
627  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
628  ssl_fixture->key_cert_lib->use_bad_client_cert = true;
629  ssl_fixture->force_client_auth = true;
632 }
633 
635  gpr_log(GPR_INFO, "ssl_tsi_test_do_handshake_alpn_client_no_server");
637  ssl_tsi_test_fixture* ssl_fixture =
638  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
639  ssl_fixture->alpn_lib->alpn_mode = ALPN_CLIENT_NO_SERVER;
642 }
643 
645  gpr_log(GPR_INFO, "ssl_tsi_test_do_handshake_alpn_server_no_client");
647  ssl_tsi_test_fixture* ssl_fixture =
648  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
649  ssl_fixture->alpn_lib->alpn_mode = ALPN_SERVER_NO_CLIENT;
652 }
653 
655  gpr_log(GPR_INFO, "ssl_tsi_test_do_handshake_alpn_server_no_client");
657  ssl_tsi_test_fixture* ssl_fixture =
658  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
662 }
663 
665  gpr_log(GPR_INFO, "ssl_tsi_test_do_handshake_alpn_client_server_ok");
667  ssl_tsi_test_fixture* ssl_fixture =
668  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
669  ssl_fixture->alpn_lib->alpn_mode = ALPN_CLIENT_SERVER_OK;
672 }
673 
675  gpr_log(GPR_INFO, "ssl_tsi_test_do_round_trip_for_all_configs");
676  unsigned int* bit_array = static_cast<unsigned int*>(
677  gpr_zalloc(sizeof(unsigned int) * TSI_TEST_NUM_OF_ARGUMENTS));
678  const unsigned int mask = 1U << (TSI_TEST_NUM_OF_ARGUMENTS - 1);
679  for (unsigned int val = 0; val < TSI_TEST_NUM_OF_COMBINATIONS; val++) {
680  unsigned int v = val;
681  for (unsigned int ind = 0; ind < TSI_TEST_NUM_OF_ARGUMENTS; ind++) {
682  bit_array[ind] = (v & mask) ? 1 : 0;
683  v <<= 1;
684  }
686  ssl_tsi_test_fixture* ssl_fixture =
687  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
690  bit_array[0], bit_array[1], bit_array[2], bit_array[3], bit_array[4],
691  bit_array[5], bit_array[6]);
692  tsi_test_do_round_trip(&ssl_fixture->base);
694  }
695  gpr_free(bit_array);
696 }
697 
699  gpr_log(GPR_INFO, "ssl_tsi_test_do_round_trip_with_error_on_stack");
700  // Invoke an SSL function that causes an error, and ensure the error
701  // makes it to the stack.
703  GPR_ASSERT(ERR_peek_error() != 0);
707 }
708 
709 static bool is_slow_build() {
710 #if defined(GPR_ARCH_32) || defined(__APPLE__)
711  return true;
712 #else
713  return BuiltUnderMsan() || BuiltUnderTsan();
714 #endif
715 }
716 
718  gpr_log(GPR_INFO, "ssl_tsi_test_do_round_trip_odd_buffer_size");
719  const size_t odd_sizes[] = {1025, 2051, 4103, 8207, 16409};
720  size_t size = sizeof(odd_sizes) / sizeof(size_t);
721  // 1. This test is extremely slow under MSAN and TSAN.
722  // 2. On 32-bit, the test is much slower (probably due to lack of boringssl
723  // asm optimizations) so we only run a subset of tests to avoid timeout.
724  // 3. On Mac OS, we have slower testing machines so we only run a subset
725  // of tests to avoid timeout.
726  if (is_slow_build()) {
727  size = 1;
728  }
729  for (size_t ind1 = 0; ind1 < size; ind1++) {
730  for (size_t ind2 = 0; ind2 < size; ind2++) {
731  for (size_t ind3 = 0; ind3 < size; ind3++) {
732  for (size_t ind4 = 0; ind4 < size; ind4++) {
733  for (size_t ind5 = 0; ind5 < size; ind5++) {
735  ssl_tsi_test_fixture* ssl_fixture =
736  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
738  ssl_fixture->base.config, odd_sizes[ind1], odd_sizes[ind2],
739  odd_sizes[ind3], odd_sizes[ind4], odd_sizes[ind5]);
740  tsi_test_do_round_trip(&ssl_fixture->base);
742  }
743  }
744  }
745  }
746  }
747 }
748 
750  gpr_log(GPR_INFO, "ssl_tsi_test_do_handshake_session_cache");
752  char session_ticket_key[kSessionTicketEncryptionKeySize];
753  auto do_handshake = [&session_ticket_key,
754  &session_cache](bool session_reused) {
756  ssl_tsi_test_fixture* ssl_fixture =
757  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
758  ssl_fixture->server_name_indication =
759  const_cast<char*>("waterzooi.test.google.be");
760  ssl_fixture->session_ticket_key = session_ticket_key;
761  ssl_fixture->session_ticket_key_size = sizeof(session_ticket_key);
762  tsi_ssl_session_cache_ref(session_cache);
763  ssl_fixture->session_cache = session_cache;
764  ssl_fixture->session_reused = session_reused;
765  tsi_test_do_round_trip(&ssl_fixture->base);
767  };
768  memset(session_ticket_key, 'a', sizeof(session_ticket_key));
769  do_handshake(false);
770  do_handshake(true);
771  do_handshake(true);
772  // Changing session_ticket_key on server invalidates ticket.
773  memset(session_ticket_key, 'b', sizeof(session_ticket_key));
774  do_handshake(false);
775  do_handshake(true);
776  memset(session_ticket_key, 'c', sizeof(session_ticket_key));
777  do_handshake(false);
778  do_handshake(true);
779  tsi_ssl_session_cache_unref(session_cache);
780 }
781 
784 
786  tsi_ssl_handshaker_factory* factory) {
787  GPR_ASSERT(factory != nullptr);
789  if (original_vtable != nullptr && original_vtable->destroy != nullptr) {
790  original_vtable->destroy(factory);
791  }
792 }
793 
796 
798  int i;
799  char* cert_chain = load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "client.pem");
800 
802  options.pem_root_certs = cert_chain;
803  tsi_ssl_client_handshaker_factory* client_handshaker_factory;
805  &options, &client_handshaker_factory) == TSI_OK);
806 
809  reinterpret_cast<tsi_ssl_handshaker_factory*>(client_handshaker_factory),
811 
812  tsi_handshaker* handshaker[3];
813 
814  for (i = 0; i < 3; ++i) {
816  client_handshaker_factory, "google.com", 0, 0,
817  &handshaker[i]) == TSI_OK);
818  }
819 
820  tsi_handshaker_destroy(handshaker[1]);
822 
823  tsi_handshaker_destroy(handshaker[0]);
825 
826  tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory);
828 
829  tsi_handshaker_destroy(handshaker[2]);
831 
832  gpr_free(cert_chain);
833 }
834 
836  int i;
837  tsi_ssl_server_handshaker_factory* server_handshaker_factory;
838  tsi_handshaker* handshaker[3];
839  const char* cert_chain =
840  load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server0.pem");
841  tsi_ssl_pem_key_cert_pair cert_pair;
842 
843  cert_pair.cert_chain = cert_chain;
844  cert_pair.private_key =
845  load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server0.key");
847  options.pem_key_cert_pairs = &cert_pair;
848  options.num_key_cert_pairs = 1;
849  options.pem_client_root_certs = cert_chain;
850 
852  &options, &server_handshaker_factory) == TSI_OK);
853 
856  reinterpret_cast<tsi_ssl_handshaker_factory*>(server_handshaker_factory),
858 
859  for (i = 0; i < 3; ++i) {
861  server_handshaker_factory, 0, 0, &handshaker[i]) == TSI_OK);
862  }
863 
864  tsi_handshaker_destroy(handshaker[1]);
866 
867  tsi_handshaker_destroy(handshaker[0]);
869 
870  tsi_ssl_server_handshaker_factory_unref(server_handshaker_factory);
872 
873  tsi_handshaker_destroy(handshaker[2]);
875 
877 }
878 
879 /* Attempting to create a handshaker factory with invalid parameters should fail
880  * but not crash. */
882  const char* cert_chain = "This is not a valid PEM file.";
883 
884  tsi_ssl_client_handshaker_factory* client_handshaker_factory;
886  options.pem_root_certs = cert_chain;
888  &options, &client_handshaker_factory) == TSI_INVALID_ARGUMENT);
889  tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory);
890 }
891 
893  gpr_log(GPR_INFO, "ssl_tsi_test_handshaker_factory_internals");
897 }
898 
900  gpr_log(GPR_INFO, "ssl_tsi_test_duplicate_root_certificates");
901  char* root_cert = load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "ca.pem");
902  char* dup_root_cert = static_cast<char*>(
903  gpr_zalloc(sizeof(char) * (strlen(root_cert) * 2 + 1)));
904  memcpy(dup_root_cert, root_cert, strlen(root_cert));
905  memcpy(dup_root_cert + strlen(root_cert), root_cert, strlen(root_cert));
906  tsi_ssl_root_certs_store* root_store =
907  tsi_ssl_root_certs_store_create(dup_root_cert);
908  GPR_ASSERT(root_store != nullptr);
909  // Free memory.
911  gpr_free(root_cert);
912  gpr_free(dup_root_cert);
913 }
914 
916  gpr_log(GPR_INFO, "ssl_tsi_test_extract_x509_subject_names");
917  char* cert = load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "multi-domain.pem");
918  tsi_peer peer;
920  TSI_OK);
921  // tsi_peer should include one subject, one common name, one certificate, one
922  // security level, ten SAN fields, two DNS SAN fields, three URI fields, two
923  // email addresses and two IP addresses.
924  size_t expected_property_count = 22;
925  GPR_ASSERT(peer.property_count == expected_property_count);
926  // Check subject
927  const char* expected_subject = "CN=xpigors,OU=Google,L=SF,ST=CA,C=US";
928  const tsi_peer_property* property =
930  GPR_ASSERT(property != nullptr);
931  GPR_ASSERT(memcmp(property->value.data, expected_subject,
932  property->value.length) == 0);
933  // Check common name
934  const char* expected_cn = "xpigors";
937  GPR_ASSERT(property != nullptr);
938  GPR_ASSERT(
939  memcmp(property->value.data, expected_cn, property->value.length) == 0);
940  // Check certificate data
942  GPR_ASSERT(property != nullptr);
943  GPR_ASSERT(memcmp(property->value.data, cert, property->value.length) == 0);
944  // Check DNS
947  "foo.test.domain.com") == 1);
950  "bar.test.domain.com") == 1);
952  "foo.test.domain.com") == 1);
954  "bar.test.domain.com") == 1);
955  // Check URI
956  // Note that a valid SPIFFE certificate should only have one URI.
959  "spiffe://foo.com/bar/baz") == 1);
962  "https://foo.test.domain.com/test") == 1);
965  "https://bar.test.domain.com/test") == 1);
967  "spiffe://foo.com/bar/baz") == 1);
969  "https://foo.test.domain.com/test") == 1);
971  "https://bar.test.domain.com/test") == 1);
972  // Check email address
975  "foo@test.domain.com") == 1);
978  "bar@test.domain.com") == 1);
980  "foo@test.domain.com") == 1);
982  "bar@test.domain.com") == 1);
983  // Check ip address
986  "192.168.7.1") == 1);
989  "13::17") == 1);
990  GPR_ASSERT(check_property(&peer, TSI_X509_IP_PEER_PROPERTY, "192.168.7.1") ==
991  1);
992  GPR_ASSERT(check_property(&peer, TSI_X509_IP_PEER_PROPERTY, "13::17") == 1);
993  // Check other fields
996  "other types of SAN") == 1);
997  // Free memory
998  gpr_free(cert);
999  tsi_peer_destruct(&peer);
1000 }
1001 
1003  gpr_log(GPR_INFO, "ssl_tsi_test_extract_cert_chain");
1004  char* cert = load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "server1.pem");
1005  char* ca = load_file(SSL_TSI_TEST_CREDENTIALS_DIR, "ca.pem");
1006  char* chain = static_cast<char*>(
1007  gpr_zalloc(sizeof(char) * (strlen(cert) + strlen(ca) + 1)));
1008  memcpy(chain, cert, strlen(cert));
1009  memcpy(chain + strlen(cert), ca, strlen(ca));
1010  STACK_OF(X509)* cert_chain = sk_X509_new_null();
1011  GPR_ASSERT(cert_chain != nullptr);
1012  BIO* bio = BIO_new_mem_buf(chain, strlen(chain));
1013  GPR_ASSERT(bio != nullptr);
1014  STACK_OF(X509_INFO)* certInfos =
1015  PEM_X509_INFO_read_bio(bio, nullptr, nullptr, nullptr);
1016  GPR_ASSERT(certInfos != nullptr);
1017  for (size_t i = 0; i < sk_X509_INFO_num(certInfos); i++) {
1018  X509_INFO* certInfo = sk_X509_INFO_value(certInfos, i);
1019  if (certInfo->x509 != nullptr) {
1020  GPR_ASSERT(sk_X509_push(cert_chain, certInfo->x509) != 0);
1021 #if OPENSSL_VERSION_NUMBER >= 0x10100000
1022  X509_up_ref(certInfo->x509);
1023 #else
1024  certInfo->x509->references += 1;
1025 #endif
1026  }
1027  }
1028  tsi_peer_property chain_property;
1029  GPR_ASSERT(tsi_ssl_get_cert_chain_contents(cert_chain, &chain_property) ==
1030  TSI_OK);
1031  GPR_ASSERT(memcmp(chain, chain_property.value.data,
1032  chain_property.value.length) == 0);
1033  BIO_free(bio);
1034  gpr_free(chain);
1035  gpr_free(cert);
1036  gpr_free(ca);
1037  tsi_peer_property_destruct(&chain_property);
1038  sk_X509_INFO_pop_free(certInfos, X509_INFO_free);
1039  sk_X509_pop_free(cert_chain, X509_free);
1040 }
1041 
1043  gpr_log(GPR_INFO, "ssl_tsi_test_do_handshake_with_custom_bio_pair");
1045  ssl_tsi_test_fixture* ssl_fixture =
1046  reinterpret_cast<ssl_tsi_test_fixture*>(fixture);
1047 #if OPENSSL_VERSION_NUMBER >= 0x10100000
1049  ssl_fixture->ssl_bio_buf_size = 256;
1050 #endif
1051  ssl_fixture->force_client_auth = true;
1054 }
1055 
1056 int main(int argc, char** argv) {
1057  grpc::testing::TestEnvironment env(&argc, argv);
1058  grpc_init();
1059  const size_t number_tls_versions = 2;
1060  const tsi_tls_version tls_versions[] = {tsi_tls_version::TSI_TLS1_2,
1062  for (size_t i = 0; i < number_tls_versions; i++) {
1063  // Set the TLS version to be used in the tests.
1064  test_tls_version = tls_versions[i];
1065  // Run all the tests using that TLS version for both the client and server.
1077 #ifdef OPENSSL_IS_BORINGSSL
1078  // BoringSSL and OpenSSL have different behaviors on mismatched ALPN.
1081 #endif
1093  }
1094  grpc_shutdown();
1095  return 0;
1096 }
ssl_key_cert_lib::bad_server_pem_key_cert_pairs
tsi_ssl_pem_key_cert_pair * bad_server_pem_key_cert_pairs
Definition: ssl_transport_security_test.cc:85
grpc_slice_unref
GPRAPI void grpc_slice_unref(grpc_slice s)
Definition: slice_api.cc:32
TSI_DONT_REQUEST_CLIENT_CERTIFICATE
@ TSI_DONT_REQUEST_CLIENT_CERTIFICATE
Definition: transport_security_interface.h:62
TSI_X509_CERTIFICATE_TYPE
#define TSI_X509_CERTIFICATE_TYPE
Definition: ssl_transport_security.h:34
ALPN_SERVER_NO_CLIENT
@ ALPN_SERVER_NO_CLIENT
Definition: ssl_transport_security_test.cc:65
X509_info_st::x509
X509 * x509
Definition: x509.h:288
GPR_INFO
#define GPR_INFO
Definition: include/grpc/impl/codegen/log.h:56
ssl_tsi_test_fixture::client_handshaker_factory
tsi_ssl_client_handshaker_factory * client_handshaker_factory
Definition: ssl_transport_security_test.cc:105
tsi_peer_property_destruct
void tsi_peer_property_destruct(tsi_peer_property *property)
Definition: transport_security.cc:310
ssl_alpn_lib::num_client_alpn_protocols
uint16_t num_client_alpn_protocols
Definition: ssl_transport_security_test.cc:75
tsi_ssl_client_handshaker_options::pem_root_certs
const char * pem_root_certs
Definition: ssl_transport_security.h:144
ssl_key_cert_lib::bad_server_num_key_cert_pairs
uint16_t bad_server_num_key_cert_pairs
Definition: ssl_transport_security_test.cc:89
EC_KEY_new_by_curve_name
#define EC_KEY_new_by_curve_name
Definition: boringssl_prefix_symbols.h:1356
tsi_create_ssl_server_handshaker_factory_with_options
tsi_result tsi_create_ssl_server_handshaker_factory_with_options(const tsi_ssl_server_handshaker_options *options, tsi_ssl_server_handshaker_factory **factory)
Definition: ssl_transport_security.cc:2179
tsi_ssl_handshaker_factory_vtable::destroy
tsi_ssl_handshaker_factory_destructor destroy
Definition: ssl_transport_security.h:389
ssl_alpn_lib::alpn_mode
AlpnMode alpn_mode
Definition: ssl_transport_security_test.cc:71
tsi_test_fixture::server_handshaker
tsi_handshaker * server_handshaker
Definition: transport_security_test_lib.h:78
ssl_tsi_test_extract_cert_chain
void ssl_tsi_test_extract_cert_chain()
Definition: ssl_transport_security_test.cc:1002
tsi_test_fixture::client_result
tsi_handshaker_result * client_result
Definition: transport_security_test_lib.h:82
GRPC_ERROR_NONE
#define GRPC_ERROR_NONE
Definition: error.h:234
log.h
tsi_peer::properties
tsi_peer_property * properties
Definition: transport_security_interface.h:239
SSL_TSI_TEST_ALPN3
#define SSL_TSI_TEST_ALPN3
Definition: ssl_transport_security_test.cc:44
SSL_TSI_TEST_ALPN2
#define SSL_TSI_TEST_ALPN2
Definition: ssl_transport_security_test.cc:43
ssl_key_cert_lib::root_cert
char * root_cert
Definition: ssl_transport_security_test.cc:82
tsi_peer_property::value
struct tsi_peer_property::@48 value
TSI_TLS1_3
@ TSI_TLS1_3
Definition: transport_security_interface.h:91
grpc_load_file
grpc_error_handle grpc_load_file(const char *filename, int add_null_terminator, grpc_slice *output)
Definition: load_file.cc:33
generate.env
env
Definition: generate.py:37
ssl_tsi_test_do_handshake_with_bad_server_cert
void ssl_tsi_test_do_handshake_with_bad_server_cert()
Definition: ssl_transport_security_test.cc:613
tsi_create_ssl_client_handshaker_factory_with_options
tsi_result tsi_create_ssl_client_handshaker_factory_with_options(const tsi_ssl_client_handshaker_options *options, tsi_ssl_client_handshaker_factory **factory)
Definition: ssl_transport_security.cc:2007
ssl_key_cert_lib
struct ssl_key_cert_lib ssl_key_cert_lib
tsi_test_frame_protector_config_set_buffer_size
void tsi_test_frame_protector_config_set_buffer_size(tsi_test_frame_protector_config *config, size_t read_buffer_allocated_size, size_t message_buffer_allocated_size, size_t protected_buffer_size, size_t client_max_output_protected_frame_size, size_t server_max_output_protected_frame_size)
Definition: transport_security_test_lib.cc:560
memset
return memset(p, 0, total)
test_tsi_ssl_client_handshaker_factory_refcounting
void test_tsi_ssl_client_handshaker_factory_refcounting()
Definition: ssl_transport_security_test.cc:797
ssl_alpn_lib::num_server_alpn_protocols
uint16_t num_server_alpn_protocols
Definition: ssl_transport_security_test.cc:74
load_file.h
bio_st
Definition: bio.h:822
TSI_TEST_NUM_OF_ARGUMENTS
#define TSI_TEST_NUM_OF_ARGUMENTS
Definition: transport_security_test_lib.h:38
tsi_test_fixture_vtable
Definition: transport_security_test_lib.h:67
ssl_tsi_test_do_handshake_small_handshake_buffer
void ssl_tsi_test_do_handshake_small_handshake_buffer()
Definition: ssl_transport_security_test.cc:525
TSI_SSL_ALPN_SELECTED_PROTOCOL
#define TSI_SSL_ALPN_SELECTED_PROTOCOL
Definition: ssl_transport_security.h:44
tsi_handshaker
Definition: transport_security.h:84
TSI_X509_SUBJECT_PEER_PROPERTY
#define TSI_X509_SUBJECT_PEER_PROPERTY
Definition: ssl_transport_security.h:37
ssl_key_cert_lib::use_bad_server_cert
bool use_bad_server_cert
Definition: ssl_transport_security_test.cc:79
uint16_t
unsigned short uint16_t
Definition: stdint-msvc2008.h:79
tsi_ssl_pem_key_cert_pair
Definition: ssl_transport_security.h:101
TSI_X509_IP_PEER_PROPERTY
#define TSI_X509_IP_PEER_PROPERTY
Definition: ssl_transport_security.h:48
tsi_handshaker_destroy
void tsi_handshaker_destroy(tsi_handshaker *self)
Definition: transport_security.cc:237
ssl_tsi_test_handshaker_factory_internals
void ssl_tsi_test_handshaker_factory_internals()
Definition: ssl_transport_security_test.cc:892
SSL_TSI_TEST_WRONG_SNI
#define SSL_TSI_TEST_WRONG_SNI
Definition: ssl_transport_security_test.cc:49
TSI_SECURITY_LEVEL_PEER_PROPERTY
#define TSI_SECURITY_LEVEL_PEER_PROPERTY
Definition: transport_security_interface.h:226
ssl_tsi_test_fixture::session_cache
tsi_ssl_session_cache * session_cache
Definition: ssl_transport_security_test.cc:98
tsi_ssl_client_handshaker_factory_unref
void tsi_ssl_client_handshaker_factory_unref(tsi_ssl_client_handshaker_factory *factory)
Definition: ssl_transport_security.cc:1783
tsi_peer_property::length
size_t length
Definition: transport_security_interface.h:234
string.h
options
double_dict options[]
Definition: capstone_test.c:55
ind
Definition: bloaty/third_party/zlib/examples/gun.c:81
ssl_tsi_test_duplicate_root_certificates
void ssl_tsi_test_duplicate_root_certificates()
Definition: ssl_transport_security_test.cc:899
check_basic_authenticated_peer_and_get_common_name
static const tsi_peer_property * check_basic_authenticated_peer_and_get_common_name(const tsi_peer *peer)
Definition: ssl_transport_security_test.cc:216
tsi_ssl_client_handshaker_factory
Definition: ssl_transport_security.cc:93
tsi_test_fixture::test_unused_bytes
bool test_unused_bytes
Definition: transport_security_test_lib.h:100
ssl_tsi_test_fixture::server_handshaker_factory
tsi_ssl_server_handshaker_factory * server_handshaker_factory
Definition: ssl_transport_security_test.cc:104
ssl_tsi_test_do_round_trip_for_all_configs
void ssl_tsi_test_do_round_trip_for_all_configs()
Definition: ssl_transport_security_test.cc:674
gpr_free
GPRAPI void gpr_free(void *ptr)
Definition: alloc.cc:51
tsi_ssl_session_cache_unref
void tsi_ssl_session_cache_unref(tsi_ssl_session_cache *cache)
Definition: ssl_transport_security.cc:1048
tsi_test_frame_protector_config_destroy
void tsi_test_frame_protector_config_destroy(tsi_test_frame_protector_config *config)
Definition: transport_security_test_lib.cc:575
ssl_key_cert_lib::use_root_store
bool use_root_store
Definition: ssl_transport_security_test.cc:81
tsi_test_fixture_init
void tsi_test_fixture_init(tsi_test_fixture *fixture)
Definition: transport_security_test_lib.cc:607
gpr_malloc
GPRAPI void * gpr_malloc(size_t size)
Definition: alloc.cc:29
tsi_test_fixture_destroy
void tsi_test_fixture_destroy(tsi_test_fixture *fixture)
Definition: transport_security_test_lib.cc:620
TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY
@ TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY
Definition: transport_security_interface.h:66
ssl_alpn_lib
struct ssl_alpn_lib ssl_alpn_lib
pem.h
tsi_ssl_pem_key_cert_pair::cert_chain
const char * cert_chain
Definition: ssl_transport_security.h:108
ssl_alpn_lib::client_alpn_protocols
const char ** client_alpn_protocols
Definition: ssl_transport_security_test.cc:73
transport_security_test_lib.h
ssl_tsi_test_fixture::session_reused
bool session_reused
Definition: ssl_transport_security_test.cc:99
ssl_tsi_test_do_handshake_alpn_client_server_ok
void ssl_tsi_test_do_handshake_alpn_client_server_ok()
Definition: ssl_transport_security_test.cc:664
tsi_ssl_client_handshaker_options::pem_key_cert_pair
const tsi_ssl_pem_key_cert_pair * pem_key_cert_pair
Definition: ssl_transport_security.h:141
tsi_ssl_get_cert_chain_contents
tsi_result tsi_ssl_get_cert_chain_contents(STACK_OF(X509) *peer_chain, tsi_peer_property *property)
Definition: ssl_transport_security.cc:1246
test_tsi_ssl_server_handshaker_factory_refcounting
void test_tsi_ssl_server_handshaker_factory_refcounting()
Definition: ssl_transport_security_test.cc:835
ssl_transport_security.h
ssl_key_cert_lib::bad_client_pem_key_cert_pair
tsi_ssl_pem_key_cert_pair bad_client_pem_key_cert_pair
Definition: ssl_transport_security_test.cc:87
ssl_tsi_test_do_handshake_with_bad_client_cert
void ssl_tsi_test_do_handshake_with_bad_client_cert()
Definition: ssl_transport_security_test.cc:623
ssl_tsi_test_fixture_create
static tsi_test_fixture * ssl_tsi_test_fixture_create()
Definition: ssl_transport_security_test.cc:442
ssl_tsi_test_fixture::force_client_auth
bool force_client_auth
Definition: ssl_transport_security_test.cc:96
tsi_ssl_client_handshaker_options::max_tls_version
tsi_tls_version max_tls_version
Definition: ssl_transport_security.h:174
tsi_ssl_client_handshaker_options::alpn_protocols
const char ** alpn_protocols
Definition: ssl_transport_security.h:159
test_tsi_ssl_client_handshaker_factory_bad_params
void test_tsi_ssl_client_handshaker_factory_bad_params()
Definition: ssl_transport_security_test.cc:881
ssl_tsi_test_handshaker_factory_destructor
static void ssl_tsi_test_handshaker_factory_destructor(tsi_ssl_handshaker_factory *factory)
Definition: ssl_transport_security_test.cc:785
tsi_ssl_server_handshaker_options
Definition: ssl_transport_security.h:279
ssl_tsi_test_do_handshake_with_server_name_indication_wild_star_domain
void ssl_tsi_test_do_handshake_with_server_name_indication_wild_star_domain()
Definition: ssl_transport_security_test.cc:586
TSI_X509_URI_PEER_PROPERTY
#define TSI_X509_URI_PEER_PROPERTY
Definition: ssl_transport_security.h:46
gpr_zalloc
GPRAPI void * gpr_zalloc(size_t size)
Definition: alloc.cc:40
X509_free
#define X509_free
Definition: boringssl_prefix_symbols.h:2632
vtable
static const struct tsi_test_fixture_vtable vtable
Definition: ssl_transport_security_test.cc:425
x509_st::references
CRYPTO_refcount_t references
Definition: third_party/boringssl-with-bazel/src/crypto/x509/internal.h:143
memory.h
kSessionTicketEncryptionKeySize
const size_t kSessionTicketEncryptionKeySize
Definition: ssl_transport_security_test.cc:56
ALPN_CLIENT_SERVER_MISMATCH
@ ALPN_CLIENT_SERVER_MISMATCH
Definition: ssl_transport_security_test.cc:67
ssl_tsi_test_do_handshake_alpn_server_no_client
void ssl_tsi_test_do_handshake_alpn_server_no_client()
Definition: ssl_transport_security_test.cc:644
tsi_ssl_client_handshaker_options::num_alpn_protocols
size_t num_alpn_protocols
Definition: ssl_transport_security.h:163
ssl_tsi_test_fixture
Definition: ssl_transport_security_test.cc:92
TSI_X509_DNS_PEER_PROPERTY
#define TSI_X509_DNS_PEER_PROPERTY
Definition: ssl_transport_security.h:45
TSI_OK
@ TSI_OK
Definition: transport_security_interface.h:32
string_util.h
tsi_ssl_handshaker_factory_swap_vtable
const tsi_ssl_handshaker_factory_vtable * tsi_ssl_handshaker_factory_swap_vtable(tsi_ssl_handshaker_factory *factory, tsi_ssl_handshaker_factory_vtable *new_vtable)
Definition: ssl_transport_security.cc:2408
BIO_new_mem_buf
#define BIO_new_mem_buf
Definition: boringssl_prefix_symbols.h:820
main
int main(int argc, char **argv)
Definition: ssl_transport_security_test.cc:1056
memcpy
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
TSI_TEST_SMALL_HANDSHAKE_BUFFER_SIZE
#define TSI_TEST_SMALL_HANDSHAKE_BUFFER_SIZE
Definition: transport_security_test_lib.h:27
test_tls_version
static tsi_tls_version test_tls_version
Definition: ssl_transport_security_test.cc:60
SSL_TSI_TEST_SERVER_KEY_CERT_PAIRS_NUM
#define SSL_TSI_TEST_SERVER_KEY_CERT_PAIRS_NUM
Definition: ssl_transport_security_test.cc:46
load_file
static char * load_file(const char *dir_path, const char *file_name)
Definition: ssl_transport_security_test.cc:429
ssl_test_pem_key_cert_pair_destroy
static void ssl_test_pem_key_cert_pair_destroy(tsi_ssl_pem_key_cert_pair kp)
Definition: ssl_transport_security_test.cc:374
ssl_tsi_test_do_handshake_with_wrong_server_name_indication
void ssl_tsi_test_do_handshake_with_wrong_server_name_indication()
Definition: ssl_transport_security_test.cc:600
tsi_ssl_session_cache_ref
void tsi_ssl_session_cache_ref(tsi_ssl_session_cache *cache)
Definition: ssl_transport_security.cc:1043
SSL_TSI_TEST_BAD_SERVER_KEY_CERT_PAIRS_NUM
#define SSL_TSI_TEST_BAD_SERVER_KEY_CERT_PAIRS_NUM
Definition: ssl_transport_security_test.cc:47
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
STACK_OF
#define STACK_OF(type)
Definition: stack.h:125
fixture
static const char fixture[]
Definition: test-fs-copyfile.c:36
tsi_ssl_peer_matches_name
int tsi_ssl_peer_matches_name(const tsi_peer *peer, absl::string_view name)
Definition: ssl_transport_security.cc:2368
check_client_peer
static void check_client_peer(ssl_tsi_test_fixture *ssl_fixture, tsi_peer *peer)
Definition: ssl_transport_security_test.cc:300
ssl_tsi_test_fixture::key_cert_lib
ssl_key_cert_lib * key_cert_lib
Definition: ssl_transport_security_test.cc:94
tsi_test_do_round_trip
void tsi_test_do_round_trip(tsi_test_fixture *fixture)
Definition: transport_security_test_lib.cc:459
TSI_TLS1_2
@ TSI_TLS1_2
Definition: transport_security_interface.h:90
TSI_X509_PEM_CERT_PROPERTY
#define TSI_X509_PEM_CERT_PROPERTY
Definition: ssl_transport_security.h:42
slice
grpc_slice slice
Definition: src/core/lib/surface/server.cc:467
gpr_log
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
setup.v
v
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:42
ssl_tsi_test_do_handshake_with_server_name_indication_exact_domain
void ssl_tsi_test_do_handshake_with_server_name_indication_exact_domain()
Definition: ssl_transport_security_test.cc:573
ssl_key_cert_lib::root_store
tsi_ssl_root_certs_store * root_store
Definition: ssl_transport_security_test.cc:83
PEM_X509_INFO_read_bio
#define PEM_X509_INFO_read_bio
Definition: boringssl_prefix_symbols.h:1913
ALPN_CLIENT_SERVER_OK
@ ALPN_CLIENT_SERVER_OK
Definition: ssl_transport_security_test.cc:66
ERR_peek_error
#define ERR_peek_error
Definition: boringssl_prefix_symbols.h:1428
grpc.h
tsi_tls_version
tsi_tls_version
Definition: transport_security_interface.h:89
security_connector.h
original_vtable
static const tsi_ssl_handshaker_factory_vtable * original_vtable
Definition: ssl_transport_security_test.cc:782
check_server1_peer
void check_server1_peer(tsi_peer *peer)
Definition: ssl_transport_security_test.cc:277
NO_ALPN
@ NO_ALPN
Definition: ssl_transport_security_test.cc:63
tsi_test_fixture::config
tsi_test_frame_protector_config * config
Definition: transport_security_test_lib.h:89
tsi_test_frame_protector_config_create
tsi_test_frame_protector_config * tsi_test_frame_protector_config_create(bool use_default_read_buffer_allocated_size, bool use_default_message_buffer_allocated_size, bool use_default_protected_buffer_size, bool use_default_client_message, bool use_default_server_message, bool use_default_client_max_output_protected_frame_size, bool use_default_server_max_output_protected_frame_size)
Definition: transport_security_test_lib.cc:503
err.h
crypto.h
X509_up_ref
OPENSSL_EXPORT int X509_up_ref(X509 *x509)
ssl_tsi_test_fixture::server_name_indication
char * server_name_indication
Definition: ssl_transport_security_test.cc:97
ssl_key_cert_lib::server_pem_key_cert_pairs
tsi_ssl_pem_key_cert_pair * server_pem_key_cert_pairs
Definition: ssl_transport_security_test.cc:84
grpc_slice
Definition: include/grpc/impl/codegen/slice.h:65
tsi_peer_property::data
char * data
Definition: transport_security_interface.h:233
tsi_ssl_server_handshaker_factory_create_handshaker
tsi_result tsi_ssl_server_handshaker_factory_create_handshaker(tsi_ssl_server_handshaker_factory *factory, size_t network_bio_buf_size, size_t ssl_bio_buf_size, tsi_handshaker **handshaker)
Definition: ssl_transport_security.cc:1813
ssl_tsi_test_do_handshake_alpn_client_server_mismatch
void ssl_tsi_test_do_handshake_alpn_client_server_mismatch()
Definition: ssl_transport_security_test.cc:654
tsi_peer_get_property_by_name
const tsi_peer_property * tsi_peer_get_property_by_name(const tsi_peer *peer, const char *name)
Definition: transport_security.cc:369
ssl_tsi_test_do_handshake_with_client_authentication_and_root_store
void ssl_tsi_test_do_handshake_with_client_authentication_and_root_store()
Definition: ssl_transport_security_test.cc:560
NID_rsa
#define NID_rsa
Definition: nid.h:178
ssl_test_check_handshaker_peers
static void ssl_test_check_handshaker_peers(tsi_test_fixture *fixture)
Definition: ssl_transport_security_test.cc:318
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
TSI_TEST_DEFAULT_BUFFER_SIZE
#define TSI_TEST_DEFAULT_BUFFER_SIZE
Definition: transport_security_test_lib.h:33
tsi_ssl_client_handshaker_options::session_cache
tsi_ssl_session_cache * session_cache
Definition: ssl_transport_security.h:165
tsi_test_fixture::vtable
const tsi_test_fixture_vtable * vtable
Definition: transport_security_test_lib.h:74
tsi_peer_property::name
char * name
Definition: transport_security_interface.h:231
check_property
static bool check_property(tsi_peer *peer, const char *property_name, const char *property_value)
Definition: ssl_transport_security_test.cc:263
tsi_test_do_handshake
void tsi_test_do_handshake(tsi_test_fixture *fixture)
Definition: transport_security_test_lib.cc:386
check_server0_peer
void check_server0_peer(tsi_peer *peer)
Definition: ssl_transport_security_test.cc:242
ssl_key_cert_lib
Definition: ssl_transport_security_test.cc:78
transport_security_interface.h
SSL_TSI_TEST_ALPN1
#define SSL_TSI_TEST_ALPN1
Definition: ssl_transport_security_test.cc:42
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
ssl_tsi_test_fixture::session_ticket_key
const char * session_ticket_key
Definition: ssl_transport_security_test.cc:100
TSI_TEST_NUM_OF_COMBINATIONS
#define TSI_TEST_NUM_OF_COMBINATIONS
Definition: transport_security_test_lib.h:39
ssl_tsi_test_fixture::base
tsi_test_fixture base
Definition: ssl_transport_security_test.cc:93
ssl_test_destruct
static void ssl_test_destruct(tsi_test_fixture *fixture)
Definition: ssl_transport_security_test.cc:379
tsi_ssl_handshaker_factory_vtable
Definition: ssl_transport_security.h:388
tsi_peer_property
Definition: transport_security_interface.h:230
test_config.h
ALPN_CLIENT_NO_SERVER
@ ALPN_CLIENT_NO_SERVER
Definition: ssl_transport_security_test.cc:64
tsi_ssl_server_handshaker_factory
Definition: ssl_transport_security.cc:102
TSI_TEST_TINY_HANDSHAKE_BUFFER_SIZE
#define TSI_TEST_TINY_HANDSHAKE_BUFFER_SIZE
Definition: transport_security_test_lib.h:26
grpc_slice_to_c_string
GPRAPI char * grpc_slice_to_c_string(grpc_slice s)
Definition: slice/slice.cc:35
grpc.beta.implementations.server_options
def server_options(multi_method_implementation=None, request_deserializers=None, response_serializers=None, thread_pool=None, thread_pool_size=None, default_timeout=None, maximum_timeout=None)
Definition: implementations.py:258
tsi_ssl_pem_key_cert_pair::private_key
const char * private_key
Definition: ssl_transport_security.h:104
BIO_free
#define BIO_free
Definition: boringssl_prefix_symbols.h:787
check_alpn
static void check_alpn(ssl_tsi_test_fixture *ssl_fixture, const tsi_peer *peer)
Definition: ssl_transport_security_test.cc:189
X509_info_st
Definition: x509.h:287
is_slow_build
static bool is_slow_build()
Definition: ssl_transport_security_test.cc:709
ssl_key_cert_lib::server_num_key_cert_pairs
uint16_t server_num_key_cert_pairs
Definition: ssl_transport_security_test.cc:88
TSI_SSL_SESSION_REUSED_PEER_PROPERTY
#define TSI_SSL_SESSION_REUSED_PEER_PROPERTY
Definition: ssl_transport_security.h:41
tsi_peer
Definition: transport_security_interface.h:238
transport_security.h
tsi_ssl_server_handshaker_factory_unref
void tsi_ssl_server_handshaker_factory_unref(tsi_ssl_server_handshaker_factory *factory)
Definition: ssl_transport_security.cc:1824
ssl_alpn_lib
Definition: ssl_transport_security_test.cc:70
x509_st
Definition: third_party/boringssl-with-bazel/src/crypto/x509/internal.h:139
tsi_ssl_session_cache
struct tsi_ssl_session_cache tsi_ssl_session_cache
Definition: ssl_transport_security.h:68
BuiltUnderMsan
bool BuiltUnderMsan()
Definition: build.cc:55
tsi_ssl_root_certs_store
Definition: ssl_transport_security.cc:84
ssl_tsi_test_do_round_trip_odd_buffer_size
void ssl_tsi_test_do_round_trip_odd_buffer_size()
Definition: ssl_transport_security_test.cc:717
alloc.h
tsi_test_fixture
Definition: transport_security_test_lib.h:73
ssl_tsi_test_fixture::alpn_lib
ssl_alpn_lib * alpn_lib
Definition: ssl_transport_security_test.cc:95
sk_X509_new_null
#define sk_X509_new_null
Definition: boringssl_prefix_symbols.h:586
tsi_ssl_extract_x509_subject_names_from_pem_cert
tsi_result tsi_ssl_extract_x509_subject_names_from_pem_cert(const char *pem_cert, tsi_peer *peer)
Definition: ssl_transport_security.cc:877
grpc::testing::TestEnvironment
Definition: test/core/util/test_config.h:54
ssl_test_setup_handshakers
static void ssl_test_setup_handshakers(tsi_test_fixture *fixture)
Definition: ssl_transport_security_test.cc:108
ssl_tsi_test_fixture::session_ticket_key_size
size_t session_ticket_key_size
Definition: ssl_transport_security_test.cc:101
ssl_tsi_test_do_handshake_tiny_handshake_buffer
void ssl_tsi_test_do_handshake_tiny_handshake_buffer()
Definition: ssl_transport_security_test.cc:514
test_handshaker_factory_vtable
static tsi_ssl_handshaker_factory_vtable test_handshaker_factory_vtable
Definition: ssl_transport_security_test.cc:794
TSI_INVALID_ARGUMENT
@ TSI_INVALID_ARGUMENT
Definition: transport_security_interface.h:34
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY
#define TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY
Definition: ssl_transport_security.h:38
ssl_tsi_test_do_handshake
void ssl_tsi_test_do_handshake()
Definition: ssl_transport_security_test.cc:533
AlpnMode
AlpnMode
Definition: ssl_transport_security_test.cc:62
check_session_reusage
static void check_session_reusage(ssl_tsi_test_fixture *ssl_fixture, tsi_peer *peer)
Definition: ssl_transport_security_test.cc:228
ssl_tsi_test_fixture::ssl_bio_buf_size
size_t ssl_bio_buf_size
Definition: ssl_transport_security_test.cc:103
ssl_tsi_test_do_handshake_with_root_store
void ssl_tsi_test_do_handshake_with_root_store()
Definition: ssl_transport_security_test.cc:540
BuiltUnderTsan
bool BuiltUnderTsan()
Definition: build.cc:23
ssl_tsi_test_fixture
struct ssl_tsi_test_fixture ssl_tsi_test_fixture
gpr_strdup
GPRAPI char * gpr_strdup(const char *src)
Definition: string.cc:39
ssl_tsi_test_do_handshake_alpn_client_no_server
void ssl_tsi_test_do_handshake_alpn_client_no_server()
Definition: ssl_transport_security_test.cc:634
tsi_ssl_client_handshaker_options
Definition: ssl_transport_security.h:137
X509_INFO_free
#define X509_INFO_free
Definition: boringssl_prefix_symbols.h:2345
tsi_test_fixture::server_result
tsi_handshaker_result * server_result
Definition: transport_security_test_lib.h:83
tsi_ssl_root_certs_store_create
tsi_ssl_root_certs_store * tsi_ssl_root_certs_store_create(const char *pem_roots)
Definition: ssl_transport_security.cc:1000
sk_X509_pop_free
#define sk_X509_pop_free
Definition: boringssl_prefix_symbols.h:588
tsi_ssl_root_certs_store_destroy
void tsi_ssl_root_certs_store_destroy(tsi_ssl_root_certs_store *self)
Definition: ssl_transport_security.cc:1029
tsi_test_fixture::client_handshaker
tsi_handshaker * client_handshaker
Definition: transport_security_test_lib.h:77
TSI_CERTIFICATE_TYPE_PEER_PROPERTY
#define TSI_CERTIFICATE_TYPE_PEER_PROPERTY
Definition: transport_security_interface.h:223
grpc_init
GRPCAPI void grpc_init(void)
Definition: init.cc:146
ssl_tsi_test_do_handshake_with_client_authentication
void ssl_tsi_test_do_handshake_with_client_authentication()
Definition: ssl_transport_security_test.cc:550
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
ssl_key_cert_lib::use_bad_client_cert
bool use_bad_client_cert
Definition: ssl_transport_security_test.cc:80
tsi_ssl_client_handshaker_options::min_tls_version
tsi_tls_version min_tls_version
Definition: ssl_transport_security.h:173
SSL_TSI_TEST_ALPN_NUM
#define SSL_TSI_TEST_ALPN_NUM
Definition: ssl_transport_security_test.cc:45
ssl_tsi_test_fixture::network_bio_buf_size
size_t network_bio_buf_size
Definition: ssl_transport_security_test.cc:102
SSL_TSI_TEST_CREDENTIALS_DIR
#define SSL_TSI_TEST_CREDENTIALS_DIR
Definition: ssl_transport_security_test.cc:48
ssl_tsi_test_do_handshake_with_custom_bio_pair
void ssl_tsi_test_do_handshake_with_custom_bio_pair()
Definition: ssl_transport_security_test.cc:1042
handshaker_factory_destructor_called
static bool handshaker_factory_destructor_called
Definition: ssl_transport_security_test.cc:783
tsi_ssl_handshaker_factory
Definition: ssl_transport_security.cc:88
TSI_X509_EMAIL_PEER_PROPERTY
#define TSI_X509_EMAIL_PEER_PROPERTY
Definition: ssl_transport_security.h:47
TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY
#define TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY
Definition: ssl_transport_security.h:39
tsi_peer_destruct
void tsi_peer_destruct(tsi_peer *self)
Definition: transport_security.cc:320
grpc_shutdown
GRPCAPI void grpc_shutdown(void)
Definition: init.cc:209
ssl_alpn_lib::server_alpn_protocols
const char ** server_alpn_protocols
Definition: ssl_transport_security_test.cc:72
ssl_tsi_test_do_round_trip_with_error_on_stack
void ssl_tsi_test_do_round_trip_with_error_on_stack()
Definition: ssl_transport_security_test.cc:698
tsi_ssl_client_handshaker_factory_create_handshaker
tsi_result tsi_ssl_client_handshaker_factory_create_handshaker(tsi_ssl_client_handshaker_factory *factory, const char *server_name_indication, size_t network_bio_buf_size, size_t ssl_bio_buf_size, tsi_handshaker **handshaker)
Definition: ssl_transport_security.cc:1774
ssl_tsi_test_do_handshake_session_cache
void ssl_tsi_test_do_handshake_session_cache()
Definition: ssl_transport_security_test.cc:749
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
check_security_level
static void check_security_level(const tsi_peer *peer)
Definition: ssl_transport_security_test.cc:206
tsi_peer::property_count
size_t property_count
Definition: transport_security_interface.h:240
ssl_key_cert_lib::client_pem_key_cert_pair
tsi_ssl_pem_key_cert_pair client_pem_key_cert_pair
Definition: ssl_transport_security_test.cc:86
tsi_ssl_session_cache_create_lru
tsi_ssl_session_cache * tsi_ssl_session_cache_create_lru(size_t capacity)
Definition: ssl_transport_security.cc:1037
ssl_tsi_test_extract_x509_subject_names
void ssl_tsi_test_extract_x509_subject_names()
Definition: ssl_transport_security_test.cc:915
tsi_ssl_client_handshaker_options::root_store
const tsi_ssl_root_certs_store * root_store
Definition: ssl_transport_security.h:149


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