forked from wolfSSL/wolfssl
Fix issues found by -fsanitize=thread.
This commit is contained in:
10
src/crl.c
10
src/crl.c
@ -1099,7 +1099,17 @@ static void* DoMonitor(void* arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (FD_ISSET(crl->mfd, &readfds)) {
|
if (FD_ISSET(crl->mfd, &readfds)) {
|
||||||
|
word64 r64;
|
||||||
|
int rlen;
|
||||||
|
|
||||||
WOLFSSL_MSG("got custom shutdown event, breaking out");
|
WOLFSSL_MSG("got custom shutdown event, breaking out");
|
||||||
|
|
||||||
|
/* read out the bytes written to the event to clean up */
|
||||||
|
rlen = (int) read(crl->mfd, &r64, sizeof(r64));
|
||||||
|
if (rlen < 0) {
|
||||||
|
WOLFSSL_MSG("read custom event failure");
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
tests/api.c
12
tests/api.c
@ -27490,10 +27490,11 @@ static void test_wolfSSL_either_side(void)
|
|||||||
XMEMSET(&client_cb, 0, sizeof(callback_functions));
|
XMEMSET(&client_cb, 0, sizeof(callback_functions));
|
||||||
XMEMSET(&server_cb, 0, sizeof(callback_functions));
|
XMEMSET(&server_cb, 0, sizeof(callback_functions));
|
||||||
|
|
||||||
/* Use same CTX for both client and server */
|
/* Use different CTX for client and server */
|
||||||
client_cb.ctx = wolfSSL_CTX_new(wolfSSLv23_method());
|
client_cb.ctx = wolfSSL_CTX_new(wolfSSLv23_method());
|
||||||
AssertNotNull(client_cb.ctx);
|
AssertNotNull(client_cb.ctx);
|
||||||
server_cb.ctx = client_cb.ctx;
|
server_cb.ctx = wolfSSL_CTX_new(wolfSSLv23_method());
|
||||||
|
AssertNotNull(server_cb.ctx);
|
||||||
/* we are responsible for free'ing WOLFSSL_CTX */
|
/* we are responsible for free'ing WOLFSSL_CTX */
|
||||||
server_cb.isSharedCtx = client_cb.isSharedCtx = 1;
|
server_cb.isSharedCtx = client_cb.isSharedCtx = 1;
|
||||||
|
|
||||||
@ -27511,6 +27512,7 @@ static void test_wolfSSL_either_side(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
wolfSSL_CTX_free(client_cb.ctx);
|
wolfSSL_CTX_free(client_cb.ctx);
|
||||||
|
wolfSSL_CTX_free(server_cb.ctx);
|
||||||
FreeTcpReady(&ready);
|
FreeTcpReady(&ready);
|
||||||
|
|
||||||
#ifndef SINGLE_THREADED
|
#ifndef SINGLE_THREADED
|
||||||
@ -27558,10 +27560,11 @@ static void test_wolfSSL_DTLS_either_side(void)
|
|||||||
XMEMSET(&client_cb, 0, sizeof(callback_functions));
|
XMEMSET(&client_cb, 0, sizeof(callback_functions));
|
||||||
XMEMSET(&server_cb, 0, sizeof(callback_functions));
|
XMEMSET(&server_cb, 0, sizeof(callback_functions));
|
||||||
|
|
||||||
/* Use same CTX for both client and server */
|
/* Use different CTX for client and server */
|
||||||
client_cb.ctx = wolfSSL_CTX_new(wolfDTLS_method());
|
client_cb.ctx = wolfSSL_CTX_new(wolfDTLS_method());
|
||||||
AssertNotNull(client_cb.ctx);
|
AssertNotNull(client_cb.ctx);
|
||||||
server_cb.ctx = client_cb.ctx;
|
server_cb.ctx = wolfSSL_CTX_new(wolfDTLS_method());
|
||||||
|
AssertNotNull(server_cb.ctx);
|
||||||
/* we are responsible for free'ing WOLFSSL_CTX */
|
/* we are responsible for free'ing WOLFSSL_CTX */
|
||||||
server_cb.isSharedCtx = client_cb.isSharedCtx = 1;
|
server_cb.isSharedCtx = client_cb.isSharedCtx = 1;
|
||||||
|
|
||||||
@ -27579,6 +27582,7 @@ static void test_wolfSSL_DTLS_either_side(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
wolfSSL_CTX_free(client_cb.ctx);
|
wolfSSL_CTX_free(client_cb.ctx);
|
||||||
|
wolfSSL_CTX_free(server_cb.ctx);
|
||||||
FreeTcpReady(&ready);
|
FreeTcpReady(&ready);
|
||||||
|
|
||||||
#ifndef SINGLE_THREADED
|
#ifndef SINGLE_THREADED
|
||||||
|
@ -836,11 +836,12 @@ WOLFSSL_API int wolfCrypt_Cleanup(void);
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if !defined(XGMTIME) && !defined(TIME_OVERRIDES)
|
#if !defined(XGMTIME) && !defined(TIME_OVERRIDES)
|
||||||
#if defined(WOLFSSL_GMTIME) || !defined(HAVE_GMTIME_R) || defined(WOLF_C99)
|
/* Always use gmtime_r if available. */
|
||||||
#define XGMTIME(c, t) gmtime((c))
|
#if defined(HAVE_GMTIME_R)
|
||||||
#else
|
|
||||||
#define XGMTIME(c, t) gmtime_r((c), (t))
|
#define XGMTIME(c, t) gmtime_r((c), (t))
|
||||||
#define NEED_TMP_TIME
|
#define NEED_TMP_TIME
|
||||||
|
#else
|
||||||
|
#define XGMTIME(c, t) gmtime((c))
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if !defined(XVALIDATE_DATE) && !defined(HAVE_VALIDATE_DATE)
|
#if !defined(XVALIDATE_DATE) && !defined(HAVE_VALIDATE_DATE)
|
||||||
|
Reference in New Issue
Block a user