summaryrefslogtreecommitdiffstats
path: root/src/vnet/tls/tls.c
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2019-09-13 10:20:15 +0200
committerFlorin Coras <florin.coras@gmail.com>2019-10-09 01:11:11 +0000
commit82fc5fd447ec2b140f1d6a8641106361176f1b80 (patch)
tree5d3db8efde8dd0330df90a64e4f165364ad34ef6 /src/vnet/tls/tls.c
parent79f89537c6fd3baeac03354a3381f42895fe2ca8 (diff)
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 <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/vnet/tls/tls.c')
-rw-r--r--src/vnet/tls/tls.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index c512517f9e5..304819007d5 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -38,7 +38,7 @@ tls_disconnect_transport (tls_ctx_t * ctx)
clib_warning ("disconnect returned");
}
-tls_engine_type_t
+crypto_engine_type_t
tls_get_available_engine (void)
{
int i;
@@ -47,7 +47,7 @@ tls_get_available_engine (void)
if (tls_vfts[i].ctx_alloc)
return i;
}
- return TLS_ENGINE_NONE;
+ return CRYPTO_ENGINE_NONE;
}
int
@@ -274,8 +274,8 @@ tls_ctx_parse_handle (u32 ctx_handle, u32 * ctx_index, u32 * engine_type)
*engine_type = ctx_handle >> TLS_ENGINE_TYPE_SHIFT;
}
-static inline tls_engine_type_t
-tls_get_engine_type (tls_engine_type_t preferred)
+static inline crypto_engine_type_t
+tls_get_engine_type (crypto_engine_type_t preferred)
{
if (!tls_vfts[preferred].ctx_alloc)
return tls_get_available_engine ();
@@ -283,7 +283,7 @@ tls_get_engine_type (tls_engine_type_t preferred)
}
static inline u32
-tls_ctx_alloc (tls_engine_type_t engine_type)
+tls_ctx_alloc (crypto_engine_type_t engine_type)
{
u32 ctx_index;
ctx_index = tls_vfts[engine_type].ctx_alloc ();
@@ -522,7 +522,7 @@ tls_connect (transport_endpoint_cfg_t * tep)
{
vnet_connect_args_t _cargs = { {}, }, *cargs = &_cargs;
session_endpoint_cfg_t *sep;
- tls_engine_type_t engine_type;
+ crypto_engine_type_t engine_type;
tls_main_t *tm = &tls_main;
app_worker_t *app_wrk;
application_t *app;
@@ -534,7 +534,7 @@ tls_connect (transport_endpoint_cfg_t * tep)
app_wrk = app_worker_get (sep->app_wrk_index);
app = application_get (app_wrk->app_index);
engine_type = tls_get_engine_type (app->tls_engine);
- if (engine_type == TLS_ENGINE_NONE)
+ if (engine_type == CRYPTO_ENGINE_NONE)
{
clib_warning ("No tls engine_type available");
return -1;
@@ -588,7 +588,7 @@ tls_start_listen (u32 app_listener_index, transport_endpoint_t * tep)
session_endpoint_cfg_t *sep;
session_t *tls_listener;
session_t *app_listener;
- tls_engine_type_t engine_type;
+ crypto_engine_type_t engine_type;
application_t *app;
app_listener_t *al;
tls_ctx_t *lctx;
@@ -598,7 +598,7 @@ tls_start_listen (u32 app_listener_index, transport_endpoint_t * tep)
app_wrk = app_worker_get (sep->app_wrk_index);
app = application_get (app_wrk->app_index);
engine_type = tls_get_engine_type (app->tls_engine);
- if (engine_type == TLS_ENGINE_NONE)
+ if (engine_type == CRYPTO_ENGINE_NONE)
{
clib_warning ("No tls engine_type available");
return -1;
@@ -649,7 +649,7 @@ tls_start_listen (u32 app_listener_index, transport_endpoint_t * tep)
u32
tls_stop_listen (u32 lctx_index)
{
- tls_engine_type_t engine_type;
+ crypto_engine_type_t engine_type;
tls_ctx_t *lctx;
int rv;
@@ -817,7 +817,7 @@ static const transport_proto_vft_t tls_proto = {
/* *INDENT-ON* */
void
-tls_register_engine (const tls_engine_vft_t * vft, tls_engine_type_t type)
+tls_register_engine (const tls_engine_vft_t * vft, crypto_engine_type_t type)
{
vec_validate (tls_vfts, type);
tls_vfts[type] = *vft;