From 82fc5fd447ec2b140f1d6a8641106361176f1b80 Mon Sep 17 00:00:00 2001 From: Nathan Skrzypczak Date: Fri, 13 Sep 2019 10:20:15 +0200 Subject: hsa: use crypto_engine_type_t for TLS Type: refactor This patch does the following conversions TLS_ENGINE_X -> CRYPTO_ENGINE_X tls_engine_type_t -> crypto_engine_t It does not change numbering of engines Change-Id: I872dfaec3a6713bf4229c84d1ffd98b8b2419995 Signed-off-by: Nathan Skrzypczak --- src/plugins/hs_apps/echo_client.c | 2 +- src/plugins/hs_apps/echo_server.c | 2 +- src/plugins/hs_apps/sapi/vpp_echo.c | 4 ++-- src/plugins/hs_apps/sapi/vpp_echo_common.c | 8 ++++---- src/plugins/hs_apps/sapi/vpp_echo_proto_quic.c | 2 +- src/plugins/hs_apps/sapi/vpp_echo_proto_tcp.c | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/plugins/hs_apps') diff --git a/src/plugins/hs_apps/echo_client.c b/src/plugins/hs_apps/echo_client.c index 076fca22deb..0f8d9c5f748 100644 --- a/src/plugins/hs_apps/echo_client.c +++ b/src/plugins/hs_apps/echo_client.c @@ -775,7 +775,7 @@ echo_clients_command_fn (vlib_main_t * vm, ecm->test_bytes = 0; ecm->test_failed = 0; ecm->vlib_main = vm; - ecm->tls_engine = TLS_ENGINE_OPENSSL; + ecm->tls_engine = CRYPTO_ENGINE_OPENSSL; ecm->no_copy = 0; ecm->run_test = ECHO_CLIENTS_STARTING; diff --git a/src/plugins/hs_apps/echo_server.c b/src/plugins/hs_apps/echo_server.c index b7a74818cca..dc15185c75b 100644 --- a/src/plugins/hs_apps/echo_server.c +++ b/src/plugins/hs_apps/echo_server.c @@ -471,7 +471,7 @@ echo_server_create_command_fn (vlib_main_t * vm, unformat_input_t * input, esm->prealloc_fifos = 0; esm->private_segment_count = 0; esm->private_segment_size = 0; - esm->tls_engine = TLS_ENGINE_OPENSSL; + esm->tls_engine = CRYPTO_ENGINE_OPENSSL; vec_free (esm->server_uri); while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) diff --git a/src/plugins/hs_apps/sapi/vpp_echo.c b/src/plugins/hs_apps/sapi/vpp_echo.c index 085b0fe6083..4392168aff2 100644 --- a/src/plugins/hs_apps/sapi/vpp_echo.c +++ b/src/plugins/hs_apps/sapi/vpp_echo.c @@ -1100,7 +1100,7 @@ main (int argc, char **argv) em->tx_buf_size = 1 << 20; em->data_source = ECHO_INVALID_DATA_SOURCE; em->uri = format (0, "%s%c", "tcp://0.0.0.0/1234", 0); - em->crypto_ctx_engine = TLS_ENGINE_NONE; + em->crypto_ctx_engine = CRYPTO_ENGINE_NONE; echo_set_each_proto_defaults_before_opts (em); echo_process_opts (argc, argv); echo_process_uri (em); @@ -1161,7 +1161,7 @@ main (int argc, char **argv) goto exit_on_error; } - if (em->crypto_ctx_engine == TLS_ENGINE_NONE) + if (em->crypto_ctx_engine == CRYPTO_ENGINE_NONE) /* when no crypto engine specified, dont expect crypto ctx */ em->state = STATE_ATTACHED; else diff --git a/src/plugins/hs_apps/sapi/vpp_echo_common.c b/src/plugins/hs_apps/sapi/vpp_echo_common.c index dbe8d92661f..06ce45c66c9 100644 --- a/src/plugins/hs_apps/sapi/vpp_echo_common.c +++ b/src/plugins/hs_apps/sapi/vpp_echo_common.c @@ -487,9 +487,9 @@ u8 * echo_format_crypto_engine (u8 * s, va_list * args) { u32 state = va_arg (*args, u32); - if (state == TLS_ENGINE_MBEDTLS) + if (state == CRYPTO_ENGINE_MBEDTLS) return format (s, "mbedtls"); - if (state == TLS_ENGINE_OPENSSL) + if (state == CRYPTO_ENGINE_OPENSSL) return format (s, "openssl"); if (state == CRYPTO_ENGINE_PICOTLS) return format (s, "picotls"); @@ -504,9 +504,9 @@ echo_unformat_crypto_engine (unformat_input_t * input, va_list * args) { u8 *a = va_arg (*args, u8 *); if (unformat (input, "mbedtls")) - *a = TLS_ENGINE_MBEDTLS; + *a = CRYPTO_ENGINE_MBEDTLS; else if (unformat (input, "openssl")) - *a = TLS_ENGINE_OPENSSL; + *a = CRYPTO_ENGINE_OPENSSL; else if (unformat (input, "picotls")) *a = CRYPTO_ENGINE_PICOTLS; else if (unformat (input, "vpp")) diff --git a/src/plugins/hs_apps/sapi/vpp_echo_proto_quic.c b/src/plugins/hs_apps/sapi/vpp_echo_proto_quic.c index a78f949a0ef..78cedbb2c6f 100644 --- a/src/plugins/hs_apps/sapi/vpp_echo_proto_quic.c +++ b/src/plugins/hs_apps/sapi/vpp_echo_proto_quic.c @@ -462,7 +462,7 @@ quic_echo_set_defaults_after_opts_cb () echo_main_t *em = &echo_main; u8 default_f_active; - if (em->crypto_ctx_engine == TLS_ENGINE_NONE) + if (em->crypto_ctx_engine == CRYPTO_ENGINE_NONE) em->crypto_ctx_engine = CRYPTO_ENGINE_PICOTLS; em->n_connects = em->n_clients; em->n_sessions = diff --git a/src/plugins/hs_apps/sapi/vpp_echo_proto_tcp.c b/src/plugins/hs_apps/sapi/vpp_echo_proto_tcp.c index 0854d489a41..5cb3fa667e8 100644 --- a/src/plugins/hs_apps/sapi/vpp_echo_proto_tcp.c +++ b/src/plugins/hs_apps/sapi/vpp_echo_proto_tcp.c @@ -126,8 +126,8 @@ static void tls_echo_set_defaults_after_opts_cb () { echo_main_t *em = &echo_main; - if (em->crypto_ctx_engine == TLS_ENGINE_NONE) - em->crypto_ctx_engine = TLS_ENGINE_OPENSSL; + if (em->crypto_ctx_engine == CRYPTO_ENGINE_NONE) + em->crypto_ctx_engine = CRYPTO_ENGINE_OPENSSL; } echo_proto_cb_vft_t echo_tcp_proto_cb_vft = { -- cgit 1.2.3-korg