aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
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
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')
-rw-r--r--src/vnet/session/application_interface.h12
-rw-r--r--src/vnet/tls/tls.c22
-rw-r--r--src/vnet/tls/tls.h2
3 files changed, 18 insertions, 18 deletions
diff --git a/src/vnet/session/application_interface.h b/src/vnet/session/application_interface.h
index fa6206a5279..17864029d6b 100644
--- a/src/vnet/session/application_interface.h
+++ b/src/vnet/session/application_interface.h
@@ -159,15 +159,15 @@ typedef struct _vnet_application_add_tls_key_args_t
u8 *key;
} vnet_app_add_tls_key_args_t;
-typedef enum tls_engine_type_
+typedef enum crypto_engine_type_
{
- TLS_ENGINE_NONE,
- TLS_ENGINE_MBEDTLS,
- TLS_ENGINE_OPENSSL,
+ CRYPTO_ENGINE_NONE,
+ CRYPTO_ENGINE_MBEDTLS,
+ CRYPTO_ENGINE_OPENSSL,
CRYPTO_ENGINE_VPP,
CRYPTO_ENGINE_PICOTLS,
- TLS_N_ENGINES
-} tls_engine_type_t;
+ CRYPTO_N_ENGINES
+} crypto_engine_type_t;
typedef struct _vnet_app_add_cert_key_pair_args_
{
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;
diff --git a/src/vnet/tls/tls.h b/src/vnet/tls/tls.h
index 8b1db9890cb..31572e8c463 100644
--- a/src/vnet/tls/tls.h
+++ b/src/vnet/tls/tls.h
@@ -119,7 +119,7 @@ typedef struct tls_engine_vft_
tls_main_t *vnet_tls_get_main (void);
void tls_register_engine (const tls_engine_vft_t * vft,
- tls_engine_type_t type);
+ crypto_engine_type_t type);
int tls_add_vpp_q_rx_evt (session_t * s);
int tls_add_vpp_q_tx_evt (session_t * s);
int tls_add_vpp_q_builtin_tx_evt (session_t * s);