diff options
author | Florin Coras <fcoras@cisco.com> | 2021-01-05 17:03:29 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2021-01-07 16:55:02 +0000 |
commit | a5a9efd4d1995ef6d46dfab4e5b8aba9c5d114ef (patch) | |
tree | 63db95ce5645cafed795284bd3138535f9605c65 /src/vnet/session/session_api.c | |
parent | e294de6f876587ddc34ab02771771aea60087adc (diff) |
vcl session: switch to generic cert key apis
Remove the deprecated tls apis.
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia1e12bd813671146f0aca22e83d04c23ac13e595
Diffstat (limited to 'src/vnet/session/session_api.c')
-rw-r--r-- | src/vnet/session/session_api.c | 79 |
1 files changed, 4 insertions, 75 deletions
diff --git a/src/vnet/session/session_api.c b/src/vnet/session/session_api.c index 2073a15af64..2e215f76051 100644 --- a/src/vnet/session/session_api.c +++ b/src/vnet/session/session_api.c @@ -49,8 +49,6 @@ _(SESSION_ENABLE_DISABLE, session_enable_disable) \ _(APP_NAMESPACE_ADD_DEL, app_namespace_add_del) \ _(SESSION_RULE_ADD_DEL, session_rule_add_del) \ _(SESSION_RULES_DUMP, session_rules_dump) \ -_(APPLICATION_TLS_CERT_ADD, application_tls_cert_add) \ -_(APPLICATION_TLS_KEY_ADD, application_tls_key_add) \ _(APP_ADD_CERT_KEY_PAIR, app_add_cert_key_pair) \ _(APP_DEL_CERT_KEY_PAIR, app_del_cert_key_pair) \ _(APP_WORKER_ADD_DEL, app_worker_add_del) \ @@ -1065,13 +1063,11 @@ vl_api_app_add_cert_key_pair_t_handler (vl_api_app_add_cert_key_pair_t * mp) } clib_memset (a, 0, sizeof (*a)); - vec_validate (a->cert, cert_len); - vec_validate (a->key, key_len); - clib_memcpy_fast (a->cert, mp->certkey, cert_len); - clib_memcpy_fast (a->key, mp->certkey + cert_len, key_len); + a->cert = mp->certkey; + a->key = mp->certkey + cert_len; + a->cert_len = cert_len; + a->key_len = key_len; rv = vnet_app_add_cert_key_pair (a); - vec_free (a->cert); - vec_free (a->key); done: /* *INDENT-OFF* */ @@ -1100,73 +1096,6 @@ done: REPLY_MACRO (VL_API_APP_DEL_CERT_KEY_PAIR_REPLY); } -/* ### WILL BE DEPRECATED POST 20.01 ### */ -static void -vl_api_application_tls_cert_add_t_handler (vl_api_application_tls_cert_add_t * - mp) -{ - vl_api_application_tls_cert_add_reply_t *rmp; - app_cert_key_pair_t *ckpair; - application_t *app; - u32 cert_len; - int rv = 0; - if (session_main_is_enabled () == 0) - { - rv = VNET_API_ERROR_FEATURE_DISABLED; - goto done; - } - if (!(app = application_lookup (mp->client_index))) - { - rv = VNET_API_ERROR_APPLICATION_NOT_ATTACHED; - goto done; - } - cert_len = clib_net_to_host_u16 (mp->cert_len); - if (cert_len > 10000) - { - rv = VNET_API_ERROR_INVALID_VALUE; - goto done; - } - ckpair = app_cert_key_pair_get_default (); - vec_validate (ckpair->cert, cert_len); - clib_memcpy_fast (ckpair->cert, mp->cert, cert_len); - -done: - REPLY_MACRO (VL_API_APPLICATION_TLS_CERT_ADD_REPLY); -} - -/* ### WILL BE DEPRECATED POST 20.01 ### */ -static void -vl_api_application_tls_key_add_t_handler (vl_api_application_tls_key_add_t * - mp) -{ - vl_api_application_tls_key_add_reply_t *rmp; - app_cert_key_pair_t *ckpair; - application_t *app; - u32 key_len; - int rv = 0; - if (session_main_is_enabled () == 0) - { - rv = VNET_API_ERROR_FEATURE_DISABLED; - goto done; - } - if (!(app = application_lookup (mp->client_index))) - { - rv = VNET_API_ERROR_APPLICATION_NOT_ATTACHED; - goto done; - } - key_len = clib_net_to_host_u16 (mp->key_len); - if (key_len > 10000) - { - rv = VNET_API_ERROR_INVALID_VALUE; - goto done; - } - ckpair = app_cert_key_pair_get_default (); - vec_validate (ckpair->key, key_len); - clib_memcpy_fast (ckpair->key, mp->key, key_len); -done: - REPLY_MACRO (VL_API_APPLICATION_TLS_KEY_ADD_REPLY); -} - static clib_error_t * application_reaper_cb (u32 client_index) { |