mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 20:24:39 +02:00
Merge pull request #5307 from kareem-wolfssl/miscfixes2
Fix a couple of STM32 bugs, and add some missing mutex frees.
This commit is contained in:
@@ -548,7 +548,7 @@ static int ServerMemRecv(info_t* info, char* buf, int sz)
|
||||
}
|
||||
osSemaphoreAcquire(info->server.mutex, osWaitForever);
|
||||
#else
|
||||
if (osSignalWait(1, RECV_WAIT_TIMEOUT) == osEventTimeout) {
|
||||
if (osSignalWait(1, RECV_WAIT_TIMEOUT).status == osEventTimeout) {
|
||||
printf("Server Recv: Timeout!\n");
|
||||
return WOLFSSL_CBIO_ERR_TIMEOUT;
|
||||
}
|
||||
@@ -644,7 +644,7 @@ static int ClientMemRecv(info_t* info, char* buf, int sz)
|
||||
}
|
||||
osSemaphoreAcquire(info->client.mutex, osWaitForever);
|
||||
#else
|
||||
if (osSignalWait(1, RECV_WAIT_TIMEOUT) == osEventTimeout) {
|
||||
if (osSignalWait(1, RECV_WAIT_TIMEOUT).status == osEventTimeout) {
|
||||
printf("Client Recv: Timeout!\n");
|
||||
return WOLFSSL_CBIO_ERR_TIMEOUT;
|
||||
}
|
||||
|
8
src/pk.c
8
src/pk.c
@@ -6164,6 +6164,10 @@ void wolfSSL_DH_free(WOLFSSL_DH* dh)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef SINGLE_THREADED
|
||||
wc_FreeMutex(&dh->refMutex);
|
||||
#endif
|
||||
|
||||
if (dh->internal) {
|
||||
wc_FreeDhKey((DhKey*)dh->internal);
|
||||
XFREE(dh->internal, NULL, DYNAMIC_TYPE_DH);
|
||||
@@ -8330,6 +8334,10 @@ void wolfSSL_EC_KEY_free(WOLFSSL_EC_KEY *key)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef SINGLE_THREADED
|
||||
wc_FreeMutex(&key->refMutex);
|
||||
#endif
|
||||
|
||||
if (key->internal != NULL) {
|
||||
wc_ecc_free((ecc_key*)key->internal);
|
||||
XFREE(key->internal, heap, DYNAMIC_TYPE_ECC);
|
||||
|
@@ -2051,6 +2051,8 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
||||
}
|
||||
}
|
||||
|
||||
HAL_RNG_DeInit(&hrng);
|
||||
|
||||
wolfSSL_CryptHwMutexUnLock();
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user