From: Florin Coras Date: Sun, 3 Aug 2025 23:11:03 +0000 (-0400) Subject: tls: fix coverity warning X-Git-Tag: v26.02-rc0~105 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F16%2F43516%2F2;p=vpp.git tls: fix coverity warning Type: fix Change-Id: I97e08e93b02271599e52462ab83767168a2eb1cb Signed-off-by: Florin Coras --- diff --git a/src/plugins/tlsopenssl/tls_openssl.c b/src/plugins/tlsopenssl/tls_openssl.c index 08ae12a1f18..3d0c52230fa 100644 --- a/src/plugins/tlsopenssl/tls_openssl.c +++ b/src/plugins/tlsopenssl/tls_openssl.c @@ -1067,19 +1067,18 @@ openssl_start_listen (tls_ctx_t * lctx) clib_warning ("unable to use SSL certificate"); goto err; } + rv = SSL_CTX_use_PrivateKey (ssl_ctx, cki->key); + if (rv != 1) + { + clib_warning ("unable to use SSL PrivateKey"); + goto err; + } } else { lctx->flags |= TLS_CONN_F_ASYNC_CERT; } - rv = SSL_CTX_use_PrivateKey (ssl_ctx, cki->key); - if (rv != 1) - { - clib_warning ("unable to use SSL PrivateKey"); - goto err; - } - if (lctx->alpn_list) SSL_CTX_set_alpn_select_cb (ssl_ctx, openssl_alpn_select_cb, (void *) lctx->alpn_list);