Fix mutex to use single count for semaphore so behavior is like mutex. Fix typo with “received”. Fix for mp_clear with fast math to do null check on arg (noticed null with ecc make key benchmark with wc_ecc_free).

This commit is contained in:
David Garske
2017-04-27 13:09:11 -07:00
parent 4363cf8a5c
commit a4efaf5eaa
5 changed files with 5 additions and 9 deletions

View File

@@ -148,7 +148,7 @@ Client connected successfully
Using Non-Blocking I/O: 0 Using Non-Blocking I/O: 0
Message for server: Client: Message for server: Client:
Recieved: I hear ya fa shizzle! Received: I hear ya fa shizzle!
The client has closed the connection. The client has closed the connection.
``` ```

View File

@@ -13,9 +13,6 @@ extern "C" {
#undef INTIME_RTOS #undef INTIME_RTOS
#define INTIME_RTOS #define INTIME_RTOS
#undef INTIME_RTOS_MUTEX_MAX
#define INTIME_RTOS_MUTEX_MAX 10
#undef WOLF_EXAMPLES_STACK #undef WOLF_EXAMPLES_STACK
#define WOLF_EXAMPLES_STACK 65536 #define WOLF_EXAMPLES_STACK 65536

View File

@@ -122,7 +122,7 @@ int wolfExample_TLSClient(const char* ip, int port)
printf("Read error. Error: %d\n", ret); printf("Read error. Error: %d\n", ret);
goto exit; goto exit;
} }
printf("Recieved: \t%s\n", rcvBuff); printf("Received: \t%s\n", rcvBuff);
} }
exit: exit:

View File

@@ -2283,6 +2283,8 @@ void fp_free(fp_int* a)
/* clear one (frees) */ /* clear one (frees) */
void mp_clear (mp_int * a) void mp_clear (mp_int * a)
{ {
if (a == NULL)
return;
fp_clear(a); fp_clear(a);
} }

View File

@@ -1012,9 +1012,6 @@ int wolfSSL_CryptHwMutexUnLock(void) {
} }
#elif defined(INTIME_RTOS) #elif defined(INTIME_RTOS)
#ifndef INTIME_RTOS_MUTEX_MAX
#define INTIME_RTOS_MUTEX_MAX 10
#endif
int wc_InitMutex(wolfSSL_Mutex* m) int wc_InitMutex(wolfSSL_Mutex* m)
{ {
@@ -1025,7 +1022,7 @@ int wolfSSL_CryptHwMutexUnLock(void) {
*m = CreateRtSemaphore( *m = CreateRtSemaphore(
1, /* initial unit count */ 1, /* initial unit count */
INTIME_RTOS_MUTEX_MAX, /* maximum unit count */ 1, /* maximum unit count */
PRIORITY_QUEUING /* creation flags: FIFO_QUEUING or PRIORITY_QUEUING */ PRIORITY_QUEUING /* creation flags: FIFO_QUEUING or PRIORITY_QUEUING */
); );
if (*m == BAD_RTHANDLE) { if (*m == BAD_RTHANDLE) {