aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/tsi/transport_security_test_lib.h
diff options
context:
space:
mode:
authorGravatar Yihua Zhang <yihuaz@google.com>2017-09-15 08:46:54 -0700
committerGravatar Yihua Zhang <yihuaz@google.com>2017-09-15 08:46:54 -0700
commit993fa31e669dcf8432e84c3c2a83b11bf9e68b5e (patch)
tree0bbbdfcc2e0c7d3be62a98c62905d54f98d15563 /test/core/tsi/transport_security_test_lib.h
parentc3aba91be94d336a27f945a644233bc244f22e2b (diff)
update tsi test library to support async tsi implementation
Diffstat (limited to 'test/core/tsi/transport_security_test_lib.h')
-rw-r--r--test/core/tsi/transport_security_test_lib.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/core/tsi/transport_security_test_lib.h b/test/core/tsi/transport_security_test_lib.h
index 8ae2024ee4..ed8ff856df 100644
--- a/test/core/tsi/transport_security_test_lib.h
+++ b/test/core/tsi/transport_security_test_lib.h
@@ -21,6 +21,10 @@
#include "src/core/tsi/transport_security_interface.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define TSI_TEST_TINY_HANDSHAKE_BUFFER_SIZE 32
#define TSI_TEST_SMALL_HANDSHAKE_BUFFER_SIZE 128
#define TSI_TEST_SMALL_READ_BUFFER_ALLOCATED_SIZE 41
@@ -56,10 +60,10 @@ typedef struct tsi_test_fixture_vtable {
void (*setup_handshakers)(tsi_test_fixture *fixture);
void (*check_handshaker_peers)(tsi_test_fixture *fixture);
void (*destruct)(tsi_test_fixture *fixture);
-} tranport_security_test_vtable;
+} tsi_test_fixture_vtable;
struct tsi_test_fixture {
- const struct tsi_test_fixture_vtable *vtable;
+ const tsi_test_fixture_vtable *vtable;
/* client/server TSI handshaker used to perform TSI handshakes, and will get
instantiated during the call to setup_handshakers. */
tsi_handshaker *client_handshaker;
@@ -95,6 +99,13 @@ struct tsi_test_fixture {
(https://github.com/grpc/grpc/issues/12164).
*/
bool test_unused_bytes;
+ /* These objects will be used coordinate client/server handshakers with TSI
+ thread to perform TSI handshakes in an asynchronous manner (for GTS TSI
+ implementations).
+ */
+ gpr_cv cv;
+ gpr_mu mu;
+ bool notified;
};
struct tsi_test_frame_protector_config {
@@ -162,4 +173,8 @@ void tsi_test_do_handshake(tsi_test_fixture *fixture);
the client and server switching its role. */
void tsi_test_do_round_trip(tsi_test_fixture *fixture);
+#ifdef __cplusplus
+}
+#endif
+
#endif // GRPC_TEST_CORE_TSI_TRANSPORT_SECURITY_TEST_LIB_H_