forked from wolfSSL/wolfssl
Merge pull request #7246 from kareem-wolfssl/zd17176
Only include CRL monitor definitions when building with HAVE_CRL_MONITOR.
This commit is contained in:
@ -69,9 +69,9 @@ int InitCRL(WOLFSSL_CRL* crl, WOLFSSL_CERT_MANAGER* cm)
|
|||||||
crl->cm = cm;
|
crl->cm = cm;
|
||||||
crl->crlList = NULL;
|
crl->crlList = NULL;
|
||||||
crl->currentEntry = NULL;
|
crl->currentEntry = NULL;
|
||||||
|
#ifdef HAVE_CRL_MONITOR
|
||||||
crl->monitors[0].path = NULL;
|
crl->monitors[0].path = NULL;
|
||||||
crl->monitors[1].path = NULL;
|
crl->monitors[1].path = NULL;
|
||||||
#ifdef HAVE_CRL_MONITOR
|
|
||||||
crl->tid = INVALID_THREAD_VAL;
|
crl->tid = INVALID_THREAD_VAL;
|
||||||
crl->mfd = WOLFSSL_CRL_MFD_INIT_VAL;
|
crl->mfd = WOLFSSL_CRL_MFD_INIT_VAL;
|
||||||
crl->setup = 0; /* thread setup done predicate */
|
crl->setup = 0; /* thread setup done predicate */
|
||||||
@ -249,11 +249,13 @@ void FreeCRL(WOLFSSL_CRL* crl, int dynamic)
|
|||||||
|
|
||||||
tmp = crl->crlList;
|
tmp = crl->crlList;
|
||||||
WOLFSSL_ENTER("FreeCRL");
|
WOLFSSL_ENTER("FreeCRL");
|
||||||
|
#ifdef HAVE_CRL_MONITOR
|
||||||
if (crl->monitors[0].path)
|
if (crl->monitors[0].path)
|
||||||
XFREE(crl->monitors[0].path, crl->heap, DYNAMIC_TYPE_CRL_MONITOR);
|
XFREE(crl->monitors[0].path, crl->heap, DYNAMIC_TYPE_CRL_MONITOR);
|
||||||
|
|
||||||
if (crl->monitors[1].path)
|
if (crl->monitors[1].path)
|
||||||
XFREE(crl->monitors[1].path, crl->heap, DYNAMIC_TYPE_CRL_MONITOR);
|
XFREE(crl->monitors[1].path, crl->heap, DYNAMIC_TYPE_CRL_MONITOR);
|
||||||
|
#endif
|
||||||
|
|
||||||
XFREE(crl->currentEntry, crl->heap, DYNAMIC_TYPE_CRL_ENTRY);
|
XFREE(crl->currentEntry, crl->heap, DYNAMIC_TYPE_CRL_ENTRY);
|
||||||
crl->currentEntry = NULL;
|
crl->currentEntry = NULL;
|
||||||
@ -840,6 +842,7 @@ static int DupX509_CRL(WOLFSSL_X509_CRL *dupl, const WOLFSSL_X509_CRL* crl)
|
|||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_CRL_MONITOR
|
||||||
if (crl->monitors[0].path) {
|
if (crl->monitors[0].path) {
|
||||||
int pathSz = (int)XSTRLEN(crl->monitors[0].path) + 1;
|
int pathSz = (int)XSTRLEN(crl->monitors[0].path) + 1;
|
||||||
dupl->monitors[0].path = (char*)XMALLOC(pathSz, dupl->heap,
|
dupl->monitors[0].path = (char*)XMALLOC(pathSz, dupl->heap,
|
||||||
@ -867,6 +870,7 @@ static int DupX509_CRL(WOLFSSL_X509_CRL *dupl, const WOLFSSL_X509_CRL* crl)
|
|||||||
return MEMORY_E;
|
return MEMORY_E;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
dupl->crlList = DupCRL_list(crl->crlList, dupl->heap);
|
dupl->crlList = DupCRL_list(crl->crlList, dupl->heap);
|
||||||
#ifdef HAVE_CRL_IO
|
#ifdef HAVE_CRL_IO
|
||||||
|
@ -2519,6 +2519,7 @@ struct CRL_Entry {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef HAVE_CRL_MONITOR
|
||||||
typedef struct CRL_Monitor CRL_Monitor;
|
typedef struct CRL_Monitor CRL_Monitor;
|
||||||
|
|
||||||
/* CRL directory monitor */
|
/* CRL directory monitor */
|
||||||
@ -2544,6 +2545,7 @@ typedef HANDLE wolfSSL_CRL_mfd_t; /* monitor fd, INVALID_HANDLE_VALUE if
|
|||||||
* no init yet */
|
* no init yet */
|
||||||
#define WOLFSSL_CRL_MFD_INIT_VAL (INVALID_HANDLE_VALUE)
|
#define WOLFSSL_CRL_MFD_INIT_VAL (INVALID_HANDLE_VALUE)
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* wolfSSL CRL controller */
|
/* wolfSSL CRL controller */
|
||||||
struct WOLFSSL_CRL {
|
struct WOLFSSL_CRL {
|
||||||
@ -2554,8 +2556,8 @@ struct WOLFSSL_CRL {
|
|||||||
CbCrlIO crlIOCb;
|
CbCrlIO crlIOCb;
|
||||||
#endif
|
#endif
|
||||||
wolfSSL_RwLock crlLock; /* CRL list lock */
|
wolfSSL_RwLock crlLock; /* CRL list lock */
|
||||||
CRL_Monitor monitors[WOLFSSL_CRL_MONITORS_LEN];
|
|
||||||
#ifdef HAVE_CRL_MONITOR
|
#ifdef HAVE_CRL_MONITOR
|
||||||
|
CRL_Monitor monitors[WOLFSSL_CRL_MONITORS_LEN];
|
||||||
COND_TYPE cond; /* condition to signal setup */
|
COND_TYPE cond; /* condition to signal setup */
|
||||||
THREAD_TYPE tid; /* monitoring thread */
|
THREAD_TYPE tid; /* monitoring thread */
|
||||||
wolfSSL_CRL_mfd_t mfd;
|
wolfSSL_CRL_mfd_t mfd;
|
||||||
|
Reference in New Issue
Block a user