andre@0: /* This Source Code Form is subject to the terms of the Mozilla Public andre@0: * License, v. 2.0. If a copy of the MPL was not distributed with this andre@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ andre@0: /* andre@0: * pkix_build.h andre@0: * andre@0: * Header file for buildChain function andre@0: * andre@0: */ andre@0: andre@0: #ifndef _PKIX_BUILD_H andre@0: #define _PKIX_BUILD_H andre@0: #include "pkix_tools.h" andre@0: #ifndef NSS_PKIX_NO_LDAP andre@0: #include "pkix_pl_ldapt.h" andre@0: #endif andre@0: #include "pkix_ekuchecker.h" andre@0: andre@0: #ifdef __cplusplus andre@0: extern "C" { andre@0: #endif andre@0: andre@0: typedef enum { andre@0: BUILD_SHORTCUTPENDING, andre@0: BUILD_INITIAL, andre@0: BUILD_TRYAIA, andre@0: BUILD_AIAPENDING, andre@0: BUILD_COLLECTINGCERTS, andre@0: BUILD_GATHERPENDING, andre@0: BUILD_CERTVALIDATING, andre@0: BUILD_ABANDONNODE, andre@0: BUILD_DATEPREP, andre@0: BUILD_CHECKTRUSTED, andre@0: BUILD_CHECKTRUSTED2, andre@0: BUILD_ADDTOCHAIN, andre@0: BUILD_VALCHAIN, andre@0: BUILD_VALCHAIN2, andre@0: BUILD_EXTENDCHAIN, andre@0: BUILD_GETNEXTCERT andre@0: } BuildStatus; andre@0: andre@0: typedef struct BuildConstantsStruct BuildConstants; andre@0: andre@0: /* andre@0: * These fields (the ones that are objects) are not reference-counted andre@0: * in *each* state, but only in the root, the state that has no parent. andre@0: * That saves time in creation and destruction of child states, but is andre@0: * safe enough since they are constants. andre@0: */ andre@0: struct BuildConstantsStruct { andre@0: PKIX_UInt32 numAnchors; andre@0: PKIX_UInt32 numCertStores; andre@0: PKIX_UInt32 numHintCerts; andre@0: PKIX_UInt32 maxDepth; andre@0: PKIX_UInt32 maxFanout; andre@0: PKIX_UInt32 maxTime; andre@0: PKIX_ProcessingParams *procParams; andre@0: PKIX_PL_Date *testDate; andre@0: PKIX_PL_Date *timeLimit; andre@0: PKIX_PL_Cert *targetCert; andre@0: PKIX_PL_PublicKey *targetPubKey; andre@0: PKIX_List *certStores; andre@0: PKIX_List *anchors; andre@0: PKIX_List *userCheckers; andre@0: PKIX_List *hintCerts; andre@0: PKIX_RevocationChecker *revChecker; andre@0: PKIX_PL_AIAMgr *aiaMgr; andre@0: PKIX_Boolean useAIAForCertFetching; andre@0: PKIX_Boolean trustOnlyUserAnchors; andre@0: }; andre@0: andre@0: struct PKIX_ForwardBuilderStateStruct{ andre@0: BuildStatus status; andre@0: PKIX_Int32 traversedCACerts; andre@0: PKIX_UInt32 certStoreIndex; andre@0: PKIX_UInt32 numCerts; andre@0: PKIX_UInt32 numAias; andre@0: PKIX_UInt32 certIndex; andre@0: PKIX_UInt32 aiaIndex; andre@0: PKIX_UInt32 certCheckedIndex; andre@0: PKIX_UInt32 checkerIndex; andre@0: PKIX_UInt32 hintCertIndex; andre@0: PKIX_UInt32 numFanout; andre@0: PKIX_UInt32 numDepth; andre@0: PKIX_UInt32 reasonCode; andre@0: PKIX_Boolean canBeCached; andre@0: PKIX_Boolean useOnlyLocal; andre@0: PKIX_Boolean revChecking; andre@0: PKIX_Boolean usingHintCerts; andre@0: PKIX_Boolean certLoopingDetected; andre@0: PKIX_PL_Date *validityDate; andre@0: PKIX_PL_Cert *prevCert; andre@0: PKIX_PL_Cert *candidateCert; andre@0: PKIX_List *traversedSubjNames; andre@0: PKIX_List *trustChain; andre@0: PKIX_List *aia; andre@0: PKIX_List *candidateCerts; andre@0: PKIX_List *reversedCertChain; andre@0: PKIX_List *checkedCritExtOIDs; andre@0: PKIX_List *checkerChain; andre@0: PKIX_CertSelector *certSel; andre@0: PKIX_VerifyNode *verifyNode; andre@0: void *client; /* messageHandler, such as LDAPClient */ andre@0: PKIX_ForwardBuilderState *parentState; andre@0: BuildConstants buildConstants; andre@0: }; andre@0: andre@0: /* --Private-Functions-------------------------------------------- */ andre@0: andre@0: PKIX_Error * andre@0: pkix_ForwardBuilderState_RegisterSelf(void *plContext); andre@0: andre@0: PKIX_Error * andre@0: PKIX_Build_GetNBIOContext(void *state, void **pNBIOContext, void *plContext); andre@0: andre@0: #ifdef __cplusplus andre@0: } andre@0: #endif andre@0: andre@0: #endif /* _PKIX_BUILD_H */