forked from wolfSSL/wolfssl
cleanup fp cache on examples with thread local storage
This commit is contained in:
@@ -250,6 +250,9 @@ int benchmark_test(void *args)
|
|||||||
#ifdef HAVE_ECC
|
#ifdef HAVE_ECC
|
||||||
bench_eccKeyGen();
|
bench_eccKeyGen();
|
||||||
bench_eccKeyAgree();
|
bench_eccKeyAgree();
|
||||||
|
#if defined(FP_ECC)
|
||||||
|
ecc_fp_free();
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -24,6 +24,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/settings.h>
|
#include <cyassl/ctaocrypt/settings.h>
|
||||||
|
#ifdef HAVE_ECC
|
||||||
|
#include <cyassl/ctaocrypt/ecc.h> /* ecc_fp_free */
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(CYASSL_MDK_ARM)
|
#if defined(CYASSL_MDK_ARM)
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -328,6 +331,11 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args)
|
|||||||
|
|
||||||
((func_args*)args)->return_code = 0;
|
((func_args*)args)->return_code = 0;
|
||||||
|
|
||||||
|
#if defined(NO_MAIN_DRIVER) && defined(HAVE_ECC) && defined(FP_ECC) \
|
||||||
|
&& defined(HAVE_THREAD_LS)
|
||||||
|
ecc_fp_free(); /* free per thread cache */
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CYASSL_TIRTOS
|
#ifdef CYASSL_TIRTOS
|
||||||
fdCloseSession(Task_self());
|
fdCloseSession(Task_self());
|
||||||
#endif
|
#endif
|
||||||
|
@@ -24,6 +24,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/settings.h>
|
#include <cyassl/ctaocrypt/settings.h>
|
||||||
|
#ifdef HAVE_ECC
|
||||||
|
#include <cyassl/ctaocrypt/ecc.h> /* ecc_fp_free */
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(CYASSL_TRACK_MEMORY) && !defined(NO_MAIN_DRIVER)
|
#if !defined(CYASSL_TRACK_MEMORY) && !defined(NO_MAIN_DRIVER)
|
||||||
/* in case memory tracker wants stats */
|
/* in case memory tracker wants stats */
|
||||||
@@ -536,10 +539,16 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
|
|||||||
CloseSocket(clientfd);
|
CloseSocket(clientfd);
|
||||||
((func_args*)args)->return_code = 0;
|
((func_args*)args)->return_code = 0;
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(NO_MAIN_DRIVER) && defined(HAVE_ECC) && defined(FP_ECC) \
|
||||||
|
&& defined(HAVE_THREAD_LS)
|
||||||
|
ecc_fp_free(); /* free per thread cache */
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef USE_CYASSL_MEMORY
|
#ifdef USE_CYASSL_MEMORY
|
||||||
if (trackMemory)
|
if (trackMemory)
|
||||||
ShowMemoryTracker();
|
ShowMemoryTracker();
|
||||||
#endif /* USE_CYASSL_MEMORY */
|
#endif
|
||||||
|
|
||||||
#ifdef CYASSL_TIRTOS
|
#ifdef CYASSL_TIRTOS
|
||||||
fdCloseSession(Task_self());
|
fdCloseSession(Task_self());
|
||||||
|
14
tests/api.c
14
tests/api.c
@@ -28,6 +28,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <cyassl/ctaocrypt/settings.h>
|
#include <cyassl/ctaocrypt/settings.h>
|
||||||
|
#ifdef HAVE_ECC
|
||||||
|
#include <cyassl/ctaocrypt/ecc.h> /* ecc_fp_free */
|
||||||
|
#endif
|
||||||
#include <cyassl/error-ssl.h>
|
#include <cyassl/error-ssl.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -402,6 +405,11 @@ done:
|
|||||||
fdCloseSession(Task_self());
|
fdCloseSession(Task_self());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(NO_MAIN_DRIVER) && defined(HAVE_ECC) && defined(FP_ECC) \
|
||||||
|
&& defined(HAVE_THREAD_LS)
|
||||||
|
ecc_fp_free(); /* free per thread cache */
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef CYASSL_TIRTOS
|
#ifndef CYASSL_TIRTOS
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
@@ -590,6 +598,12 @@ static THREAD_RETURN CYASSL_THREAD run_cyassl_server(void* args)
|
|||||||
#ifdef CYASSL_TIRTOS
|
#ifdef CYASSL_TIRTOS
|
||||||
fdCloseSession(Task_self());
|
fdCloseSession(Task_self());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(NO_MAIN_DRIVER) && defined(HAVE_ECC) && defined(FP_ECC) \
|
||||||
|
&& defined(HAVE_THREAD_LS)
|
||||||
|
ecc_fp_free(); /* free per thread cache */
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef CYASSL_TIRTOS
|
#ifndef CYASSL_TIRTOS
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
@@ -460,6 +460,7 @@ int SuiteTest(void)
|
|||||||
printf(" End Cipher Suite Tests\n");
|
printf(" End Cipher Suite Tests\n");
|
||||||
|
|
||||||
CyaSSL_CTX_free(cipherSuiteCtx);
|
CyaSSL_CTX_free(cipherSuiteCtx);
|
||||||
|
CyaSSL_Cleanup();
|
||||||
|
|
||||||
return args.return_code;
|
return args.return_code;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user