aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/tsi/transport_security_test_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/tsi/transport_security_test_lib.h')
-rw-r--r--test/core/tsi/transport_security_test_lib.h21
1 files changed, 19 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..74f4378bc1 100644
--- a/test/core/tsi/transport_security_test_lib.h
+++ b/test/core/tsi/transport_security_test_lib.h
@@ -21,6 +21,12 @@
#include "src/core/tsi/transport_security_interface.h"
+#include <grpc/support/sync.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 +62,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 +101,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 +175,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_