/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* Used for initialization of extension handles for crl and certs
* extensions from existing CRL data then modifying existing CRL.*/ extern SECStatus CRLGEN_ExtHandleInit(CRLGENGeneratorData *crlGenData);
/* Commits all added entries and their's extensions into CRL. */ extern SECStatus CRLGEN_CommitExtensionsAndEntries(CRLGENGeneratorData *crlGenData);
/* Parser initialization function. Creates CRLGENGeneratorData structure
* for the current thread */ extern CRLGENGeneratorData *CRLGEN_InitCrlGeneration(CERTSignedCrl *newCrl,
PRFileDesc *src);
/* This lock is defined in crlgen_lex.c(derived from crlgen_lex.l). *Itcontrolsaccesstoinvocationofyylex,allowstoparseone
* script at a time */ externvoid CRLGEN_InitCrlGenParserLock(); externvoid CRLGEN_DestroyCrlGenParserLock();
/* The following function types are used to define functions for each of *CRLGENExtensionEntryStr,CRLGENCertEntrySrt,CRLGENCrlFieldStrto
* provide functionality needed for these structures*/ typedef SECStatus updateCrlFn_t(CRLGENGeneratorData *crlGenData, void *str); typedef SECStatus setNextDataFn_t(CRLGENGeneratorData *crlGenData, void *str, void *data, unsignedshort dtype); typedef SECStatus createNewLangStructFn_t(CRLGENGeneratorData *crlGenData, void *str, unsigned i);
/* Sets reports failure to parser if anything goes wrong */ externvoid crlgen_setFailure(CRLGENGeneratorData *str, char *);
/* Collects data in to one of the current data structure that corresponds *tothecorrectcontexttype.Thisfunctiongetscalledaftereachtoken
* is found for a particular line */ extern SECStatus crlgen_setNextData(CRLGENGeneratorData *str, void *data, unsignedshort dtype);
/* initiates crl update with collected data. This function is called at the
* end of each line */ extern SECStatus crlgen_updateCrl(CRLGENGeneratorData *str);
/* Creates new context structure depending on token that was parsed
* at the beginning of a line */ extern SECStatus crlgen_createNewLangStruct(CRLGENGeneratorData *str, unsigned structType);
/* CRLGENExtensionEntry is used to store addext request data for either *CRLextensionsorCRLentryextensions.Thedifferentiationbetween *isbasedonorderandtypeofextensionbeenadded. *-extData:alldatainrequeststaringfromnameoftheextensionare *insavedhere. *-nextUpdatedData:counterofelementsaddedtoextData
*/ struct CRLGENExtensionEntryStr { char **extData; int nextUpdatedData;
updateCrlFn_t *updateCrlFn;
setNextDataFn_t *setNextDataFn;
};
/* CRLGENCeryestEntry is used to store addcert request data *-certId:certificateidorrangeofcertificatewithdashasadelimiter *Allcertsfromrangewillbeinclusivelyaddedtocrl *-revocationTime:revocationtimeofcert(s)
*/ struct CRLGENCertEntrySrt { char *certId; char *revocationTime;
updateCrlFn_t *updateCrlFn;
setNextDataFn_t *setNextDataFn;
};
/* CRLGENCrlField is used to store crl fields record like update time, next *updatetime,etc.
* - value: value of the parsed field data*/ struct CRLGENCrlFieldStr { char *value;
updateCrlFn_t *updateCrlFn;
setNextDataFn_t *setNextDataFn;
};
/* Can not create entries extension until completely done with parsing. *Thereforeneedtokeepjoineddata *-certId:serialnumberofcertificate *-extHandle:headpointertoalistofextensionsthatbelongto *entry
* - entry : CERTCrlEntry structure pointer*/ struct CRLGENEntryDataStr {
SECItem *certId; void *extHandle;
CERTCrlEntry *entry;
};
/* Crl generator/parser main structure. Keeps info regarding current state of *parser(context,status),parserhelperfunctionspointers,parseddataand *generateddata. *-contextId:currentparsingcontext.Contextinthisparserenvironment *defineswhattypeofcrloperationsparserisgoingthrough *inthecurrentlineofcrlgenerationscript. *settingornewcertoranextensionaddition,etc. *-createNewLangStructFn:pointertotoplevelfunctionwhichcreates *datastructuresaccordingcontextId *-setNextDataFn:pointertotoplevelfunctionwhichsetsnewparseddata *intemporarystructure *-updateCrlFn:pointertotoplevelfunctionwhichtriggersactual *crlupdatefunctionswithgathereddata *-union:dataunioncreateaccordingtocontextId *-rangeFrom,rangeTo:holdslastrangeinwhichcertswasadded *-newCrl:pointertoCERTSignedCrlnewlycreatedcrl *-crlExtHandle:pointertocrlextensionhandle *-entryDataHashTable:hashofCRLGENEntryData. *key:certserialnumber *data:CRLGENEntryDatapointer *-parserStatus:currentstatusofparser.Triggersparsertoabortwhen *settoSECFailure *-src:PRFileDescstructurepointerofcrlgeneratorconfigfile
* - parsedLineNum : currently parsing line. Keeping it to report errors */ struct CRLGENGeneratorDataStr { unsignedshort contextId;
CRLGENCrlField *crlField;
CRLGENCertEntry *certEntry;
CRLGENExtensionEntry *extensionEntry;
PRUint64 rangeFrom;
PRUint64 rangeTo;
CERTSignedCrl *signCrl; void *crlExtHandle;
PLHashTable *entryDataHashTable;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.