aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session-apps
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-03-09 13:05:53 -0800
committerDave Barach <openvpp@barachs.net>2018-03-15 15:04:11 +0000
commit58d36f02b45c5af38b7df81fb7976129cad3e05b (patch)
tree84875ce654928ae2224b8c3a6a4d354f3fd13f7a /src/vnet/session-apps
parent46c1c11ba08512a5e37392de1ddb306b139a5bcf (diff)
tls: add openssl engine
Change-Id: I6c215858d2c9c620787632b570950b15274c0df2 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session-apps')
-rw-r--r--src/vnet/session-apps/echo_client.c6
-rw-r--r--src/vnet/session-apps/echo_client.h2
-rw-r--r--src/vnet/session-apps/echo_server.c6
3 files changed, 11 insertions, 3 deletions
diff --git a/src/vnet/session-apps/echo_client.c b/src/vnet/session-apps/echo_client.c
index 5b70d4906bc..2cfb471413c 100644
--- a/src/vnet/session-apps/echo_client.c
+++ b/src/vnet/session-apps/echo_client.c
@@ -458,8 +458,8 @@ echo_clients_attach (u8 * appns_id, u64 appns_flags, u64 appns_secret)
options[APP_OPTIONS_TX_FIFO_SIZE] = ecm->fifo_size;
options[APP_OPTIONS_PRIVATE_SEGMENT_COUNT] = ecm->private_segment_count;
options[APP_OPTIONS_PREALLOC_FIFO_PAIRS] = prealloc_fifos;
-
options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN;
+ options[APP_OPTIONS_TLS_ENGINE] = ecm->tls_engine;
if (appns_id)
{
options[APP_OPTIONS_FLAGS] |= appns_flags;
@@ -575,6 +575,8 @@ 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;
+
if (thread_main->n_vlib_mains > 1)
clib_spinlock_init (&ecm->sessions_lock);
vec_free (ecm->connect_uri);
@@ -632,6 +634,8 @@ echo_clients_command_fn (vlib_main_t * vm,
ecm->no_output = 1;
else if (unformat (input, "test-bytes"))
ecm->test_bytes = 1;
+ else if (unformat (input, "tls-engine %d", &ecm->tls_engine))
+ ;
else
return clib_error_return (0, "failed: unknown input `%U'",
format_unformat_error, input);
diff --git a/src/vnet/session-apps/echo_client.h b/src/vnet/session-apps/echo_client.h
index 4ae63ecee1f..5712da5b8c8 100644
--- a/src/vnet/session-apps/echo_client.h
+++ b/src/vnet/session-apps/echo_client.h
@@ -64,7 +64,7 @@ typedef struct
u32 connections_per_batch; /**< Connections to rx/tx at once */
u32 private_segment_count; /**< Number of private fifo segs */
u32 private_segment_size; /**< size of private fifo segs */
-
+ u32 tls_engine; /**< TLS engine mbedtls/openssl */
/*
* Test state variables
*/
diff --git a/src/vnet/session-apps/echo_server.c b/src/vnet/session-apps/echo_server.c
index 39d848f5d8c..9f34d4c0a5e 100644
--- a/src/vnet/session-apps/echo_server.c
+++ b/src/vnet/session-apps/echo_server.c
@@ -40,7 +40,7 @@ typedef struct
u32 private_segment_count; /**< Number of private segments */
u32 private_segment_size; /**< Size of private segments */
char *server_uri; /**< Server URI */
-
+ u32 tls_engine; /**< TLS engine: mbedtls/openssl */
/*
* Test state
*/
@@ -295,6 +295,7 @@ echo_server_attach (u8 * appns_id, u64 appns_flags, u64 appns_secret)
a->options[APP_OPTIONS_RX_FIFO_SIZE] = esm->fifo_size;
a->options[APP_OPTIONS_TX_FIFO_SIZE] = esm->fifo_size;
a->options[APP_OPTIONS_PRIVATE_SEGMENT_COUNT] = esm->private_segment_count;
+ a->options[APP_OPTIONS_TLS_ENGINE] = esm->tls_engine;
a->options[APP_OPTIONS_PREALLOC_FIFO_PAIRS] =
esm->prealloc_fifos ? esm->prealloc_fifos : 1;
@@ -408,6 +409,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;
vec_free (esm->server_uri);
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
@@ -446,6 +448,8 @@ echo_server_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
;
else if (unformat (input, "stop"))
is_stop = 1;
+ else if (unformat (input, "tls-engine %d", &esm->tls_engine))
+ ;
else
return clib_error_return (0, "failed: unknown input `%U'",
format_unformat_error, input);