1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-31 00:03:07 +03:00

tests: Cleanup OpenSSL in tests when GSSAPI is built

also from the fuzzer tests

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2025-06-19 19:08:34 +02:00
committed by Andreas Schneider
parent 62762bbbc9
commit 08a32ac381
5 changed files with 30 additions and 7 deletions

View File

@ -1,8 +1,14 @@
/* Simpler gnu89 version of StandaloneFuzzTargetMain.c from LLVM */
#include "config.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#if defined(HAVE_LIBCRYPTO) || defined(WITH_GSSAPI)
/* for OPENSSL_cleanup() of GSSAPI's OpenSSL context */
#include <openssl/crypto.h>
#endif
int LLVMFuzzerTestOneInput (const unsigned char *data, size_t size);
__attribute__((weak)) int LLVMFuzzerInitialize(int *argc, char ***argv);
@ -35,5 +41,9 @@ main (int argc, char **argv)
free (buf);
printf ("Done!\n");
#if defined(HAVE_LIBCRYPTO) || defined(WITH_GSSAPI)
OPENSSL_cleanup();
#endif
return 0;
}