aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-10-20 19:55:56 -0700
committerDave Wallace <dwallacelf@gmail.com>2019-10-22 16:58:43 +0000
commitd747c3c36242ef4ebcbfd4cf3657ad8e70ba62d5 (patch)
tree09a203b34d6afc556f1dfbb7cb5a49fb4cf463cd /src
parent91af1859da0313d48fb152999a74a34cf384b490 (diff)
vcl: add config option for preferred tls engine
Type: feature Change-Id: If6c095c9b737cb524a9232dcfa9be0f93f04d114 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vcl/vcl_bapi.c5
-rw-r--r--src/vcl/vcl_cfg.c6
-rw-r--r--src/vcl/vcl_private.h1
3 files changed, 11 insertions, 1 deletions
diff --git a/src/vcl/vcl_bapi.c b/src/vcl/vcl_bapi.c
index 7e745c1da90..be7ce6b4c50 100644
--- a/src/vcl/vcl_bapi.c
+++ b/src/vcl/vcl_bapi.c
@@ -360,11 +360,14 @@ void
vppcom_app_send_attach (void)
{
vcl_worker_t *wrk = vcl_worker_get_current ();
+ u8 tls_engine = CRYPTO_ENGINE_OPENSSL;
vl_api_app_attach_t *bmp;
u8 nsid_len = vec_len (vcm->cfg.namespace_id);
u8 app_is_proxy = (vcm->cfg.app_proxy_transport_tcp ||
vcm->cfg.app_proxy_transport_udp);
+ tls_engine = vcm->cfg.tls_engine ? vcm->cfg.tls_engine : tls_engine;
+
bmp = vl_msg_api_alloc (sizeof (*bmp));
memset (bmp, 0, sizeof (*bmp));
@@ -387,7 +390,7 @@ vppcom_app_send_attach (void)
bmp->options[APP_OPTIONS_PREALLOC_FIFO_PAIRS] =
vcm->cfg.preallocated_fifo_pairs;
bmp->options[APP_OPTIONS_EVT_QUEUE_SIZE] = vcm->cfg.event_queue_size;
- bmp->options[APP_OPTIONS_TLS_ENGINE] = CRYPTO_ENGINE_OPENSSL;
+ bmp->options[APP_OPTIONS_TLS_ENGINE] = tls_engine;
if (nsid_len)
{
bmp->namespace_id_len = nsid_len;
diff --git a/src/vcl/vcl_cfg.c b/src/vcl/vcl_cfg.c
index 21fa0fad2b0..cce60ba634f 100644
--- a/src/vcl/vcl_cfg.c
+++ b/src/vcl/vcl_cfg.c
@@ -499,6 +499,12 @@ vppcom_cfg_read_file (char *conf_fname)
VCFG_DBG (0, "VCL<%d>: configured with mq with eventfd",
getpid ());
}
+ else if (unformat (line_input, "tls-engine %u",
+ &vcl_cfg->tls_engine))
+ {
+ VCFG_DBG (0, "VCL<%d>: configured tls-engine %u (0x%x)",
+ getpid (), vcl_cfg->tls_engine, vcl_cfg->tls_engine);
+ }
else if (unformat (line_input, "}"))
{
vc_cfg_input = 0;
diff --git a/src/vcl/vcl_private.h b/src/vcl/vcl_private.h
index 7746862da60..8fdf7551cf3 100644
--- a/src/vcl/vcl_private.h
+++ b/src/vcl/vcl_private.h
@@ -211,6 +211,7 @@ typedef struct vppcom_cfg_t_
char *event_log_path;
u8 *vpp_api_filename;
u8 *vpp_api_socket_name;
+ u32 tls_engine;
} vppcom_cfg_t;
void vppcom_cfg (vppcom_cfg_t * vcl_cfg);