diff options
author | Florin Coras <fcoras@cisco.com> | 2019-02-18 20:14:20 -0800 |
---|---|---|
committer | Florin Coras <fcoras@cisco.com> | 2019-02-18 20:43:29 -0800 |
commit | df57ea0a3e20ee45b72dcd01839979e5952f331d (patch) | |
tree | 64aa9a02184a7fe54ec6deeb4f37b3d5479707a2 /src/plugins | |
parent | a27a46eaebee7b1d84a6ce998d9c92048b0654b6 (diff) |
tls: fix openssl/mbedtls use of app_wrk index
Change-Id: I7ccc948357d815a1bd4279a7079cf4db2949183c
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/tlsmbedtls/tls_mbedtls.c | 9 | ||||
-rw-r--r-- | src/plugins/tlsopenssl/tls_openssl.c | 9 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/plugins/tlsmbedtls/tls_mbedtls.c b/src/plugins/tlsmbedtls/tls_mbedtls.c index 93beebe418c..e1262981cc2 100644 --- a/src/plugins/tlsmbedtls/tls_mbedtls.c +++ b/src/plugins/tlsmbedtls/tls_mbedtls.c @@ -275,6 +275,7 @@ mbedtls_ctx_init_server (tls_ctx_t * ctx) { mbedtls_ctx_t *mc = (mbedtls_ctx_t *) ctx; mbedtls_main_t *mm = &mbedtls_main; + app_worker_t *app_wrk; application_t *app; void *ctx_ptr; int rv; @@ -287,11 +288,15 @@ mbedtls_ctx_init_server (tls_ctx_t * ctx) /* * 1. Cert */ - app = application_get (ctx->parent_app_index); + app_wrk = app_worker_get (ctx->parent_app_wrk_index); + if (!app_wrk) + return -1; + + app = application_get (app_wrk->app_index); if (!app->tls_cert || !app->tls_key) { TLS_DBG (1, " failed\n ! tls cert and/or key not configured %d", - ctx->parent_app_index); + ctx->parent_app_wrk_index); return -1; } diff --git a/src/plugins/tlsopenssl/tls_openssl.c b/src/plugins/tlsopenssl/tls_openssl.c index 0a25ecfa943..e41d50a2b8b 100644 --- a/src/plugins/tlsopenssl/tls_openssl.c +++ b/src/plugins/tlsopenssl/tls_openssl.c @@ -562,15 +562,20 @@ openssl_start_listen (tls_ctx_t * lctx) EVP_PKEY *pkey; u32 olc_index; openssl_listen_ctx_t *olc; + app_worker_t *app_wrk; long flags = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_COMPRESSION; openssl_main_t *om = &openssl_main; - app = application_get (lctx->parent_app_index); + app_wrk = app_worker_get (lctx->parent_app_wrk_index); + if (!app_wrk) + return -1; + + app = application_get (app_wrk->app_index); if (!app->tls_cert || !app->tls_key) { TLS_DBG (1, "tls cert and/or key not configured %d", - lctx->parent_app_index); + lctx->parent_app_wrk_index); return -1; } |