diff --git a/tests/test_kem.c b/tests/test_kem.c index 3c6c70b70..9cf644aa9 100644 --- a/tests/test_kem.c +++ b/tests/test_kem.c @@ -9,6 +9,9 @@ #if OQS_USE_PTHREADS #include +# if OQS_USE_OPENSSL +#include +# endif #endif #ifdef OQS_ENABLE_TEST_CONSTANT_TIME @@ -206,6 +209,9 @@ struct thread_data { void *test_wrapper(void *arg) { struct thread_data *td = arg; td->rc = kem_test_correctness(td->alg_name); +#if defined(OQS_USE_OPENSSL) && !defined(OQS_DLOPEN_OPENSSL) + OPENSSL_thread_stop(); +#endif return NULL; } #endif diff --git a/tests/test_sig.c b/tests/test_sig.c index a5246cc9d..d4ed27e45 100644 --- a/tests/test_sig.c +++ b/tests/test_sig.c @@ -12,6 +12,9 @@ #if OQS_USE_PTHREADS #include +# if OQS_USE_OPENSSL +#include +# endif #endif #ifdef OQS_ENABLE_TEST_CONSTANT_TIME @@ -183,6 +186,9 @@ struct thread_data { void *test_wrapper(void *arg) { struct thread_data *td = arg; td->rc = sig_test_correctness(td->alg_name); +#if defined(OQS_USE_OPENSSL) && !defined(OQS_DLOPEN_OPENSSL) + OPENSSL_thread_stop(); +#endif return NULL; } #endif diff --git a/tests/test_sig_stfl.c b/tests/test_sig_stfl.c index f95e61369..ba8780213 100644 --- a/tests/test_sig_stfl.c +++ b/tests/test_sig_stfl.c @@ -22,7 +22,9 @@ #if OQS_USE_PTHREADS_IN_TESTS #include - +# if OQS_USE_OPENSSL +#include +# endif static pthread_mutex_t *test_sk_lock = NULL; static pthread_mutex_t *sk_lock = NULL; #endif @@ -990,6 +992,9 @@ void *test_query_key(void *arg) { struct lock_test_data *td = arg; printf("\n%s: Start Query Stateful Key info\n", __func__); td->rc = sig_stfl_test_query_key(td->alg_name); +#if defined(OQS_USE_OPENSSL) && !defined(OQS_DLOPEN_OPENSSL) + OPENSSL_thread_stop(); +#endif printf("%s: End Query Stateful Key info\n\n", __func__); return NULL; } @@ -998,6 +1003,9 @@ void *test_sig_gen(void *arg) { struct lock_test_data *td = arg; printf("\n%s: Start Generate Stateful Signature\n", __func__); td->rc = sig_stfl_test_sig_gen(td->alg_name); +#if defined(OQS_USE_OPENSSL) && !defined(OQS_DLOPEN_OPENSSL) + OPENSSL_thread_stop(); +#endif printf("%s: End Generate Stateful Signature\n\n", __func__); return NULL; } @@ -1006,6 +1014,9 @@ void *test_create_keys(void *arg) { struct lock_test_data *td = arg; printf("\n%s: Start Generate Keys\n", __func__); td->rc = sig_stfl_test_secret_key_lock(td->alg_name, td->katfile); +#if defined(OQS_USE_OPENSSL) && !defined(OQS_DLOPEN_OPENSSL) + OPENSSL_thread_stop(); +#endif printf("%s: End Generate Stateful Keys\n\n", __func__); return NULL; } @@ -1013,12 +1024,18 @@ void *test_create_keys(void *arg) { void *test_correctness_wrapper(void *arg) { struct thread_data *td = arg; td->rc = sig_stfl_test_correctness(td->alg_name, td->katfile); +#if defined(OQS_USE_OPENSSL) && !defined(OQS_DLOPEN_OPENSSL) + OPENSSL_thread_stop(); +#endif return NULL; } void *test_secret_key_wrapper(void *arg) { struct thread_data *td = arg; td->rc = sig_stfl_test_secret_key(td->alg_name, td->katfile); +#if defined(OQS_USE_OPENSSL) && !defined(OQS_DLOPEN_OPENSSL) + OPENSSL_thread_stop(); +#endif return NULL; } #endif