diff options
author | Nathan Skrzypczak <nathan.skrzypczak@gmail.com> | 2019-11-12 16:41:00 +0100 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2019-11-26 19:12:32 +0000 |
commit | c298f3760228ad7846d40b6850a777ca5e5c5117 (patch) | |
tree | 9ec806ff6ec27a15af3836fb2c1e197d8dccc8b9 /src/plugins/hs_apps/echo_client.c | |
parent | be2ad0b4743ed8a3875a5b6039c10c66eb07614c (diff) |
quic: Refactor for crypto contexts
Type: refactor
Change-Id: I5ec7079d34826edd7a3048ae1d44037386f5d3ff
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins/hs_apps/echo_client.c')
-rw-r--r-- | src/plugins/hs_apps/echo_client.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/hs_apps/echo_client.c b/src/plugins/hs_apps/echo_client.c index ba9785cd547..128503279b7 100644 --- a/src/plugins/hs_apps/echo_client.c +++ b/src/plugins/hs_apps/echo_client.c @@ -630,6 +630,8 @@ static session_cb_vft_t echo_clients = { static clib_error_t * echo_clients_attach (u8 * appns_id, u64 appns_flags, u64 appns_secret) { + vnet_app_add_tls_cert_args_t _a_cert, *a_cert = &_a_cert; + vnet_app_add_tls_key_args_t _a_key, *a_key = &_a_key; u32 prealloc_fifos, segment_size = 256 << 20; echo_client_main_t *ecm = &echo_client_main; vnet_app_attach_args_t _a, *a = &_a; @@ -671,6 +673,18 @@ echo_clients_attach (u8 * appns_id, u64 appns_flags, u64 appns_secret) return clib_error_return (0, "attach returned %d", rv); ecm->app_index = a->app_index; + + clib_memset (a_cert, 0, sizeof (*a_cert)); + a_cert->app_index = a->app_index; + vec_validate (a_cert->cert, test_srv_crt_rsa_len); + clib_memcpy_fast (a_cert->cert, test_srv_crt_rsa, test_srv_crt_rsa_len); + vnet_app_add_tls_cert (a_cert); + + clib_memset (a_key, 0, sizeof (*a_key)); + a_key->app_index = a->app_index; + vec_validate (a_key->key, test_srv_key_rsa_len); + clib_memcpy_fast (a_key->key, test_srv_key_rsa, test_srv_key_rsa_len); + vnet_app_add_tls_key (a_key); return 0; } |