13 #ifndef _STREAM_DEFINED
14 #if defined( INC_ALL )
27 #define MIN_ATTRIBUTE_SIZE 12
35 #define MAX_CHAINLENGTH 16
37 #if MAX_CHAINLENGTH > FAILSAFE_ITERATIONS_MED
38 #error FAILSAFE_ITERATIONS_MED must be larger than the maximum certificate chain length
47 #define DEFAULT_SERIALNO_SIZE 8
48 #define SERIALNO_BUFSIZE 32
49 #define MAX_SERIALNO_SIZE 256
57 #define PKIUSER_AUTHENTICATOR_SIZE 12
58 #define PKIUSER_ENCR_AUTHENTICATOR_SIZE 32
62 #define ENCODING_FIFO_SIZE 10
70 #define MIN_CERT_TIME_VALUE ( ( 1996 - 1970 ) * 365 * 86400L )
105 #define CERT_FLAG_NONE 0x00
106 #define CERT_FLAG_SELFSIGNED 0x01
107 #define CERT_FLAG_SIGCHECKED 0x02
108 #define CERT_FLAG_DATAONLY 0x04
109 #define CERT_FLAG_CRLENTRY 0x08
110 #define CERT_FLAG_CERTCOLLECTION 0x10
111 #define CERT_FLAG_PATHKLUDGE 0x20
112 #define CERT_FLAG_MAX 0x3F
132 #define setErrorValues( locus, type ) \
133 *errorLocus = ( locus ); *errorType = ( type )
186 #define CHECKKEY_FLAG_NONE 0x00
187 #define CHECKKEY_FLAG_CA 0x01
188 #define CHECKKEY_FLAG_PRIVATEKEY 0x02
189 #define CHECKKEY_FLAG_GENCHECK 0x04
190 #define CHECKKEY_FLAG_MAX 0x07
209 #define PRE_SET_NONE 0x0000
210 #define PRE_SET_STANDARDATTR 0x0001
211 #define PRE_SET_ISSUERATTR 0x0002
212 #define PRE_SET_ISSUERDN 0x0004
213 #define PRE_SET_VALIDITYPERIOD 0x0008
214 #define PRE_SET_VALINFO 0x0010
215 #define PRE_SET_REVINFO 0x0020
217 #define PRE_SET_FLAG_NONE 0x0000
218 #define PRE_SET_FLAG_MAX 0x003F
245 #define PRE_CHECK_NONE 0x0000
246 #define PRE_CHECK_SPKI 0x0001
247 #define PRE_CHECK_DN 0x0002
248 #define PRE_CHECK_DN_PARTIAL 0x0004
249 #define PRE_CHECK_ISSUERDN 0x0008
250 #define PRE_CHECK_ISSUERCERTDN 0x0010
251 #define PRE_CHECK_NONSELFSIGNED_DN 0x0020
252 #define PRE_CHECK_SERIALNO 0x0040
253 #define PRE_CHECK_VALENTRIES 0x0080
254 #define PRE_CHECK_REVENTRIES 0x0100
256 #define PRE_CHECK_FLAG_NONE 0x0000
257 #define PRE_CHECK_FLAG_MAX 0x01FF
261 #define PRE_FLAG_NONE 0x0000
262 #define PRE_FLAG_DN_IN_ISSUERCERT 0x0001
263 #define PRE_FLAG_MAX 0x0001
267 #define CHECKDN_FLAG_NONE 0x00
268 #define CHECKDN_FLAG_COUNTRY 0x01
269 #define CHECKDN_FLAG_COMMONNAME 0x02
270 #define CHECKDN_FLAG_WELLFORMED 0x04
271 #define CHECKDN_FLAG_MAX 0x0F
335 #define ATTRIBUTE_PTR void
336 #define ATTRIBUTE_PTR_STORAGE char[ 64 ]
338 #define DN_PTR_STORAGE char[ 32 ]
364 #define initSelectionInfo( certInfoPtr ) \
365 memset( &( certInfoPtr )->currentSelection, 0, sizeof( SELECTION_INFO ) ); \
366 ( certInfoPtr )->currentSelection.dnPtr = &( ( certInfoPtr )->subjectName )
381 #define saveSelectionState( savedState, certInfoPtr ) \
383 memset( &( savedState ), 0, sizeof( SELECTION_STATE ) ); \
384 if( ( certInfoPtr )->type == CRYPT_CERTTYPE_CERTCHAIN ) \
385 ( savedState ).savedChainPos = ( certInfoPtr )->cCertCert->chainPos; \
386 ( savedState ).savedSelectionInfo = ( certInfoPtr )->currentSelection; \
387 ( savedState ).savedAttributeCursor = ( certInfoPtr )->attributeCursor; \
390 #define restoreSelectionState( savedState, certInfoPtr ) \
392 if( ( certInfoPtr )->type == CRYPT_CERTTYPE_CERTCHAIN ) \
393 ( certInfoPtr )->cCertCert->chainPos = ( savedState ).savedChainPos; \
394 ( certInfoPtr )->currentSelection = ( savedState ).savedSelectionInfo; \
395 ( certInfoPtr )->attributeCursor = ( savedState ).savedAttributeCursor; \
410 #if defined( USE_CERTLEVEL_PKIX_FULL )
412 #define MAX_POLICIES 16
413 #define MAX_POLICY_SIZE 32
423 POLICY_DATA policies[ MAX_POLICIES + 4 ];
441 time_t invalidityTime;
458 VALIDITY_INFO *validityInfo;
459 VALIDITY_INFO *currentValidity;
464 int responderUrlSize;
499 time_t revocationTime;
520 REVOCATION_INFO *revocations;
521 REVOCATION_INFO *currentRevocation;
525 time_t revocationTime;
530 int responderUrlSize;
574 BYTE pkiIssuePW[ 16 + 8 ];
576 BYTE pkiRevPW[ 16 + 8 ];
653 #ifdef USE_CERT_OBSOLETE
656 void *issuerUniqueID;
658 void *subjectUniqueID;
659 int issuerUniqueIDlength, subjectUniqueIDlength;
665 #define cCertCert certInfo.certInfo
666 #define cCertReq certInfo.reqInfo
667 #define cCertRev certInfo.revInfo
668 #define cCertVal certInfo.valInfo
669 #define cCertUser certInfo.pkiUserInfo
683 CERT_REQ_INFO *reqInfo;
686 CERT_REV_INFO *revInfo;
689 CERT_VAL_INFO *valInfo;
692 CERT_PKIUSER_INFO *pkiUserInfo;
839 #define isDNSelectionComponent( certInfoType ) \
840 ( ( certInfoType ) == CRYPT_CERTINFO_ISSUERNAME || \
841 ( certInfoType ) == CRYPT_CERTINFO_SUBJECTNAME || \
842 ( certInfoType ) == CRYPT_CERTINFO_DIRECTORYNAME )
851 #define isDNComponent( certInfoType ) \
852 ( ( certInfoType ) >= CRYPT_CERTINFO_FIRST_DN && \
853 ( certInfoType ) <= CRYPT_CERTINFO_LAST_DN )
855 #define isGeneralNameComponent( certInfoType ) \
856 ( ( certInfoType ) >= CRYPT_CERTINFO_FIRST_GENERALNAME && \
857 ( certInfoType ) <= CRYPT_CERTINFO_LAST_GENERALNAME )
863 #define isPseudoInformation( certInfoType ) \
864 ( ( certInfoType ) >= CRYPT_CERTINFO_FIRST_PSEUDOINFO && \
865 ( certInfoType ) <= CRYPT_CERTINFO_LAST_PSEUDOINFO )
871 #define isRevocationEntryComponent( certInfoType ) \
872 ( ( certInfoType ) == CRYPT_CERTINFO_CRLREASON || \
873 ( certInfoType ) == CRYPT_CERTINFO_HOLDINSTRUCTIONCODE || \
874 ( certInfoType ) == CRYPT_CERTINFO_INVALIDITYDATE )
880 #define isValidAttributeField( attributePtr ) \
881 ( ( attributePtr )->attributeID > 0 )
893 #if defined( INC_ALL )