@@ -69,9 +69,9 @@ int InitCRL(WOLFSSL_CRL* crl, WOLFSSL_CERT_MANAGER* cm)
6969 crl -> cm = cm ;
7070 crl -> crlList = NULL ;
7171 crl -> currentEntry = NULL ;
72+ #ifdef HAVE_CRL_MONITOR
7273 crl -> monitors [0 ].path = NULL ;
7374 crl -> monitors [1 ].path = NULL ;
74- #ifdef HAVE_CRL_MONITOR
7575 crl -> tid = INVALID_THREAD_VAL ;
7676 crl -> mfd = WOLFSSL_CRL_MFD_INIT_VAL ;
7777 crl -> setup = 0 ; /* thread setup done predicate */
@@ -249,11 +249,13 @@ void FreeCRL(WOLFSSL_CRL* crl, int dynamic)
249249
250250 tmp = crl -> crlList ;
251251 WOLFSSL_ENTER ("FreeCRL" );
252+ #ifdef HAVE_CRL_MONITOR
252253 if (crl -> monitors [0 ].path )
253254 XFREE (crl -> monitors [0 ].path , crl -> heap , DYNAMIC_TYPE_CRL_MONITOR );
254255
255256 if (crl -> monitors [1 ].path )
256257 XFREE (crl -> monitors [1 ].path , crl -> heap , DYNAMIC_TYPE_CRL_MONITOR );
258+ #endif
257259
258260 XFREE (crl -> currentEntry , crl -> heap , DYNAMIC_TYPE_CRL_ENTRY );
259261 crl -> currentEntry = NULL ;
@@ -840,6 +842,7 @@ static int DupX509_CRL(WOLFSSL_X509_CRL *dupl, const WOLFSSL_X509_CRL* crl)
840842 return BAD_FUNC_ARG ;
841843 }
842844
845+ #ifdef HAVE_CRL_MONITOR
843846 if (crl -> monitors [0 ].path ) {
844847 int pathSz = (int )XSTRLEN (crl -> monitors [0 ].path ) + 1 ;
845848 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)
867870 return MEMORY_E ;
868871 }
869872 }
873+ #endif
870874
871875 dupl -> crlList = DupCRL_list (crl -> crlList , dupl -> heap );
872876#ifdef HAVE_CRL_IO
@@ -998,6 +1002,7 @@ static int SwapLists(WOLFSSL_CRL* crl)
9981002 return -1 ;
9991003 }
10001004
1005+ #ifdef HAVE_CRL_MONITOR
10011006 if (crl -> monitors [0 ].path ) {
10021007 ret = LoadCRL (tmp , crl -> monitors [0 ].path , WOLFSSL_FILETYPE_PEM , 0 );
10031008 if (ret != WOLFSSL_SUCCESS ) {
@@ -1021,6 +1026,7 @@ static int SwapLists(WOLFSSL_CRL* crl)
10211026 return -1 ;
10221027 }
10231028 }
1029+ #endif
10241030
10251031 if (wc_LockRwLock_Wr (& crl -> crlLock ) != 0 ) {
10261032 WOLFSSL_MSG ("wc_LockRwLock_Wr failed" );
@@ -1116,6 +1122,7 @@ static THREAD_RETURN WOLFSSL_THREAD DoMonitor(void* arg)
11161122 fPEM = -1 ;
11171123 fDER = -1 ;
11181124
1125+ #ifdef HAVE_CRL_MONITOR
11191126 if (crl -> monitors [0 ].path ) {
11201127 fPEM = open (crl -> monitors [0 ].path , XEVENT_MODE );
11211128 if (fPEM == -1 ) {
@@ -1137,6 +1144,7 @@ static THREAD_RETURN WOLFSSL_THREAD DoMonitor(void* arg)
11371144 return NULL ;
11381145 }
11391146 }
1147+ #endif
11401148
11411149 if (fPEM != -1 )
11421150 EV_SET (& change , fPEM , EVFILT_VNODE , EV_ADD | EV_ENABLE | EV_CLEAR ,
@@ -1248,6 +1256,7 @@ static THREAD_RETURN WOLFSSL_THREAD DoMonitor(void* arg)
12481256 return NULL ;
12491257 }
12501258
1259+ #ifdef HAVE_CRL_MONITOR
12511260 if (crl -> monitors [0 ].path ) {
12521261 wd = inotify_add_watch (notifyFd , crl -> monitors [0 ].path , IN_CLOSE_WRITE |
12531262 IN_DELETE );
@@ -1271,6 +1280,7 @@ static THREAD_RETURN WOLFSSL_THREAD DoMonitor(void* arg)
12711280 return NULL ;
12721281 }
12731282 }
1283+ #endif
12741284
12751285
12761286 /* signal to calling thread we're setup */
@@ -1413,6 +1423,7 @@ static THREAD_RETURN WOLFSSL_THREAD DoMonitor(void* arg)
14131423 }
14141424 handlesLen ++ ;
14151425
1426+ #ifdef HAVE_CRL_MONITOR
14161427 for (i = 0 ; i < WOLFSSL_CRL_MONITORS_LEN ; i ++ ) {
14171428 if (crl -> monitors [i ].path ) {
14181429 handles [handlesLen ] = FindFirstChangeNotificationA (
@@ -1432,6 +1443,7 @@ static THREAD_RETURN WOLFSSL_THREAD DoMonitor(void* arg)
14321443 handlesLen ++ ;
14331444 }
14341445 }
1446+ #endif
14351447
14361448 if (handlesLen == 1 ) {
14371449 WOLFSSL_MSG ("Nothing to watch. Only custom event handle set." );
0 commit comments