nss: import at 3.0.1 beta 1
[mozilla-nss.git] / security / nss / lib / libpkix / pkix / util / pkix_tools.h
blob0e224c495eb9d983f4da6b6fb6382b922e7c4b58
1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
12 * License.
14 * The Original Code is the PKIX-C library.
16 * The Initial Developer of the Original Code is
17 * Sun Microsystems, Inc.
18 * Portions created by the Initial Developer are
19 * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
21 * Contributor(s):
22 * Sun Microsystems, Inc.
23 * Red Hat, Inc.
25 * Alternatively, the contents of this file may be used under the terms of
26 * either the GNU General Public License Version 2 or later (the "GPL"), or
27 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
39 * pkix_tools.h
41 * Header for Utility Functions and Macros
45 #ifndef _PKIX_TOOLS_H
46 #define _PKIX_TOOLS_H
48 #include "pkix.h"
49 #include <stddef.h>
50 #include <stdio.h>
51 #include "secport.h"
53 /* private PKIX system headers */
54 #include "pkix_basicconstraintschecker.h"
55 #include "pkix_buildresult.h"
56 #include "pkix_certchainchecker.h"
57 #include "pkix_certselector.h"
58 #include "pkix_comcertselparams.h"
59 #include "pkix_comcrlselparams.h"
60 #include "pkix_crlselector.h"
61 #include "pkix_defaultcrlchecker.h"
62 #include "pkix_defaultrevchecker.h"
63 #include "pkix_error.h"
64 #include "pkix_expirationchecker.h"
65 #include "pkix_list.h"
66 #include "pkix_logger.h"
67 #include "pkix_namechainingchecker.h"
68 #include "pkix_nameconstraintschecker.h"
69 #include "pkix_ocspchecker.h"
70 #include "pkix_policychecker.h"
71 #include "pkix_policynode.h"
72 #include "pkix_procparams.h"
73 #include "pkix_resourcelimits.h"
74 #include "pkix_revocationchecker.h"
75 #include "pkix_signaturechecker.h"
76 #include "pkix_store.h"
77 #include "pkix_targetcertchecker.h"
78 #include "pkix_validate.h"
79 #include "pkix_valresult.h"
80 #include "pkix_verifynode.h"
82 #ifdef __cplusplus
83 extern "C" {
84 #endif
86 typedef struct pkixStdVarsStr {
87 const char *aMyFuncName;
88 PKIX_Error *aPkixErrorResult;
89 PKIX_Error *aPkixTempResult;
90 PKIX_Error *aPkixReturnResult;
91 PKIX_ERRORCODE aPkixErrorCode;
92 const char *aPkixErrorMsg;
93 PKIX_Boolean aPkixErrorReceived;
94 PKIX_Boolean aPkixTempErrorReceived;
95 PKIX_ERRORCLASS aPkixErrorClass;
96 PKIX_UInt32 aPkixType;
97 PKIX_PL_Object *aLockedObject;
98 PKIX_List *aPkixErrorList;
99 } PKIX_StdVars;
101 #ifdef PKIX_STDVARS_POINTER
102 #define myFuncName stdVars->aMyFuncName
103 #define pkixErrorResult stdVars->aPkixErrorResult
104 #define pkixTempResult stdVars->aPkixTempResult
105 #define pkixReturnResult stdVars->aPkixReturnResult
106 #define pkixErrorCode stdVars->aPkixErrorCode
107 #define pkixErrorMsg stdVars->aPkixErrorMsg
108 #define pkixErrorReceived stdVars->aPkixErrorReceived
109 #define pkixTempErrorReceived stdVars->aPkixTempErrorReceived
110 #define pkixErrorClass stdVars->aPkixErrorClass
111 #define pkixType stdVars->aPkixType
112 #define lockedObject stdVars->aLockedObject
113 #define pkixErrorList stdVars->aPkixErrorList
114 #define stdVarsPtr stdVars
115 #else
116 #define myFuncName stdVars.aMyFuncName
117 #define pkixErrorResult stdVars.aPkixErrorResult
118 #define pkixTempResult stdVars.aPkixTempResult
119 #define pkixReturnResult stdVars.aPkixReturnResult
120 #define pkixErrorCode stdVars.aPkixErrorCode
121 #define pkixErrorMsg stdVars.aPkixErrorMsg
122 #define pkixErrorReceived stdVars.aPkixErrorReceived
123 #define pkixTempErrorReceived stdVars.aPkixTempErrorReceived
124 #define pkixErrorClass stdVars.aPkixErrorClass
125 #define pkixType stdVars.aPkixType
126 #define lockedObject stdVars.aLockedObject
127 #define pkixErrorList stdVars.aPkixErrorList
128 #define stdVarsPtr &stdVars
129 #endif
131 extern PKIX_Error * PKIX_DoReturn(PKIX_StdVars * stdVars,
132 PKIX_ERRORCLASS errClass,
133 PKIX_Boolean doLogger,
134 void * plContext);
136 extern PKIX_Error * PKIX_DoThrow(PKIX_StdVars * stdVars,
137 PKIX_ERRORCLASS errClass,
138 PKIX_ERRORCODE errCode,
139 PKIX_ERRORCLASS overrideClass,
140 void * plContext);
142 extern void PKIX_DoAddError(PKIX_StdVars * stdVars,
143 PKIX_Error * error,
144 void * plContext);
146 #ifdef PKIX_OBJECT_LEAK_TEST
147 extern PKIX_Error * pkix_CheckForGeneratedError(PKIX_StdVars * stdVars,
148 PKIX_ERRORCLASS errClass,
149 char * fnName,
150 PKIX_Boolean *errorStateSet,
151 void * plContext);
152 #endif /* PKIX_OBJECT_LEAK_TEST */
154 extern const PKIX_StdVars zeroStdVars;
156 extern PRLogModuleInfo *pkixLog;
159 * UTILITY MACROS
160 * Documentation for these common utility macros can be found in the
161 * Implementation Guidelines document (Section 4.3)
163 * In general, macros with multiple statements (or a single "if" statement)
164 * use the "do {<body>} while (0)" technique in order to convert the multiple
165 * statements into one statement, thus avoiding the dangling else problem.
166 * For macros which ALWAYS exit with a "return" or "goto", there is no
167 * need to use this technique (and it yields compiler warnings of "statement
168 * not reached"), so we just use "{<body>}" to group the statements together.
171 #if !defined (PKIX_OBJECT_LEAK_TEST)
173 #define PKIX_STD_VARS(funcName) \
174 static const char cMyFuncName[] = {funcName}; \
175 PKIX_StdVars stdVars = zeroStdVars; \
176 myFuncName = cMyFuncName
179 #else /* PKIX_OBJECT_LEAK_TEST */
181 extern char **fnStackNameArr;
182 extern PKIX_UInt32 *fnStackInvCountArr;
183 extern PKIX_UInt32 stackPosition;
184 extern PKIX_Boolean noErrorState;
185 extern PKIX_Boolean errorGenerated;
186 extern PKIX_Boolean runningLeakTest;
187 extern PLHashTable *fnInvTable;
189 extern PLHashNumber PR_CALLBACK pkix_ErrorGen_Hash (const void *key);
191 #define PKIX_STD_VARS(funcName) \
192 static const char cMyFuncName[] = {funcName}; \
193 PKIX_StdVars stdVars = zeroStdVars; \
194 PKIX_Boolean errorSetFlag = PKIX_FALSE; \
195 myFuncName = cMyFuncName; \
196 if (runningLeakTest) { \
197 if (fnStackNameArr) { \
198 fnStackInvCountArr[stackPosition] += 1; \
199 stackPosition += 1; \
200 fnStackInvCountArr[stackPosition] = 0; \
201 fnStackNameArr[stackPosition] = (char*)myFuncName; \
202 fnStackNameArr[stackPosition + 1] = NULL; \
203 PR_LOG(pkixLog, 5, \
204 ("%s%*s+> %s(%d) - %s\n", (errorGenerated ? "*" : " "), \
205 stackPosition, " ", fnStackNameArr[stackPosition], \
206 stackPosition, myFuncName)); \
208 do { \
209 pkixErrorResult = pkix_CheckForGeneratedError(&stdVars, PKIX_MEM_ERROR, \
210 funcName, &errorSetFlag, \
211 plContext); \
212 if (pkixErrorResult) { \
213 printf("Error in fn: %s\n", myFuncName); \
214 PR_LOG(pkixLog, 5, \
215 ("%s%*s<- %s(%d) - %s\n", (errorGenerated ? "*" : " "), \
216 stackPosition, " ", fnStackNameArr[stackPosition], \
217 stackPosition, myFuncName)); \
218 fnStackNameArr[stackPosition--] = NULL; \
219 if (errorSetFlag) { \
220 noErrorState = (noErrorState) ? PKIX_FALSE : PKIX_TRUE; \
222 return pkixErrorResult; \
224 } while (0); \
226 #endif /* PKIX_OBJECT_LEAK_TEST */
228 #ifdef DEBUG
229 #define _PKIX_DEBUG_TRACE(cond, prefix, level) \
230 do { \
231 if (cond) { \
232 pkix_Logger_Check(pkixLoggersDebugTrace, myFuncName, \
233 prefix, pkixType, level, plContext); \
235 } while (0)
236 #else
237 #define _PKIX_DEBUG_TRACE(cond, prefix, level)
238 #endif
240 #define _PKIX_LOG_ERROR(msg, level) \
242 if (pkixLoggersErrors) { \
243 pkix_Logger_Check(pkixLoggersErrors, msg, \
244 NULL, pkixType, level, plContext); \
248 #define PKIX_ENTER(type, funcName) \
249 PKIX_STD_VARS(funcName); \
250 pkixType = PKIX_ ## type ## _ERROR; \
251 PKIX_DEBUG_ENTER(type); \
252 _PKIX_DEBUG_TRACE(pkixLoggersDebugTrace, ">>>", PKIX_LOGGER_LEVEL_TRACE);
254 #define PKIX_ENTER_NO_LOGGER(type, funcName) \
255 PKIX_STD_VARS(funcName); \
256 pkixType = PKIX_ ## type ## _ERROR; \
257 PKIX_DEBUG_ENTER(type);
259 #define PKIX_DEBUG_ENTER(type) \
260 PKIX_ ## type ## _DEBUG_ARG("( Entering %s).\n", myFuncName)
262 #define PKIX_DEBUG_EXIT(type) \
263 PKIX_ ## type ## _DEBUG_ARG("( Exiting %s).\n", myFuncName)
265 #define PKIX_OBJECT_UNLOCK(obj) \
266 do { \
267 if (obj && lockedObject == (PKIX_PL_Object *)(obj)){ \
268 pkixTempResult = \
269 PKIX_PL_Object_Unlock \
270 ((PKIX_PL_Object *)(obj), plContext); \
271 if (pkixTempResult) { \
272 PKIX_DoAddError(stdVarsPtr, pkixTempResult, plContext); \
273 pkixTempResult = NULL; \
275 lockedObject = NULL; \
276 } else { \
277 PORT_Assert(lockedObject == NULL); \
279 } while (0)
281 #define PKIX_DECREF(obj) \
282 do { \
283 if (obj){ \
284 pkixTempResult = PKIX_PL_Object_DecRef \
285 ((PKIX_PL_Object *)(obj), plContext); \
286 if (pkixTempResult) { \
287 PKIX_DoAddError(stdVarsPtr, pkixTempResult, plContext); \
288 pkixTempResult = NULL; \
290 obj = NULL; \
292 } while (0)
294 #define PKIX_THROW(type, descNum) \
295 return PKIX_DoThrow(&stdVars, (PKIX_ ## type ## _ERROR), descNum, \
296 pkixErrorClass, plContext);
298 #ifdef PKIX_OBJECT_LEAK_TEST
299 #define PKIX_RETURN(type) \
300 if (runningLeakTest && fnStackNameArr) { \
301 PR_LOG(pkixLog, 5, \
302 ("%s%*s<- %s(%d) - %s\n", (errorGenerated ? "*" : " "), \
303 stackPosition, " ", fnStackNameArr[stackPosition], \
304 stackPosition, myFuncName)); \
305 fnStackNameArr[stackPosition--] = NULL; \
306 if (errorSetFlag) noErrorState = (noErrorState) ? PKIX_FALSE : PKIX_TRUE; \
308 return PKIX_DoReturn(&stdVars, (PKIX_ ## type ## _ERROR), PKIX_TRUE, plContext);
309 #else
310 #define PKIX_RETURN(type) \
311 return PKIX_DoReturn(&stdVars, (PKIX_ ## type ## _ERROR), PKIX_TRUE, plContext);
312 #endif /* PKIX_OBJECT_LEAK_TEST */
315 #if defined(DEBUG) && !defined(DEBUG_nb95248)
316 #define PKIX_RETURN_NO_LOGGER(type) \
318 PKIX_OBJECT_UNLOCK(lockedObject); \
319 if ((pkixErrorReceived) || (pkixErrorResult) || pkixErrorList) \
320 PKIX_THROW(type, pkixErrorCode); \
321 PKIX_DEBUG_EXIT(type); \
322 return NULL; \
324 #else
325 #define PKIX_RETURN_NO_LOGGER(type) \
326 return PKIX_DoReturn(&stdVars, (PKIX_ ## type ## _ERROR), PKIX_FALSE, plContext);
327 #endif
329 /* disable to disable ;-) */
330 #define WANT_TRACE_CHECK_FAILURES
332 #ifdef WANT_TRACE_CHECK_FAILURES
333 #define TRACE_CHECK_FAILURE(what, errorstring) \
334 if (pkixLog) { \
335 PR_LOG(pkixLog, PR_LOG_DEBUG, \
336 ("====> [%s] failed: %s\n", #what, errorstring)); \
338 #else
339 #define TRACE_CHECK_FAILURE(what, errorstring)
340 #endif
342 #define PKIX_CHECK(func, descNum) \
343 do { \
344 pkixErrorResult = (func); \
345 if (pkixErrorResult) { \
346 TRACE_CHECK_FAILURE((func), PKIX_ErrorText[descNum]) \
347 pkixErrorClass = pkixErrorResult->errClass; \
348 pkixErrorCode = descNum; \
349 pkixErrorMsg = PKIX_ErrorText[descNum]; \
350 goto cleanup; \
352 } while (0)
354 #define PKIX_CHECK_ONLY_FATAL(func, descNum) \
355 do { \
356 pkixTempErrorReceived = PKIX_FALSE; \
357 pkixErrorResult = (func); \
358 if (pkixErrorResult) { \
359 TRACE_CHECK_FAILURE((func), PKIX_ErrorText[descNum]) \
360 pkixTempErrorReceived = PKIX_TRUE; \
361 pkixErrorClass = pkixErrorResult->errClass; \
362 if (pkixErrorClass == PKIX_FATAL_ERROR) { \
363 goto cleanup; \
365 PKIX_DECREF(pkixErrorResult); \
367 } while (0)
369 #define PKIX_LOG_ERROR(descNum) \
370 _PKIX_LOG_ERROR(PKIX_ErrorText[descNum], PKIX_LOGGER_LEVEL_ERROR)
372 #define PKIX_ERROR(descNum) \
374 PKIX_LOG_ERROR(descNum) \
375 pkixErrorReceived = PKIX_TRUE; \
376 pkixErrorCode = descNum; \
377 pkixErrorMsg = PKIX_ErrorText[descNum]; \
378 goto cleanup; \
381 #define PKIX_ERROR_ALLOC_ERROR() \
383 PKIX_LOG_ERROR(PKIX_ALLOCERROR) \
384 pkixErrorReceived = PKIX_TRUE; \
385 pkixErrorResult = PKIX_ALLOC_ERROR(); \
386 goto cleanup; \
389 #define PKIX_ERROR_FATAL(descNum) \
391 pkixErrorReceived = PKIX_TRUE; \
392 pkixErrorMsg = PKIX_ErrorText[descNum]; \
393 pkixErrorCode = descNum; \
394 pkixErrorClass = PKIX_FATAL_ERROR; \
395 _PKIX_LOG_ERROR(pkixErrorMsg, PKIX_LOGGER_LEVEL_FATALERROR); \
396 goto cleanup; \
399 #define PKIX_CHECK_FATAL(func, descNum) \
400 do { \
401 pkixErrorResult = (func); \
402 if (pkixErrorResult) { \
403 TRACE_CHECK_FAILURE((func), PKIX_ErrorText[descNum]) \
404 pkixErrorReceived = PKIX_TRUE; \
405 pkixErrorMsg = PKIX_ErrorText[descNum]; \
406 pkixErrorCode = descNum; \
407 pkixErrorClass = PKIX_FATAL_ERROR; \
408 _PKIX_LOG_ERROR(pkixErrorMsg, PKIX_LOGGER_LEVEL_FATALERROR); \
409 goto fatal; \
411 } while (0)
413 #define PKIX_NULLCHECK_ONE(a) \
414 do { \
415 if ((a) == NULL){ \
416 pkixErrorReceived = PKIX_TRUE; \
417 pkixErrorMsg = PKIX_ErrorText[PKIX_NULLARGUMENT]; \
418 pkixErrorCode = PKIX_NULLARGUMENT; \
419 PKIX_RETURN(FATAL); \
421 } while (0)
423 #define PKIX_NULLCHECK_TWO(a, b) \
424 do { \
425 if (((a) == NULL) || ((b) == NULL)){ \
426 pkixErrorReceived = PKIX_TRUE; \
427 pkixErrorMsg = PKIX_ErrorText[PKIX_NULLARGUMENT]; \
428 pkixErrorCode = PKIX_NULLARGUMENT; \
429 PKIX_RETURN(FATAL); \
431 } while (0)
433 #define PKIX_NULLCHECK_THREE(a, b, c) \
434 do { \
435 if (((a) == NULL) || ((b) == NULL) || ((c) == NULL)){ \
436 pkixErrorReceived = PKIX_TRUE; \
437 pkixErrorMsg = PKIX_ErrorText[PKIX_NULLARGUMENT]; \
438 pkixErrorCode = PKIX_NULLARGUMENT; \
439 PKIX_RETURN(FATAL); \
441 } while (0)
443 #define PKIX_NULLCHECK_FOUR(a, b, c, d) \
444 do { \
445 if (((a) == NULL) || ((b) == NULL) || \
446 ((c) == NULL) || ((d) == NULL)){ \
447 pkixErrorReceived = PKIX_TRUE; \
448 pkixErrorMsg = PKIX_ErrorText[PKIX_NULLARGUMENT]; \
449 pkixErrorCode = PKIX_NULLARGUMENT; \
450 PKIX_RETURN(FATAL); \
452 } while (0)
454 #define PKIX_OBJECT_LOCK(obj) \
455 do { \
456 if (obj) { \
457 pkixTempResult = \
458 PKIX_PL_Object_Lock((PKIX_PL_Object*)(obj), plContext); \
459 if (pkixTempResult) { \
460 PKIX_DoAddError(stdVarsPtr, pkixTempResult, plContext); \
461 pkixTempResult = NULL; \
462 pkixErrorCode = PKIX_OBJECTLOCKFAILED; \
463 goto cleanup; \
465 lockedObject = (PKIX_PL_Object *)(obj); \
467 } while (0)
469 #define PKIX_ERROR_CREATE(type, descNum, error) \
471 pkixTempResult = (PKIX_Error*)pkix_Throw \
472 (PKIX_ ## type ## _ERROR, myFuncName, \
473 descNum, PKIX_ ## type ## _ERROR, pkixErrorResult, \
474 &error, plContext); \
475 if (pkixTempResult) { \
476 error = pkixTempResult; \
477 pkixTempResult = NULL; \
482 #define PKIX_ERROR_RECEIVED \
483 (pkixErrorReceived || pkixErrorResult || pkixTempErrorReceived || \
484 pkixErrorList)
486 #define PKIX_INCREF(obj) \
487 do { \
488 if (obj){ \
489 pkixTempResult = PKIX_PL_Object_IncRef \
490 ((PKIX_PL_Object *)(obj), plContext); \
491 if (pkixTempResult) { \
492 PKIX_DoAddError(&stdVars, pkixTempResult, plContext); \
493 pkixTempResult = NULL; \
494 goto cleanup; \
497 } while (0)
499 #define PKIX_FREE(obj) \
500 do { \
501 if (obj) { \
502 pkixTempResult = PKIX_PL_Free((obj), plContext); \
503 if (pkixTempResult) { \
504 PKIX_DoAddError(&stdVars, pkixTempResult, plContext); \
505 pkixTempResult = NULL; \
507 obj = NULL; \
509 } while (0)
511 #define PKIX_EXACTLY_ONE_NULL(a, b) (((a) && !(b)) || ((b) && !(a)))
513 /* DIGIT MACROS */
515 #define PKIX_ISDIGIT(c) (((c) >= '0') && ((c) <= '9'))
517 #define PKIX_ISXDIGIT(c) \
518 (PKIX_ISDIGIT(c) || ( (((c)|0x20) >= 'a') && (((c)|0x20) <= 'f') ))
520 #define PKIX_TOSTRING(a, b, c, d) \
521 do { \
522 int descNum; \
523 if ((a) != NULL) { \
524 pkixErrorResult = \
525 PKIX_PL_Object_ToString((PKIX_PL_Object *)(a), (b), (c)); \
526 descNum = (d); \
527 } else { \
528 pkixErrorResult = \
529 PKIX_PL_String_Create(PKIX_ESCASCII, "(null)", 0, (b), (c)); \
530 descNum = PKIX_STRINGCREATEFAILED; \
532 PKIX_CHECK(pkixErrorResult, descNum); \
533 } while (0)
535 #define PKIX_EQUALS(a, b, c, d, e) \
536 do { \
537 if ((a) != NULL && (b) != NULL) { \
538 PKIX_CHECK(PKIX_PL_Object_Equals\
539 ((PKIX_PL_Object *)(a), \
540 (PKIX_PL_Object*)(b), \
541 (c), \
542 (d)), \
543 (e)); \
544 } else if ((a) == NULL && (b) == NULL) { \
545 *(c) = PKIX_TRUE; \
546 } else { \
547 *(c) = PKIX_FALSE; \
549 } while (0)
551 #define PKIX_HASHCODE(a, b, c, d) \
552 do { \
553 if ((a) != NULL) { \
554 PKIX_CHECK(PKIX_PL_Object_Hashcode\
555 ((PKIX_PL_Object *)(a), (b), (c)), (d)); \
556 } else { \
557 *(b) = 0; \
559 } while (0)
561 #define PKIX_DUPLICATE(a, b, c, d) \
562 do { \
563 if ((a) != NULL) { \
564 PKIX_CHECK(PKIX_PL_Object_Duplicate\
565 ((PKIX_PL_Object *)(a), \
566 (PKIX_PL_Object **)(b), \
567 (c)), \
568 (d)); \
569 } else { \
570 *(b) = (a); \
572 } while (0)
575 * DEBUG MACROS
577 * Each type has an associated debug flag, which can
578 * be set on the compiler line using "-D<debugflag>". For convenience,
579 * "-DPKIX_DEBUGALL" turns on debug for all the components.
581 * If a type's debug flag is defined, then its two associated macros
582 * are defined: PKIX_type_DEBUG(expr) and PKIX_type_DEBUG_ARG(expr, arg),
583 * which call PKIX_DEBUG(expr) and PKIX_DEBUG_ARG(expr, arg) respectively,
584 * which, in turn, enable standard and consistently formatted output.
586 * If a type's debug flag is not defined, the two associated macros
587 * are defined as a NO-OP. As such, any PKIX_type_DEBUG or PKIX_type_DEBUG_ARG
588 * macros for an undefined type will be stripped from the code during
589 * pre-processing, thereby reducing code size.
592 #ifdef PKIX_DEBUGALL
593 #define PKIX_REFCOUNTDEBUG 1
594 #define PKIX_MEMDEBUG 1
595 #define PKIX_MUTEXDEBUG 1
596 #define PKIX_OBJECTDEBUG 1
597 #define PKIX_STRINGDEBUG 1
598 #define PKIX_OIDDEBUG 1
599 #define PKIX_LISTDEBUG 1
600 #define PKIX_ERRORDEBUG 1
601 #define PKIX_BYTEARRAYDEBUG 1
602 #define PKIX_RWLOCKDEBUG 1
603 #define PKIX_BIGINTDEBUG 1
604 #define PKIX_HASHTABLEDEBUG 1
605 #define PKIX_X500NAMEDEBUG 1
606 #define PKIX_GENERALNAMEDEBUG 1
607 #define PKIX_PUBLICKEYDEBUG 1
608 #define PKIX_CERTDEBUG 1
609 #define PKIX_HTTPCLIENTDEBUG 1
610 #define PKIX_DATEDEBUG 1
611 #define PKIX_TRUSTANCHORDEBUG 1
612 #define PKIX_PROCESSINGPARAMSDEBUG 1
613 #define PKIX_VALIDATEPARAMSDEBUG 1
614 #define PKIX_VALIDATERESULTDEBUG 1
615 #define PKIX_VALIDATEDEBUG 1
616 #define PKIX_CERTCHAINCHECKERDEBUG 1
617 #define PKIX_REVOCATIONCHECKERDEBUG 1
618 #define PKIX_CERTSELECTORDEBUG 1
619 #define PKIX_COMCERTSELPARAMSDEBUG 1
620 #define PKIX_TARGETCERTCHECKERSTATEDEBUG 1
621 #define PKIX_INITIALIZEPARAMSDEBUG 1
622 #define PKIX_CERTBASICCONSTRAINTSDEBUG 1
623 #define PKIX_CERTNAMECONSTRAINTSDEBUG 1
624 #define PKIX_CERTNAMECONSTRAINTSCHECKERSTATEDEBUG 1
625 #define PKIX_SUBJALTNAMECHECKERSTATEDEBUG 1
627 #define PKIX_CERTPOLICYQUALIFIERDEBUG 1
628 #define PKIX_CERTPOLICYINFODEBUG 1
629 #define PKIX_CERTPOLICYNODEDEBUG 1
630 #define PKIX_CERTPOLICYCHECKERSTATEDEBUG 1
631 #define PKIX_LIFECYCLEDEBUG 1
632 #define PKIX_BASICCONSTRAINTSCHECKERSTATEDEBUG 1
633 #define PKIX_CRLDEBUG 1
634 #define PKIX_CRLENTRYDEBUG 1
635 #define PKIX_CRLSELECTORDEBUG 1
636 #define PKIX_COMCRLSELPARAMSDEBUG 1
637 #define PKIX_CERTSTOREDEBUG 1
638 #define PKIX_COLLECTIONCERTSTORECONTEXTDEBUG 1
639 #define PKIX_DEFAULTCRLCHECKERSTATEDEBUG 1
640 #define PKIX_CERTPOLICYMAPDEBUG 1
641 #define PKIX_BUILDDEBUG 1
642 #define PKIX_BUILDRESULTDEBUG 1
643 #define PKIX_FORWARDBUILDERSTATEDEBUG 1
644 #define PKIX_SIGNATURECHECKERSTATEDEBUG 1
645 #define PKIX_USERDEFINEDMODULESDEBUG 1
646 #define PKIX_CONTEXTDEBUG 1
647 #define PKIX_DEFAULTREVOCATIONCHECKERDEBUG 1
648 #define PKIX_LDAPREQUESTDEBUG 1
649 #define PKIX_LDAPRESPONSEDEBUG 1
650 #define PKIX_LDAPCLIENTDEBUG 1
651 #define PKIX_LDAPDEFAULTCLIENTDEBUG 1
652 #define PKIX_SOCKETDEBUG 1
653 #define PKIX_RESOURCELIMITSDEBUG 1
654 #define PKIX_LOGGERDEBUG 1
655 #define PKIX_MONITORLOCKDEBUG 1
656 #define PKIX_INFOACCESSDEBUG 1
657 #define PKIX_AIAMGRDEBUG 1
658 #define PKIX_OCSPCHECKERDEBUG 1
659 #define PKIX_OCSPREQUESTDEBUG 1
660 #define PKIX_OCSPRESPONSEDEBUG 1
661 #define PKIX_HTTPDEFAULTCLIENTDEBUG 1
662 #define PKIX_HTTPCERTSTORECONTEXTDEBUG 1
663 #define PKIX_VERIFYNODEDEBUG 1
664 #endif
667 * XXX Both PKIX_DEBUG and PKIX_DEBUG_ARG currently use printf.
668 * This needs to be replaced with Loggers.
671 #define PKIX_DEBUG(expr) \
672 do { \
673 _PKIX_DEBUG_TRACE(pkixLoggersErrors, expr, PKIX_LOGGER_LEVEL_DEBUG); \
674 (void) printf("(%s: ", myFuncName); \
675 (void) printf(expr); \
676 } while (0)
678 /* Logging doesn't support DEBUG with ARG: cannot convert control and arg */
679 #define PKIX_DEBUG_ARG(expr, arg) \
680 do { \
681 (void) printf("(%s: ", myFuncName); \
682 (void) printf(expr, arg); \
683 } while (0)
685 #if PKIX_FATALDEBUG
686 #define PKIX_FATAL_DEBUG(expr) \
687 PKIX_DEBUG(expr)
688 #define PKIX_FATAL_DEBUG_ARG(expr, arg) \
689 PKIX_DEBUG_ARG(expr, arg)
690 #else
691 #define PKIX_FATAL_DEBUG(expr)
692 #define PKIX_FATAL_DEBUG_ARG(expr, arg)
693 #endif
695 #if PKIX_REFCOUNTDEBUG
696 #define PKIX_REF_COUNT_DEBUG(expr) \
697 PKIX_DEBUG(expr)
698 #define PKIX_REF_COUNT_DEBUG_ARG(expr, arg) \
699 PKIX_DEBUG_ARG(expr, arg)
700 #else
701 #define PKIX_REF_COUNT_DEBUG(expr)
702 #define PKIX_REF_COUNT_DEBUG_ARG(expr, arg)
703 #endif
705 #if PKIX_MEMDEBUG
706 #define PKIX_MEM_DEBUG(expr) \
707 PKIX_DEBUG(expr)
708 #define PKIX_MEM_DEBUG_ARG(expr, arg) \
709 PKIX_DEBUG_ARG(expr, arg)
710 #else
711 #define PKIX_MEM_DEBUG(expr)
712 #define PKIX_MEM_DEBUG_ARG(expr, arg)
713 #endif
715 #if PKIX_MUTEXDEBUG
716 #define PKIX_MUTEX_DEBUG(expr) \
717 PKIX_DEBUG(expr)
718 #define PKIX_MUTEX_DEBUG_ARG(expr, arg) \
719 PKIX_DEBUG_ARG(expr, arg)
720 #else
721 #define PKIX_MUTEX_DEBUG(expr)
722 #define PKIX_MUTEX_DEBUG_ARG(expr, arg)
723 #endif
725 #if PKIX_OBJECTDEBUG
726 #define PKIX_OBJECT_DEBUG(expr) \
727 PKIX_DEBUG(expr)
728 #define PKIX_OBJECT_DEBUG_ARG(expr, arg) \
729 PKIX_DEBUG_ARG(expr, arg)
730 #else
731 #define PKIX_OBJECT_DEBUG(expr)
732 #define PKIX_OBJECT_DEBUG_ARG(expr, arg)
733 #endif
735 #if PKIX_ERRORDEBUG
736 #define PKIX_ERROR_DEBUG(expr) \
737 PKIX_DEBUG(expr)
738 #define PKIX_ERROR_DEBUG_ARG(expr, arg) \
739 PKIX_DEBUG_ARG(expr, arg)
740 #else
741 #define PKIX_ERROR_DEBUG(expr)
742 #define PKIX_ERROR_DEBUG_ARG(expr, arg)
743 #endif
745 #if PKIX_STRINGDEBUG
746 #define PKIX_STRING_DEBUG(expr) \
747 PKIX_DEBUG(expr)
748 #define PKIX_STRING_DEBUG_ARG(expr, arg) \
749 PKIX_DEBUG_ARG(expr, arg)
750 #else
751 #define PKIX_STRING_DEBUG(expr)
752 #define PKIX_STRING_DEBUG_ARG(expr, arg)
753 #endif
755 #if PKIX_OIDDEBUG
756 #define PKIX_OID_DEBUG(expr) \
757 PKIX_DEBUG(expr)
758 #define PKIX_OID_DEBUG_ARG(expr, arg) \
759 PKIX_DEBUG_ARG(expr, arg)
760 #else
761 #define PKIX_OID_DEBUG(expr)
762 #define PKIX_OID_DEBUG_ARG(expr, arg)
763 #endif
765 #if PKIX_LISTDEBUG
766 #define PKIX_LIST_DEBUG(expr) \
767 PKIX_DEBUG(expr)
768 #define PKIX_LIST_DEBUG_ARG(expr, arg) \
769 PKIX_DEBUG_ARG(expr, arg)
770 #else
771 #define PKIX_LIST_DEBUG(expr)
772 #define PKIX_LIST_DEBUG_ARG(expr, arg)
773 #endif
775 #if PKIX_RWLOCKDEBUG
776 #define PKIX_RWLOCK_DEBUG(expr) \
777 PKIX_DEBUG(expr)
778 #define PKIX_RWLOCK_DEBUG_ARG(expr, arg) \
779 PKIX_DEBUG_ARG(expr, arg)
780 #else
781 #define PKIX_RWLOCK_DEBUG(expr)
782 #define PKIX_RWLOCK_DEBUG_ARG(expr, arg)
783 #endif
785 #if PKIX_BYTEARRAYDEBUG
786 #define PKIX_BYTEARRAY_DEBUG(expr) \
787 PKIX_DEBUG(expr)
788 #define PKIX_BYTEARRAY_DEBUG_ARG(expr, arg) \
789 PKIX_DEBUG_ARG(expr, arg)
790 #else
791 #define PKIX_BYTEARRAY_DEBUG(expr)
792 #define PKIX_BYTEARRAY_DEBUG_ARG(expr, arg)
793 #endif
795 #if PKIX_HASHTABLEDEBUG
796 #define PKIX_HASHTABLE_DEBUG(expr) \
797 PKIX_DEBUG(expr)
798 #define PKIX_HASHTABLE_DEBUG_ARG(expr, arg) \
799 PKIX_DEBUG_ARG(expr, arg)
800 #else
801 #define PKIX_HASHTABLE_DEBUG(expr)
802 #define PKIX_HASHTABLE_DEBUG_ARG(expr, arg)
803 #endif
805 #if PKIX_X500NAMEDEBUG
806 #define PKIX_X500NAME_DEBUG(expr) \
807 PKIX_DEBUG(expr)
808 #define PKIX_X500NAME_DEBUG_ARG(expr, arg) \
809 PKIX_DEBUG_ARG(expr, arg)
810 #else
811 #define PKIX_X500NAME_DEBUG(expr)
812 #define PKIX_X500NAME_DEBUG_ARG(expr, arg)
813 #endif
815 #if PKIX_GENERALNAMEDEBUG
816 #define PKIX_GENERALNAME_DEBUG(expr) \
817 PKIX_DEBUG(expr)
818 #define PKIX_GENERALNAME_DEBUG_ARG(expr, arg) \
819 PKIX_DEBUG_ARG(expr, arg)
820 #else
821 #define PKIX_GENERALNAME_DEBUG(expr)
822 #define PKIX_GENERALNAME_DEBUG_ARG(expr, arg)
823 #endif
825 #if PKIX_PUBLICKEYDEBUG
826 #define PKIX_PUBLICKEY_DEBUG(expr) \
827 PKIX_DEBUG(expr)
828 #define PKIX_PUBLICKEY_DEBUG_ARG(expr, arg) \
829 PKIX_DEBUG_ARG(expr, arg)
830 #else
831 #define PKIX_PUBLICKEY_DEBUG(expr)
832 #define PKIX_PUBLICKEY_DEBUG_ARG(expr, arg)
833 #endif
835 #if PKIX_CERTDEBUG
836 #define PKIX_CERT_DEBUG(expr) \
837 PKIX_DEBUG(expr)
838 #define PKIX_CERT_DEBUG_ARG(expr, arg) \
839 PKIX_DEBUG_ARG(expr, arg)
840 #else
841 #define PKIX_CERT_DEBUG(expr)
842 #define PKIX_CERT_DEBUG_ARG(expr, arg)
843 #endif
845 #if PKIX_HTTPCLIENTDEBUG
846 #define PKIX_HTTPCLIENT_DEBUG(expr) \
847 PKIX_DEBUG(expr)
848 #define PKIX_HTTPCLIENT_DEBUG_ARG(expr, arg) \
849 PKIX_DEBUG_ARG(expr, arg)
850 #else
851 #define PKIX_HTTPCLIENT_DEBUG(expr)
852 #define PKIX_HTTPCLIENT_DEBUG_ARG(expr, arg)
853 #endif
855 #if PKIX_BIGINTDEBUG
856 #define PKIX_BIGINT_DEBUG(expr) \
857 PKIX_DEBUG(expr)
858 #define PKIX_BIGINT_DEBUG_ARG(expr, arg) \
859 PKIX_DEBUG_ARG(expr, arg)
860 #else
861 #define PKIX_BIGINT_DEBUG(expr)
862 #define PKIX_BIGINT_DEBUG_ARG(expr, arg)
863 #endif
865 #if PKIX_DATEDEBUG
866 #define PKIX_DATE_DEBUG(expr) \
867 PKIX_DEBUG(expr)
868 #define PKIX_DATE_DEBUG_ARG(expr, arg) \
869 PKIX_DEBUG_ARG(expr, arg)
870 #else
871 #define PKIX_DATE_DEBUG(expr)
872 #define PKIX_DATE_DEBUG_ARG(expr, arg)
873 #endif
875 #if PKIX_TRUSTANCHORDEBUG
876 #define PKIX_TRUSTANCHOR_DEBUG(expr) \
877 PKIX_DEBUG(expr)
878 #define PKIX_TRUSTANCHOR_DEBUG_ARG(expr, arg) \
879 PKIX_DEBUG_ARG(expr, arg)
880 #else
881 #define PKIX_TRUSTANCHOR_DEBUG(expr)
882 #define PKIX_TRUSTANCHOR_DEBUG_ARG(expr, arg)
883 #endif
885 #if PKIX_PROCESSINGPARAMSDEBUG
886 #define PKIX_PROCESSINGPARAMS_DEBUG(expr) \
887 PKIX_DEBUG(expr)
888 #define PKIX_PROCESSINGPARAMS_DEBUG_ARG(expr, arg) \
889 PKIX_DEBUG_ARG(expr, arg)
890 #else
891 #define PKIX_PROCESSINGPARAMS_DEBUG(expr)
892 #define PKIX_PROCESSINGPARAMS_DEBUG_ARG(expr, arg)
893 #endif
895 #if PKIX_VALIDATEPARAMSDEBUG
896 #define PKIX_VALIDATEPARAMS_DEBUG(expr) \
897 PKIX_DEBUG(expr)
898 #define PKIX_VALIDATEPARAMS_DEBUG_ARG(expr, arg) \
899 PKIX_DEBUG_ARG(expr, arg)
900 #else
901 #define PKIX_VALIDATEPARAMS_DEBUG(expr)
902 #define PKIX_VALIDATEPARAMS_DEBUG_ARG(expr, arg)
903 #endif
905 #if PKIX_VALIDATERESULTDEBUG
906 #define PKIX_VALIDATERESULT_DEBUG(expr) \
907 PKIX_DEBUG(expr)
908 #define PKIX_VALIDATERESULT_DEBUG_ARG(expr, arg) \
909 PKIX_DEBUG_ARG(expr, arg)
910 #else
911 #define PKIX_VALIDATERESULT_DEBUG(expr)
912 #define PKIX_VALIDATERESULT_DEBUG_ARG(expr, arg)
913 #endif
915 #if PKIX_VALIDATEDEBUG
916 #define PKIX_VALIDATE_DEBUG(expr) \
917 PKIX_DEBUG(expr)
918 #define PKIX_VALIDATE_DEBUG_ARG(expr, arg) \
919 PKIX_DEBUG_ARG(expr, arg)
920 #else
921 #define PKIX_VALIDATE_DEBUG(expr)
922 #define PKIX_VALIDATE_DEBUG_ARG(expr, arg)
923 #endif
925 #if PKIX_BUILDDEBUG
926 #define PKIX_BUILD_DEBUG(expr) \
927 PKIX_DEBUG(expr)
928 #define PKIX_BUILD_DEBUG_ARG(expr, arg) \
929 PKIX_DEBUG_ARG(expr, arg)
930 #else
931 #define PKIX_BUILD_DEBUG(expr)
932 #define PKIX_BUILD_DEBUG_ARG(expr, arg)
933 #endif
935 #if PKIX_CERTCHAINCHECKERDEBUG
936 #define PKIX_CERTCHAINCHECKER_DEBUG(expr) \
937 PKIX_DEBUG(expr)
938 #define PKIX_CERTCHAINCHECKER_DEBUG_ARG(expr, arg) \
939 PKIX_DEBUG_ARG(expr, arg)
940 #else
941 #define PKIX_CERTCHAINCHECKER_DEBUG(expr)
942 #define PKIX_CERTCHAINCHECKER_DEBUG_ARG(expr, arg)
943 #endif
945 #if PKIX_REVOCATIONCHECKERDEBUG
946 #define PKIX_REVOCATIONCHECKER_DEBUG(expr) \
947 PKIX_DEBUG(expr)
948 #define PKIX_REVOCATIONCHECKER_DEBUG_ARG(expr, arg) \
949 PKIX_DEBUG_ARG(expr, arg)
950 #else
951 #define PKIX_REVOCATIONCHECKER_DEBUG(expr)
952 #define PKIX_REVOCATIONCHECKER_DEBUG_ARG(expr, arg)
953 #endif
955 #if PKIX_CERTSELECTORDEBUG
956 #define PKIX_CERTSELECTOR_DEBUG(expr) \
957 PKIX_DEBUG(expr)
958 #define PKIX_CERTSELECTOR_DEBUG_ARG(expr, arg) \
959 PKIX_DEBUG_ARG(expr, arg)
960 #else
961 #define PKIX_CERTSELECTOR_DEBUG(expr)
962 #define PKIX_CERTSELECTOR_DEBUG_ARG(expr, arg)
963 #endif
965 #if PKIX_COMCERTSELPARAMSDEBUG
966 #define PKIX_COMCERTSELPARAMS_DEBUG(expr) \
967 PKIX_DEBUG(expr)
968 #define PKIX_COMCERTSELPARAMS_DEBUG_ARG(expr, arg) \
969 PKIX_DEBUG_ARG(expr, arg)
970 #else
971 #define PKIX_COMCERTSELPARAMS_DEBUG(expr)
972 #define PKIX_COMCERTSELPARAMS_DEBUG_ARG(expr, arg)
973 #endif
975 #if PKIX_TARGETCERTCHECKERSTATEDEBUG
976 #define PKIX_TARGETCERTCHECKERSTATE_DEBUG(expr) \
977 PKIX_DEBUG(expr)
978 #define PKIX_TARGETCERTCHECKERSTATE_DEBUG_ARG(expr, arg) \
979 PKIX_DEBUG_ARG(expr, arg)
980 #else
981 #define PKIX_TARGETCERTCHECKERSTATE_DEBUG(expr)
982 #define PKIX_TARGETCERTCHECKERSTATE_DEBUG_ARG(expr, arg)
983 #endif
985 #if PKIX_BASICCONSTRAINTSCHECKERSTATEDEBUG
986 #define PKIX_BASICCONSTRAINTSCHECKERSTATE_DEBUG(expr) \
987 PKIX_DEBUG(expr)
988 #define PKIX_BASICCONSTRAINTSCHECKERSTATE_DEBUG_ARG(expr, arg) \
989 PKIX_DEBUG_ARG(expr, arg)
990 #else
991 #define PKIX_BASICCONSTRAINTSCHECKERSTATE_DEBUG(expr)
992 #define PKIX_BASICCONSTRAINTSCHECKERSTATE_DEBUG_ARG(expr, arg)
993 #endif
995 #if PKIX_INITIALIZEPARAMSDEBUG
996 #define PKIX_INITIALIZEPARAMS_DEBUG(expr) \
997 PKIX_DEBUG(expr)
998 #define PKIX_INITIALIZEPARAMS_DEBUG_ARG(expr, arg) \
999 PKIX_DEBUG_ARG(expr, arg)
1000 #else
1001 #define PKIX_INITIALIZEPARAMS_DEBUG(expr)
1002 #define PKIX_INITIALIZEPARAMS_DEBUG_ARG(expr, arg)
1003 #endif
1005 #if PKIX_CERTBASICCONSTRAINTSDEBUG
1006 #define PKIX_CERTBASICCONSTRAINTS_DEBUG(expr) \
1007 PKIX_DEBUG(expr)
1008 #define PKIX_CERTBASICCONSTRAINTS_DEBUG_ARG(expr, arg) \
1009 PKIX_DEBUG_ARG(expr, arg)
1010 #else
1011 #define PKIX_CERTBASICCONSTRAINTS_DEBUG(expr)
1012 #define PKIX_CERTBASICCONSTRAINTS_DEBUG_ARG(expr, arg)
1013 #endif
1015 #if PKIX_CERTNAMECONSTRAINTSDEBUG
1016 #define PKIX_CERTNAMECONSTRAINTS_DEBUG(expr) \
1017 PKIX_DEBUG(expr)
1018 #define PKIX_CERTNAMECONSTRAINTS_DEBUG_ARG(expr, arg) \
1019 PKIX_DEBUG_ARG(expr, arg)
1020 #else
1021 #define PKIX_CERTNAMECONSTRAINTS_DEBUG(expr)
1022 #define PKIX_CERTNAMECONSTRAINTS_DEBUG_ARG(expr, arg)
1023 #endif
1025 #if PKIX_CERTNAMECONSTRAINTSCHECKERSTATEDEBUG
1026 #define PKIX_CERTNAMECONSTRAINTSCHECKERSTATE_DEBUG(expr) \
1027 PKIX_DEBUG(expr)
1028 #define PKIX_CERTNAMECONSTRAINTSCHECKERSTATE_DEBUG_ARG(expr, arg) \
1029 PKIX_DEBUG_ARG(expr, arg)
1030 #else
1031 #define PKIX_CERTNAMECONSTRAINTSCHECKERSTATE_DEBUG(expr)
1032 #define PKIX_CERTNAMECONSTRAINTSCHECKERSTATE_DEBUG_ARG(expr, arg)
1033 #endif
1035 #if PKIX_SUBJALTNAMECHECKERSTATEDEBUG
1036 #define PKIX_SUBJALTNAMECHECKERSTATE_DEBUG(expr) \
1037 PKIX_DEBUG(expr)
1038 #define PKIX_SUBJALTNAMECHECKERSTATE_DEBUG_ARG(expr, arg) \
1039 PKIX_DEBUG_ARG(expr, arg)
1040 #else
1041 #define PKIX_SUBJALTNAMECHECKERSTATE_DEBUG(expr)
1042 #define PKIX_SUBJALTNAMECHECKERSTATE_DEBUG_ARG(expr, arg)
1043 #endif
1045 #if PKIX_CERTPOLICYQUALIFIERDEBUG
1046 #define PKIX_CERTPOLICYQUALIFIER_DEBUG(expr) \
1047 PKIX_DEBUG(expr)
1048 #define PKIX_CERTPOLICYQUALIFIER_DEBUG_ARG(expr, arg) \
1049 PKIX_DEBUG_ARG(expr, arg)
1050 #else
1051 #define PKIX_CERTPOLICYQUALIFIER_DEBUG(expr)
1052 #define PKIX_CERTPOLICYQUALIFIER_DEBUG_ARG(expr, arg)
1053 #endif
1055 #if PKIX_CERTPOLICYINFODEBUG
1056 #define PKIX_CERTPOLICYINFO_DEBUG(expr) \
1057 PKIX_DEBUG(expr)
1058 #define PKIX_CERTPOLICYINFO_DEBUG_ARG(expr, arg) \
1059 PKIX_DEBUG_ARG(expr, arg)
1060 #else
1061 #define PKIX_CERTPOLICYINFO_DEBUG(expr)
1062 #define PKIX_CERTPOLICYINFO_DEBUG_ARG(expr, arg)
1063 #endif
1065 #if PKIX_CERTPOLICYNODEDEBUG
1066 #define PKIX_CERTPOLICYNODE_DEBUG(expr) \
1067 PKIX_DEBUG(expr)
1068 #define PKIX_CERTPOLICYNODE_DEBUG_ARG(expr, arg) \
1069 PKIX_DEBUG_ARG(expr, arg)
1070 #else
1071 #define PKIX_CERTPOLICYNODE_DEBUG(expr)
1072 #define PKIX_CERTPOLICYNODE_DEBUG_ARG(expr, arg)
1073 #endif
1075 #if PKIX_CERTPOLICYCHECKERSTATEDEBUG
1076 #define PKIX_CERTPOLICYCHECKERSTATE_DEBUG(expr) \
1077 PKIX_DEBUG(expr)
1078 #define PKIX_CERTPOLICYCHECKERSTATE_DEBUG_ARG(expr, arg) \
1079 PKIX_DEBUG_ARG(expr, arg)
1080 #else
1081 #define PKIX_CERTPOLICYCHECKERSTATE_DEBUG(expr)
1082 #define PKIX_CERTPOLICYCHECKERSTATE_DEBUG_ARG(expr, arg)
1083 #endif
1085 #if PKIX_LIFECYCLEDEBUG
1086 #define PKIX_LIFECYCLE_DEBUG(expr) \
1087 PKIX_DEBUG(expr)
1088 #define PKIX_LIFECYCLE_DEBUG_ARG(expr, arg) \
1089 PKIX_DEBUG_ARG(expr, arg)
1090 #else
1091 #define PKIX_LIFECYCLE_DEBUG(expr)
1092 #define PKIX_LIFECYCLE_DEBUG_ARG(expr, arg)
1093 #endif
1095 #if PKIX_BASICCONSTRAINTSCHECKERSTATEDEBUG
1096 #define PKIX_BASICCONSTRAINTSCHECKERSTATE_DEBUG(expr) \
1097 PKIX_DEBUG(expr)
1098 #define PKIX_BASICCONSTRAINTSCHECKERSTATE_DEBUG_ARG(expr, arg) \
1099 PKIX_DEBUG_ARG(expr, arg)
1100 #else
1101 #define PKIX_BASICCONSTRAINTSCHECKERSTATE_DEBUG(expr)
1102 #define PKIX_BASICCONSTRAINTSCHECKERSTATE_DEBUG_ARG(expr, arg)
1103 #endif
1105 #if PKIX_CRLDEBUG
1106 #define PKIX_CRL_DEBUG(expr) \
1107 PKIX_DEBUG(expr)
1108 #define PKIX_CRL_DEBUG_ARG(expr, arg) \
1109 PKIX_DEBUG_ARG(expr, arg)
1110 #else
1111 #define PKIX_CRL_DEBUG(expr)
1112 #define PKIX_CRL_DEBUG_ARG(expr, arg)
1113 #endif
1115 #if PKIX_CRLENTRYDEBUG
1116 #define PKIX_CRLENTRY_DEBUG(expr) \
1117 PKIX_DEBUG(expr)
1118 #define PKIX_CRLENTRY_DEBUG_ARG(expr, arg) \
1119 PKIX_DEBUG_ARG(expr, arg)
1120 #else
1121 #define PKIX_CRLENTRY_DEBUG(expr)
1122 #define PKIX_CRLENTRY_DEBUG_ARG(expr, arg)
1123 #endif
1125 #if PKIX_CRLSELECTORDEBUG
1126 #define PKIX_CRLSELECTOR_DEBUG(expr) \
1127 PKIX_DEBUG(expr)
1128 #define PKIX_CRLSELECTOR_DEBUG_ARG(expr, arg) \
1129 PKIX_DEBUG_ARG(expr, arg)
1130 #else
1131 #define PKIX_CRLSELECTOR_DEBUG(expr)
1132 #define PKIX_CRLSELECTOR_DEBUG_ARG(expr, arg)
1133 #endif
1135 #if PKIX_COMCRLSELPARAMSDEBUG
1136 #define PKIX_COMCRLSELPARAMS_DEBUG(expr) \
1137 PKIX_DEBUG(expr)
1138 #define PKIX_COMCRLSELPARAMS_DEBUG_ARG(expr, arg) \
1139 PKIX_DEBUG_ARG(expr, arg)
1140 #else
1141 #define PKIX_COMCRLSELPARAMS_DEBUG(expr)
1142 #define PKIX_COMCRLSELPARAMS_DEBUG_ARG(expr, arg)
1143 #endif
1145 #if PKIX_CERTSTOREDEBUG
1146 #define PKIX_CERTSTORE_DEBUG(expr) \
1147 PKIX_DEBUG(expr)
1148 #define PKIX_CERTSTORE_DEBUG_ARG(expr, arg) \
1149 PKIX_DEBUG_ARG(expr, arg)
1150 #else
1151 #define PKIX_CERTSTORE_DEBUG(expr)
1152 #define PKIX_CERTSTORE_DEBUG_ARG(expr, arg)
1153 #endif
1155 #if PKIX_COLLECTIONCERTSTORECONTEXTDEBUG
1156 #define PKIX_COLLECTIONCERTSTORECONTEXT_DEBUG(expr) \
1157 PKIX_DEBUG(expr)
1158 #define PKIX_COLLECTIONCERTSTORECONTEXT_DEBUG_ARG(expr, arg) \
1159 PKIX_DEBUG_ARG(expr, arg)
1160 #else
1161 #define PKIX_COLLECTIONCERTSTORECONTEXT_DEBUG(expr)
1162 #define PKIX_COLLECTIONCERTSTORECONTEXT_DEBUG_ARG(expr, arg)
1163 #endif
1165 #if PKIX_DEFAULTCRLCHECKERSTATEDEBUG
1166 #define PKIX_DEFAULTCRLCHECKERSTATE_DEBUG(expr) \
1167 PKIX_DEBUG(expr)
1168 #define PKIX_DEFAULTCRLCHECKERSTATE_DEBUG_ARG(expr, arg) \
1169 PKIX_DEBUG_ARG(expr, arg)
1170 #else
1171 #define PKIX_DEFAULTCRLCHECKERSTATE_DEBUG(expr)
1172 #define PKIX_DEFAULTCRLCHECKERSTATE_DEBUG_ARG(expr, arg)
1173 #endif
1175 #if PKIX_CERTPOLICYMAPDEBUG
1176 #define PKIX_CERTPOLICYMAP_DEBUG(expr) \
1177 PKIX_DEBUG(expr)
1178 #define PKIX_CERTPOLICYMAP_DEBUG_ARG(expr, arg) \
1179 PKIX_DEBUG_ARG(expr, arg)
1180 #else
1181 #define PKIX_CERTPOLICYMAP_DEBUG(expr)
1182 #define PKIX_CERTPOLICYMAP_DEBUG_ARG(expr, arg)
1183 #endif
1185 #if PKIX_BUILDRESULTDEBUG
1186 #define PKIX_BUILDRESULT_DEBUG(expr) \
1187 PKIX_DEBUG(expr)
1188 #define PKIX_BUILDRESULT_DEBUG_ARG(expr, arg) \
1189 PKIX_DEBUG_ARG(expr, arg)
1190 #else
1191 #define PKIX_BUILDRESULT_DEBUG(expr)
1192 #define PKIX_BUILDRESULT_DEBUG_ARG(expr, arg)
1193 #endif
1195 #if PKIX_FORWARDBUILDERSTATEDEBUG
1196 #define PKIX_FORWARDBUILDERSTATE_DEBUG(expr) \
1197 PKIX_DEBUG(expr)
1198 #define PKIX_FORWARDBUILDERSTATE_DEBUG_ARG(expr, arg) \
1199 PKIX_DEBUG_ARG(expr, arg)
1200 #else
1201 #define PKIX_FORWARDBUILDERSTATE_DEBUG(expr)
1202 #define PKIX_FORWARDBUILDERSTATE_DEBUG_ARG(expr, arg)
1203 #endif
1205 #if PKIX_SIGNATURECHECKERSTATEDEBUG
1206 #define PKIX_SIGNATURECHECKERSTATE_DEBUG(expr) \
1207 PKIX_DEBUG(expr)
1208 #define PKIX_SIGNATURECHECKERSTATE_DEBUG_ARG(expr, arg) \
1209 PKIX_DEBUG_ARG(expr, arg)
1210 #else
1211 #define PKIX_SIGNATURECHECKERSTATE_DEBUG(expr)
1212 #define PKIX_SIGNATURECHECKERSTATE_DEBUG_ARG(expr, arg)
1213 #endif
1215 #if PKIX_USERDEFINEDMODULESDEBUG
1216 #define PKIX_USERDEFINEDMODULES_DEBUG(expr) \
1217 PKIX_DEBUG(expr)
1218 #define PKIX_USERDEFINEDMODULES_DEBUG_ARG(expr, arg) \
1219 PKIX_DEBUG_ARG(expr, arg)
1220 #else
1221 #define PKIX_USERDEFINEDMODULES_DEBUG(expr)
1222 #define PKIX_USERDEFINEDMODULES_DEBUG_ARG(expr, arg)
1223 #endif
1225 #if PKIX_CONTEXTDEBUG
1226 #define PKIX_CONTEXT_DEBUG(expr) \
1227 PKIX_DEBUG(expr)
1228 #define PKIX_CONTEXT_DEBUG_ARG(expr, arg) \
1229 PKIX_DEBUG_ARG(expr, arg)
1230 #else
1231 #define PKIX_CONTEXT_DEBUG(expr)
1232 #define PKIX_CONTEXT_DEBUG_ARG(expr, arg)
1233 #endif
1235 #if PKIX_DEFAULTREVOCATIONCHECKERDEBUG
1236 #define PKIX_DEFAULTREVOCATIONCHECKER_DEBUG(expr) \
1237 PKIX_DEBUG(expr)
1238 #define PKIX_DEFAULTREVOCATIONCHECKER_DEBUG_ARG(expr, arg) \
1239 PKIX_DEBUG_ARG(expr, arg)
1240 #else
1241 #define PKIX_DEFAULTREVOCATIONCHECKER_DEBUG(expr)
1242 #define PKIX_DEFAULTREVOCATIONCHECKER_DEBUG_ARG(expr, arg)
1243 #endif
1245 #if PKIX_LDAPREQUESTDEBUG
1246 #define PKIX_LDAPREQUEST_DEBUG(expr) \
1247 PKIX_DEBUG(expr)
1248 #define PKIX_LDAPREQUEST_DEBUG_ARG(expr, arg) \
1249 PKIX_DEBUG_ARG(expr, arg)
1250 #else
1251 #define PKIX_LDAPREQUEST_DEBUG(expr)
1252 #define PKIX_LDAPREQUEST_DEBUG_ARG(expr, arg)
1253 #endif
1255 #if PKIX_LDAPRESPONSEDEBUG
1256 #define PKIX_LDAPRESPONSE_DEBUG(expr) \
1257 PKIX_DEBUG(expr)
1258 #define PKIX_LDAPRESPONSE_DEBUG_ARG(expr, arg) \
1259 PKIX_DEBUG_ARG(expr, arg)
1260 #else
1261 #define PKIX_LDAPRESPONSE_DEBUG(expr)
1262 #define PKIX_LDAPRESPONSE_DEBUG_ARG(expr, arg)
1263 #endif
1265 #if PKIX_LDAPCLIENTDEBUG
1266 #define PKIX_LDAPCLIENT_DEBUG(expr) \
1267 PKIX_DEBUG(expr)
1268 #define PKIX_LDAPCLIENT_DEBUG_ARG(expr, arg) \
1269 PKIX_DEBUG_ARG(expr, arg)
1270 #else
1271 #define PKIX_LDAPCLIENT_DEBUG(expr)
1272 #define PKIX_LDAPCLIENT_DEBUG_ARG(expr, arg)
1273 #endif
1275 #if PKIX_LDAPDEFAULTCLIENTDEBUG
1276 #define PKIX_LDAPDEFAULTCLIENT_DEBUG(expr) \
1277 PKIX_DEBUG(expr)
1278 #define PKIX_LDAPDEFAULTCLIENT_DEBUG_ARG(expr, arg) \
1279 PKIX_DEBUG_ARG(expr, arg)
1280 #else
1281 #define PKIX_LDAPDEFAULTCLIENT_DEBUG(expr)
1282 #define PKIX_LDAPDEFAULTCLIENT_DEBUG_ARG(expr, arg)
1283 #endif
1285 #if PKIX_SOCKETDEBUG
1286 #define PKIX_SOCKET_DEBUG(expr) \
1287 PKIX_DEBUG(expr)
1288 #define PKIX_SOCKET_DEBUG_ARG(expr, arg) \
1289 PKIX_DEBUG_ARG(expr, arg)
1290 #else
1291 #define PKIX_SOCKET_DEBUG(expr)
1292 #define PKIX_SOCKET_DEBUG_ARG(expr, arg)
1293 #endif
1295 #if PKIX_RESOURCELIMITSDEBUG
1296 #define PKIX_RESOURCELIMITS_DEBUG(expr) \
1297 PKIX_DEBUG(expr)
1298 #define PKIX_RESOURCELIMITS_DEBUG_ARG(expr, arg) \
1299 PKIX_DEBUG_ARG(expr, arg)
1300 #else
1301 #define PKIX_RESOURCELIMITS_DEBUG(expr)
1302 #define PKIX_RESOURCELIMITS_DEBUG_ARG(expr, arg)
1303 #endif
1305 #if PKIX_LOGGERDEBUG
1306 #define PKIX_LOGGER_DEBUG(expr) \
1307 PKIX_DEBUG(expr)
1308 #define PKIX_LOGGER_DEBUG_ARG(expr, arg) \
1309 PKIX_DEBUG_ARG(expr, arg)
1310 #else
1311 #define PKIX_LOGGER_DEBUG(expr)
1312 #define PKIX_LOGGER_DEBUG_ARG(expr, arg)
1313 #endif
1315 #if PKIX_MONITORLOCKDEBUG
1316 #define PKIX_MONITORLOCK_DEBUG(expr) \
1317 PKIX_DEBUG(expr)
1318 #define PKIX_MONITORLOCK_DEBUG_ARG(expr, arg) \
1319 PKIX_DEBUG_ARG(expr, arg)
1320 #else
1321 #define PKIX_MONITORLOCK_DEBUG(expr)
1322 #define PKIX_MONITORLOCK_DEBUG_ARG(expr, arg)
1323 #endif
1325 #if PKIX_INFOACCESSDEBUG
1326 #define PKIX_INFOACCESS_DEBUG(expr) \
1327 PKIX_DEBUG(expr)
1328 #define PKIX_INFOACCESS_DEBUG_ARG(expr, arg) \
1329 PKIX_DEBUG_ARG(expr, arg)
1330 #else
1331 #define PKIX_INFOACCESS_DEBUG(expr)
1332 #define PKIX_INFOACCESS_DEBUG_ARG(expr, arg)
1333 #endif
1335 #if PKIX_AIAMGRDEBUG
1336 #define PKIX_AIAMGR_DEBUG(expr) \
1337 PKIX_DEBUG(expr)
1338 #define PKIX_AIAMGR_DEBUG_ARG(expr, arg) \
1339 PKIX_DEBUG_ARG(expr, arg)
1340 #else
1341 #define PKIX_AIAMGR_DEBUG(expr)
1342 #define PKIX_AIAMGR_DEBUG_ARG(expr, arg)
1343 #endif
1345 #if PKIX_OCSPCHECKERDEBUG
1346 #define PKIX_OCSPCHECKER_DEBUG(expr) \
1347 PKIX_DEBUG(expr)
1348 #define PKIX_OCSPCHECKER_DEBUG_ARG(expr, arg) \
1349 PKIX_DEBUG_ARG(expr, arg)
1350 #else
1351 #define PKIX_OCSPCHECKER_DEBUG(expr)
1352 #define PKIX_OCSPCHECKER_DEBUG_ARG(expr, arg)
1353 #endif
1355 #if PKIX_OCSPCERTIDDEBUG
1356 #define PKIX_OCSPCERTID_DEBUG(expr) \
1357 PKIX_DEBUG(expr)
1358 #define PKIX_OCSPCERTID_DEBUG_ARG(expr, arg) \
1359 PKIX_DEBUG_ARG(expr, arg)
1360 #else
1361 #define PKIX_OCSPCERTID_DEBUG(expr)
1362 #define PKIX_OCSPCERTID_DEBUG_ARG(expr, arg)
1363 #endif
1365 #if PKIX_OCSPREQUESTDEBUG
1366 #define PKIX_OCSPREQUEST_DEBUG(expr) \
1367 PKIX_DEBUG(expr)
1368 #define PKIX_OCSPREQUEST_DEBUG_ARG(expr, arg) \
1369 PKIX_DEBUG_ARG(expr, arg)
1370 #else
1371 #define PKIX_OCSPREQUEST_DEBUG(expr)
1372 #define PKIX_OCSPREQUEST_DEBUG_ARG(expr, arg)
1373 #endif
1375 #if PKIX_OCSPRESPONSEDEBUG
1376 #define PKIX_OCSPRESPONSE_DEBUG(expr) \
1377 PKIX_DEBUG(expr)
1378 #define PKIX_OCSPRESPONSE_DEBUG_ARG(expr, arg) \
1379 PKIX_DEBUG_ARG(expr, arg)
1380 #else
1381 #define PKIX_OCSPRESPONSE_DEBUG(expr)
1382 #define PKIX_OCSPRESPONSE_DEBUG_ARG(expr, arg)
1383 #endif
1385 #if PKIX_HTTPDEFAULTCLIENTDEBUG
1386 #define PKIX_HTTPDEFAULTCLIENT_DEBUG(expr) \
1387 PKIX_DEBUG(expr)
1388 #define PKIX_HTTPDEFAULTCLIENT_DEBUG_ARG(expr, arg) \
1389 PKIX_DEBUG_ARG(expr, arg)
1390 #else
1391 #define PKIX_HTTPDEFAULTCLIENT_DEBUG(expr)
1392 #define PKIX_HTTPDEFAULTCLIENT_DEBUG_ARG(expr, arg)
1393 #endif
1395 #if PKIX_HTTPCERTSTORECONTEXTDEBUG
1396 #define PKIX_HTTPCERTSTORECONTEXT_DEBUG(expr) \
1397 PKIX_DEBUG(expr)
1398 #define PKIX_HTTPCERTSTORECONTEXT_DEBUG_ARG(expr, arg) \
1399 PKIX_DEBUG_ARG(expr, arg)
1400 #else
1401 #define PKIX_HTTPCERTSTORECONTEXT_DEBUG(expr)
1402 #define PKIX_HTTPCERTSTORECONTEXT_DEBUG_ARG(expr, arg)
1403 #endif
1405 #if PKIX_VERIFYNODEDEBUG
1406 #define PKIX_VERIFYNODE_DEBUG(expr) \
1407 PKIX_DEBUG(expr)
1408 #define PKIX_VERIFYNODE_DEBUG_ARG(expr, arg) \
1409 PKIX_DEBUG_ARG(expr, arg)
1410 #else
1411 #define PKIX_VERIFYNODE_DEBUG(expr)
1412 #define PKIX_VERIFYNODE_DEBUG_ARG(expr, arg)
1413 #endif
1415 #if PKIX_EKUCHECKER
1416 #define PKIX_EKUCHECKER_DEBUG(expr) \
1417 PKIX_DEBUG(expr)
1418 #define PKIX_EKUCHECKER_DEBUG_ARG(expr, arg) \
1419 PKIX_DEBUG_ARG(expr, arg)
1420 #else
1421 #define PKIX_EKUCHECKER_DEBUG(expr)
1422 #define PKIX_EKUCHECKER_DEBUG_ARG(expr, arg)
1423 #endif
1425 #if PKIX_CERTVFYPKIXDEBUG
1426 #define PKIX_CERTVFYPKIX_DEBUG(expr) \
1427 PKIX_DEBUG(expr)
1428 #define PKIX_CERTVFYPKIX_DEBUG_ARG(expr, arg) \
1429 PKIX_DEBUG_ARG(expr, arg)
1430 #else
1431 #define PKIX_CERTVFYPKIX_DEBUG(expr)
1432 #define PKIX_CERTVFYPKIX_DEBUG_ARG(expr, arg)
1433 #endif
1436 * All object types register themselves with the system using a
1437 * pkix_ClassTable_Entry, which consists of a set of functions for that
1438 * type and an ASCII string (char *) which is used by the default
1439 * ToStringCallback (if necessary). System types register themselves directly
1440 * when their respective PKIX_"type"_RegisterSelf functions are called.
1441 * User-defined types can be registered using PKIX_PL_Object_RegisterType.
1442 * (see comments in pkix_pl_system.h)
1445 typedef struct pkix_ClassTable_EntryStruct pkix_ClassTable_Entry;
1446 struct pkix_ClassTable_EntryStruct {
1447 char *description;
1448 PKIX_Int32 objCounter;
1449 PKIX_Int32 typeObjectSize;
1450 PKIX_PL_DestructorCallback destructor;
1451 PKIX_PL_EqualsCallback equalsFunction;
1452 PKIX_PL_HashcodeCallback hashcodeFunction;
1453 PKIX_PL_ToStringCallback toStringFunction;
1454 PKIX_PL_ComparatorCallback comparator;
1455 PKIX_PL_DuplicateCallback duplicateFunction;
1459 * PKIX_ERRORCLASSNAMES is an array of strings, with each string holding a
1460 * descriptive name for an error code. This is used by the default
1461 * PKIX_PL_Error_ToString function.
1463 extern const char *PKIX_ERRORCLASSNAMES[PKIX_NUMERRORCLASSES];
1465 #define MAX_STACK_DEPTH 1000
1467 extern PRLogModuleInfo *pkixLog;
1469 #define PKIX_MAGIC_HEADER (PKIX_UInt32) 0xBEEFC0DE
1470 #define PKIX_MAGIC_HEADER_DESTROYED (PKIX_UInt32) 0xDEADC0DE
1472 /* see source file for function documentation */
1474 PKIX_Error *
1475 pkix_IsCertSelfIssued(
1476 PKIX_PL_Cert *cert,
1477 PKIX_Boolean *pSelfIssued,
1478 void *plContext);
1480 PKIX_Error *
1481 pkix_Throw(
1482 PKIX_ERRORCLASS errClass,
1483 const char *funcName,
1484 PKIX_ERRORCODE errorTextCode,
1485 PKIX_ERRORCLASS overrideClass,
1486 PKIX_Error *cause,
1487 PKIX_Error **pError,
1488 void *plContext);
1490 PKIX_Error *
1491 pkix_CheckTypes(
1492 PKIX_PL_Object *first,
1493 PKIX_PL_Object *second,
1494 PKIX_UInt32 type,
1495 void *plContext);
1497 PKIX_Error *
1498 pkix_CheckType(
1499 PKIX_PL_Object *object,
1500 PKIX_UInt32 type,
1501 void *plContext);
1503 PKIX_Error *
1504 pkix_hash(
1505 const unsigned char *bytes,
1506 PKIX_UInt32 length,
1507 PKIX_UInt32 *hash,
1508 void *plContext);
1510 PKIX_Error *
1511 pkix_duplicateImmutable(
1512 PKIX_PL_Object *object,
1513 PKIX_PL_Object **pNewObject,
1514 void *plContext);
1516 PKIX_UInt32
1517 pkix_countArray(void **array);
1519 PKIX_UInt32
1520 pkix_hex2i(char c);
1522 char
1523 pkix_i2hex(char c);
1525 PKIX_Boolean
1526 pkix_isPlaintext(unsigned char c, PKIX_Boolean debug);
1528 PKIX_Error *
1529 pkix_CacheCertChain_Lookup(
1530 PKIX_PL_Cert* targetCert,
1531 PKIX_List* anchors,
1532 PKIX_PL_Date *testDate,
1533 PKIX_Boolean *pFound,
1534 PKIX_BuildResult **pBuildResult,
1535 void *plContext);
1537 PKIX_Error *
1538 pkix_CacheCertChain_Remove(
1539 PKIX_PL_Cert* targetCert,
1540 PKIX_List* anchors,
1541 void *plContext);
1543 PKIX_Error *
1544 pkix_CacheCertChain_Add(
1545 PKIX_PL_Cert* targetCert,
1546 PKIX_List* anchors,
1547 PKIX_PL_Date *validityDate,
1548 PKIX_BuildResult *buildResult,
1549 void *plContext);
1551 PKIX_Error *
1552 pkix_CacheCert_Lookup(
1553 PKIX_CertStore *store,
1554 PKIX_ComCertSelParams *certSelParams,
1555 PKIX_PL_Date *testDate,
1556 PKIX_Boolean *pFound,
1557 PKIX_List** pCerts,
1558 void *plContext);
1560 PKIX_Error *
1561 pkix_CacheCert_Add(
1562 PKIX_CertStore *store,
1563 PKIX_ComCertSelParams *certSelParams,
1564 PKIX_List* certs,
1565 void *plContext);
1567 PKIX_Error *
1568 pkix_CacheCrlEntry_Lookup(
1569 PKIX_CertStore *store,
1570 PKIX_PL_X500Name *certIssuer,
1571 PKIX_PL_BigInt *certSerialNumber,
1572 PKIX_Boolean *pFound,
1573 PKIX_List** pCrlEntryList,
1574 void *plContext);
1576 PKIX_Error *
1577 pkix_CacheCrlEntry_Add(
1578 PKIX_CertStore *store,
1579 PKIX_PL_X500Name *certIssuer,
1580 PKIX_PL_BigInt *certSerialNumber,
1581 PKIX_List* crlEntryList,
1582 void *plContext);
1584 #ifdef PR_LOGGING
1585 void
1586 pkix_trace_dump_cert(
1587 const char *info,
1588 PKIX_PL_Cert *cert,
1589 void *plContext);
1590 #endif
1592 #ifdef __cplusplus
1594 #endif
1596 #endif /* _PKIX_TOOLS_H */