From 028859ce99acddc3c6ac405c0c9d52e0a010b87b Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Thu, 24 Jul 2025 19:19:51 +0200 Subject: [PATCH] pkd: Cleanup OpenSSL context Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider (cherry picked from commit 3df61a4e86d3e51037e88450512a048a7823f163) --- tests/pkd/CMakeLists.txt | 4 +--- tests/pkd/pkd_hello.c | 8 ++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/pkd/CMakeLists.txt b/tests/pkd/CMakeLists.txt index f5a62653..d921cd68 100644 --- a/tests/pkd/CMakeLists.txt +++ b/tests/pkd/CMakeLists.txt @@ -17,10 +17,8 @@ set(pkd_hello_src ) set(pkd_libs - ${CMOCKA_LIBRARY} - ssh::static + ${TORTURE_LINK_LIBRARIES} ${ARGP_LIBRARIES} - pthread ) add_executable(pkd_hello ${pkd_hello_src}) diff --git a/tests/pkd/pkd_hello.c b/tests/pkd/pkd_hello.c index 326201d0..ba57f3d3 100644 --- a/tests/pkd/pkd_hello.c +++ b/tests/pkd/pkd_hello.c @@ -22,6 +22,11 @@ #include "pkd_keyutil.h" #include "pkd_util.h" +#if defined(HAVE_LIBCRYPTO) +/* for OPENSSL_cleanup() of OpenSSL context */ +#include +#endif + #define DEFAULT_ITERATIONS 10 static struct pkd_daemon_args pkd_dargs; @@ -1000,6 +1005,9 @@ out_finalize: if (rc != 0) { fprintf(stderr, "ssh_finalize: %d\n", rc); } +#if defined(HAVE_LIBCRYPTO) + OPENSSL_cleanup(); +#endif out: return exit_code; }