From dd0a3f3af229c62957d6a223fcb91278c6b77650 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Fri, 28 Jul 2023 14:42:01 +0200 Subject: [PATCH] pkcs11_openssl: Disable unused code Coverity: CID 1539183 (#1 of 1): Structurally dead code (UNREACHABLE) Change-Id: I889de8bafb581b810a026c7359fbfee94f1b5a4e Gerrit: http://gerrit.openvpn.net/c/openvpn/+/317 Signed-off-by: Frank Lichtenheld Acked-by: Selva Nair Message-Id: <6b941ce86c4031a5535d6c1997e6ae06c9aec7b3-HTML@gerrit.openvpn.net> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26901.html Signed-off-by: Gert Doering (cherry picked from commit 38fbddc94596b6b2d8fa93a8bd0aca7dbb220def) --- src/openvpn/pkcs11_openssl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openvpn/pkcs11_openssl.c b/src/openvpn/pkcs11_openssl.c index 9b0ab39f9cf..57fa1371a53 100644 --- a/src/openvpn/pkcs11_openssl.c +++ b/src/openvpn/pkcs11_openssl.c @@ -333,8 +333,7 @@ pkcs11_init_tls_session(pkcs11h_certificate_t certificate, #ifdef HAVE_XKEY_PROVIDER return (xkey_load_from_pkcs11h(certificate, ssl_ctx) == 0); /* inverts the return value */ -#endif - +#else int ret = 1; X509 *x509 = NULL; @@ -404,6 +403,7 @@ pkcs11_init_tls_session(pkcs11h_certificate_t certificate, openssl_session = NULL; } return ret; +#endif /* ifdef HAVE_XKEY_PROVIDER */ } char *