pkd: Cleanup OpenSSL context

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 3df61a4e86)
This commit is contained in:
Jakub Jelen
2025-07-24 19:19:51 +02:00
parent d64f06f98a
commit 028859ce99
2 changed files with 9 additions and 3 deletions

View File

@@ -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})

View File

@@ -22,6 +22,11 @@
#include "pkd_keyutil.h"
#include "pkd_util.h"
#if defined(HAVE_LIBCRYPTO)
/* for OPENSSL_cleanup() of OpenSSL context */
#include <openssl/crypto.h>
#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;
}