Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | /* |
michael@0 | 5 | * pkix_build.h |
michael@0 | 6 | * |
michael@0 | 7 | * Header file for buildChain function |
michael@0 | 8 | * |
michael@0 | 9 | */ |
michael@0 | 10 | |
michael@0 | 11 | #ifndef _PKIX_BUILD_H |
michael@0 | 12 | #define _PKIX_BUILD_H |
michael@0 | 13 | #include "pkix_tools.h" |
michael@0 | 14 | #ifndef NSS_PKIX_NO_LDAP |
michael@0 | 15 | #include "pkix_pl_ldapt.h" |
michael@0 | 16 | #endif |
michael@0 | 17 | #include "pkix_ekuchecker.h" |
michael@0 | 18 | |
michael@0 | 19 | #ifdef __cplusplus |
michael@0 | 20 | extern "C" { |
michael@0 | 21 | #endif |
michael@0 | 22 | |
michael@0 | 23 | typedef enum { |
michael@0 | 24 | BUILD_SHORTCUTPENDING, |
michael@0 | 25 | BUILD_INITIAL, |
michael@0 | 26 | BUILD_TRYAIA, |
michael@0 | 27 | BUILD_AIAPENDING, |
michael@0 | 28 | BUILD_COLLECTINGCERTS, |
michael@0 | 29 | BUILD_GATHERPENDING, |
michael@0 | 30 | BUILD_CERTVALIDATING, |
michael@0 | 31 | BUILD_ABANDONNODE, |
michael@0 | 32 | BUILD_DATEPREP, |
michael@0 | 33 | BUILD_CHECKTRUSTED, |
michael@0 | 34 | BUILD_CHECKTRUSTED2, |
michael@0 | 35 | BUILD_ADDTOCHAIN, |
michael@0 | 36 | BUILD_VALCHAIN, |
michael@0 | 37 | BUILD_VALCHAIN2, |
michael@0 | 38 | BUILD_EXTENDCHAIN, |
michael@0 | 39 | BUILD_GETNEXTCERT |
michael@0 | 40 | } BuildStatus; |
michael@0 | 41 | |
michael@0 | 42 | typedef struct BuildConstantsStruct BuildConstants; |
michael@0 | 43 | |
michael@0 | 44 | /* |
michael@0 | 45 | * These fields (the ones that are objects) are not reference-counted |
michael@0 | 46 | * in *each* state, but only in the root, the state that has no parent. |
michael@0 | 47 | * That saves time in creation and destruction of child states, but is |
michael@0 | 48 | * safe enough since they are constants. |
michael@0 | 49 | */ |
michael@0 | 50 | struct BuildConstantsStruct { |
michael@0 | 51 | PKIX_UInt32 numAnchors; |
michael@0 | 52 | PKIX_UInt32 numCertStores; |
michael@0 | 53 | PKIX_UInt32 numHintCerts; |
michael@0 | 54 | PKIX_UInt32 maxDepth; |
michael@0 | 55 | PKIX_UInt32 maxFanout; |
michael@0 | 56 | PKIX_UInt32 maxTime; |
michael@0 | 57 | PKIX_ProcessingParams *procParams; |
michael@0 | 58 | PKIX_PL_Date *testDate; |
michael@0 | 59 | PKIX_PL_Date *timeLimit; |
michael@0 | 60 | PKIX_PL_Cert *targetCert; |
michael@0 | 61 | PKIX_PL_PublicKey *targetPubKey; |
michael@0 | 62 | PKIX_List *certStores; |
michael@0 | 63 | PKIX_List *anchors; |
michael@0 | 64 | PKIX_List *userCheckers; |
michael@0 | 65 | PKIX_List *hintCerts; |
michael@0 | 66 | PKIX_RevocationChecker *revChecker; |
michael@0 | 67 | PKIX_PL_AIAMgr *aiaMgr; |
michael@0 | 68 | PKIX_Boolean useAIAForCertFetching; |
michael@0 | 69 | PKIX_Boolean trustOnlyUserAnchors; |
michael@0 | 70 | }; |
michael@0 | 71 | |
michael@0 | 72 | struct PKIX_ForwardBuilderStateStruct{ |
michael@0 | 73 | BuildStatus status; |
michael@0 | 74 | PKIX_Int32 traversedCACerts; |
michael@0 | 75 | PKIX_UInt32 certStoreIndex; |
michael@0 | 76 | PKIX_UInt32 numCerts; |
michael@0 | 77 | PKIX_UInt32 numAias; |
michael@0 | 78 | PKIX_UInt32 certIndex; |
michael@0 | 79 | PKIX_UInt32 aiaIndex; |
michael@0 | 80 | PKIX_UInt32 certCheckedIndex; |
michael@0 | 81 | PKIX_UInt32 checkerIndex; |
michael@0 | 82 | PKIX_UInt32 hintCertIndex; |
michael@0 | 83 | PKIX_UInt32 numFanout; |
michael@0 | 84 | PKIX_UInt32 numDepth; |
michael@0 | 85 | PKIX_UInt32 reasonCode; |
michael@0 | 86 | PKIX_Boolean canBeCached; |
michael@0 | 87 | PKIX_Boolean useOnlyLocal; |
michael@0 | 88 | PKIX_Boolean revChecking; |
michael@0 | 89 | PKIX_Boolean usingHintCerts; |
michael@0 | 90 | PKIX_Boolean certLoopingDetected; |
michael@0 | 91 | PKIX_PL_Date *validityDate; |
michael@0 | 92 | PKIX_PL_Cert *prevCert; |
michael@0 | 93 | PKIX_PL_Cert *candidateCert; |
michael@0 | 94 | PKIX_List *traversedSubjNames; |
michael@0 | 95 | PKIX_List *trustChain; |
michael@0 | 96 | PKIX_List *aia; |
michael@0 | 97 | PKIX_List *candidateCerts; |
michael@0 | 98 | PKIX_List *reversedCertChain; |
michael@0 | 99 | PKIX_List *checkedCritExtOIDs; |
michael@0 | 100 | PKIX_List *checkerChain; |
michael@0 | 101 | PKIX_CertSelector *certSel; |
michael@0 | 102 | PKIX_VerifyNode *verifyNode; |
michael@0 | 103 | void *client; /* messageHandler, such as LDAPClient */ |
michael@0 | 104 | PKIX_ForwardBuilderState *parentState; |
michael@0 | 105 | BuildConstants buildConstants; |
michael@0 | 106 | }; |
michael@0 | 107 | |
michael@0 | 108 | /* --Private-Functions-------------------------------------------- */ |
michael@0 | 109 | |
michael@0 | 110 | PKIX_Error * |
michael@0 | 111 | pkix_ForwardBuilderState_RegisterSelf(void *plContext); |
michael@0 | 112 | |
michael@0 | 113 | PKIX_Error * |
michael@0 | 114 | PKIX_Build_GetNBIOContext(void *state, void **pNBIOContext, void *plContext); |
michael@0 | 115 | |
michael@0 | 116 | #ifdef __cplusplus |
michael@0 | 117 | } |
michael@0 | 118 | #endif |
michael@0 | 119 | |
michael@0 | 120 | #endif /* _PKIX_BUILD_H */ |