19 #ifdef USE_CERTIFICATES
30 #define OID_ARC_MAX 0x1000000L
34 #define MIN_ASCII_OIDSIZE 7
48 assert(
isReadPtr( binaryOID, binaryOidLen ) );
58 memset( oid, 0,
min( 16, maxOidLen ) );
64 const long valTmp = value << 7;
67 if( value == 0 && data == 0x80 )
72 if( value >= ( OID_ARC_MAX >> 7 ) || \
73 valTmp >= OID_ARC_MAX - ( data & 0x7F ) )
75 value = valTmp | ( data & 0x7F );
78 if( !( data & 0x80 ) )
83 if( length >= maxOidLen - 20 )
102 if( x < 0 || x > 2 || y < 0 || \
103 ( ( x < 2 && y > 39 ) || \
104 ( x == 2 && ( y > 50 && y != 100 ) ) ) )
115 subLen =
sprintf_s( oid, maxOidLen,
"%ld %ld", x, y );
119 subLen =
sprintf_s( oid + length, maxOidLen - length,
122 if( subLen < 2 || subLen > maxOidLen - length )
145 static
int scanValue(
IN_BUFFER( strMaxLength )
const char *
string,
151 assert(
isReadPtr(
string, strMaxLength ) );
152 assert(
isWritePtr( value,
sizeof(
long ) ) );
160 for( index = 0; index < strMaxLength; index++ )
162 if(
string[ index ] ==
' ' ||
string[ index ] ==
'.' )
167 status = strGetNumeric(
string, index, &intValue, 0, OID_ARC_MAX );
171 if( index < strMaxLength && \
172 (
string[ index ] ==
' ' ||
string[ index ] ==
'.' ) )
181 int textToOID(
IN_BUFFER( textOidLength )
const char *textOID,
183 const int textOidLength,
188 const char *textOidPtr;
190 int length = 3, subLen, dataLeft, iterationCount,
status;
192 assert(
isReadPtr( textOID, textOidLength ) );
193 assert(
isWritePtr( binaryOID, binaryOidMaxLen ) );
194 assert(
isWritePtr( binaryOidLen,
sizeof(
int ) ) );
197 textOidLength <= CRYPT_MAX_TEXTSIZE );
202 memset( binaryOID, 0,
min( 16, binaryOidMaxLen ) );
212 subLen = scanValue( textOidPtr, dataLeft, &value );
213 if( subLen <= 0 || subLen > CRYPT_MAX_TEXTSIZE )
215 textOidPtr += subLen;
217 if( dataLeft <= 0 || dataLeft > CRYPT_MAX_TEXTSIZE )
219 subLen = scanValue( textOidPtr, dataLeft, &value2 );
220 if( subLen <= 0 || subLen > CRYPT_MAX_TEXTSIZE )
222 textOidPtr += subLen;
224 if( dataLeft <= 0 || dataLeft > CRYPT_MAX_TEXTSIZE )
229 binaryOID[ 0 ] = 0x06;
230 binaryOID[ 2 ] = (
BYTE )( ( value * 40 ) + value2 );
233 for( iterationCount = 0;
241 subLen = scanValue( textOidPtr, dataLeft, &value );
242 if( subLen <= 0 || subLen > CRYPT_MAX_TEXTSIZE )
244 textOidPtr += subLen;
246 if( dataLeft < 0 || dataLeft > CRYPT_MAX_TEXTSIZE )
248 if( value >= 0x200000L )
250 if( length >= binaryOidMaxLen )
252 binaryOID[ length++ ] =
intToByte( 0x80 | ( value >> 21 ) );
256 if( ( value >= 0x4000 ) || hasHighBits )
258 if( length >= binaryOidMaxLen )
260 binaryOID[ length++ ] =
intToByte( 0x80 | ( value >> 14 ) );
264 if( ( value >= 0x80 ) || hasHighBits )
266 if( length >= binaryOidMaxLen )
268 binaryOID[ length++ ] =
intToByte( 0x80 | ( value >> 7 ) );
271 if( length >= binaryOidMaxLen )
273 binaryOID[ length++ ] =
intToByte( value );
275 ENSURES( iterationCount < FAILSAFE_ITERATIONS_MED );
276 binaryOID[ 1 ] =
intToByte( length - 2 );
303 assert( ( certInfo == NULL && certInfoMaxLength == 0 ) || \
304 (
isWritePtr( certInfo, certInfoMaxLength ) ) );
305 assert(
isWritePtr( certInfoLength,
sizeof(
int ) ) );
309 REQUIRES( ( certInfo == NULL && certInfoMaxLength == 0 ) || \
310 ( certInfo != NULL && \
311 certInfoMaxLength > 0 && \
315 if( certInfo != NULL )
316 memset( certInfo, 0,
min( 16, certInfoMaxLength ) );
320 attributePtr = findAttributeComponent( certInfoPtr, certInfoType );
321 if( attributePtr == NULL )
327 ENSURES( !checkAttributeProperty( attributePtr,
329 ENSURES( !checkAttributeProperty( attributePtr,
336 char textOID[ ( CRYPT_MAX_TEXTSIZE * 2 ) + 8 ];
339 status = getAttributeDataPtr( attributePtr, &dataPtr, &dataLength );
342 status = oidToText( dataPtr, dataLength, textOID,
343 CRYPT_MAX_TEXTSIZE * 2, &textOidLength );
346 *certInfoLength = textOidLength;
347 if( certInfo == NULL )
349 return( attributeCopyParams( certInfo, certInfoMaxLength,
350 certInfoLength, textOID,
355 status = getAttributeDataPtr( attributePtr, &dataPtr, &dataLength );
358 return( attributeCopyParams( certInfo, certInfoMaxLength,
359 certInfoLength, dataPtr, dataLength ) );
368 *certInfoLength )
void *certInfo,
372 static const MAP_TABLE hashAlgoMapTbl[] = {
384 assert( ( certInfo == NULL && certInfoMaxLength == 0 ) || \
385 (
isWritePtr( certInfo, certInfoMaxLength ) ) );
386 assert(
isWritePtr( certInfoLength,
sizeof(
int ) ) );
392 REQUIRES( ( certInfo == NULL && certInfoMaxLength == 0 ) || \
393 ( certInfo != NULL && \
394 certInfoMaxLength > 0 && \
398 if( certInfo != NULL )
399 memset( certInfo, 0,
min( 16, certInfoMaxLength ) );
403 status = mapValue( certInfoType, &hashAlgo, hashAlgoMapTbl,
406 getHashAtomicParameters( hashAlgo, 0, &hashFunctionAtomic, &hashSize );
408 if( certInfo == NULL )
410 ENSURES( certInfoPtr->certificate != NULL );
417 return( attributeCopyParams( certInfo, certInfoMaxLength,
418 certInfoLength, certInfoPtr->certHash,
422 certInfoPtr->certificateSize );
427 memcpy( certInfoPtr->certHash, hash, hashSize );
428 certInfoPtr->certHashSet =
TRUE;
430 return( attributeCopyParams( certInfo, certInfoMaxLength,
431 certInfoLength, hash, hashSize ) );
439 *certInfoLength )
void *certInfo,
445 int certHashSize, issuerSerialDataSize,
status;
448 assert( ( certInfo == NULL && certInfoMaxLength == 0 ) || \
449 (
isWritePtr( certInfo, certInfoMaxLength ) ) );
450 assert(
isWritePtr( certInfoLength,
sizeof(
int ) ) );
452 REQUIRES( ( certInfo == NULL && certInfoMaxLength == 0 ) || \
453 ( certInfo != NULL && \
454 certInfoMaxLength > 0 && \
458 if( certInfo != NULL )
459 memset( certInfo, 0,
min( 16, certInfoMaxLength ) );
467 REQUIRES( certInfoPtr->cCertCert->serialNumber != NULL );
478 issuerSerialDataSize = ( int ) \
479 sizeofObject( sizeofObject( certInfoPtr->issuerDNsize ) ) + \
481 certInfoPtr->cCertCert->serialNumberLength );
482 *certInfoLength = ( int ) \
483 sizeofObject( sizeofObject( certHashSize ) + \
484 sizeofObject( issuerSerialDataSize ) );
485 if( certInfo == NULL )
487 if( *certInfoLength > certInfoMaxLength )
489 sMemOpen( &stream, certInfo, *certInfoLength );
490 writeSequence( &stream, sizeofObject( certHashSize ) + \
491 sizeofObject( issuerSerialDataSize ) );
492 writeOctetString( &stream, certHash, certHashSize,
DEFAULT_TAG );
493 writeSequence( &stream, issuerSerialDataSize );
494 writeSequence( &stream, sizeofObject( certInfoPtr->issuerDNsize ) );
495 writeConstructed( &stream, certInfoPtr->issuerDNsize, 4 );
496 swrite( &stream, certInfoPtr->issuerDNptr, certInfoPtr->issuerDNsize );
497 status = writeInteger( &stream, certInfoPtr->cCertCert->serialNumber,
498 certInfoPtr->cCertCert->serialNumberLength,
500 sMemDisconnect( &stream );
517 time_t *getValidityTimePtr(
const CERT_INFO *certInfoPtr )
519 CERT_VAL_INFO *certValInfo = certInfoPtr->cCertVal;
529 return( ( certValInfo->currentValidity != NULL ) ? \
530 &certValInfo->currentValidity->invalidityTime : \
531 ( certValInfo->validityInfo != NULL ) ? \
532 &certValInfo->validityInfo->invalidityTime : NULL );
550 *certInfoLength )
void *certInfo,
554 CERT_REV_INFO *certRevInfo = certInfoPtr->cCertRev;
556 WRITECERT_FUNCTION writeCertFunction;
560 assert( ( certInfo == NULL && certInfoMaxLength == 0 ) || \
561 (
isWritePtr( certInfo, certInfoMaxLength ) ) );
562 assert(
isWritePtr( certInfoLength,
sizeof(
int ) ) );
564 REQUIRES( ( certInfo == NULL && certInfoMaxLength == 0 ) || \
565 ( certInfo != NULL && \
566 certInfoMaxLength > 0 && \
571 if( certInfo != NULL )
572 memset( certInfo, 0,
min( 16, certInfoMaxLength ) );
575 if( certRevInfo->currentRevocation == NULL )
584 ENSURES( writeCertFunction != NULL );
585 sMemNullOpen( &stream );
586 status = writeCertFunction( &stream, certInfoPtr, NULL,
CRYPT_UNUSED );
588 crlEntrySize = stell( &stream );
589 sMemClose( &stream );
594 *certInfoLength = crlEntrySize;
595 if( certInfo == NULL )
597 if( crlEntrySize > certInfoMaxLength )
599 sMemOpen( &stream, certInfo, crlEntrySize );
600 status = writeCertFunction( &stream, certInfoPtr, NULL,
CRYPT_UNUSED );
601 sMemDisconnect( &stream );
609 time_t *getRevocationTimePtr(
const CERT_INFO *certInfoPtr )
611 CERT_REV_INFO *certRevInfo = certInfoPtr->cCertRev;
623 return( ( certRevInfo->currentRevocation != NULL ) ? \
624 &certRevInfo->currentRevocation->revocationTime : \
625 ( certRevInfo->revocations != NULL ) ? \
626 &certRevInfo->revocations->revocationTime : \
627 ( certRevInfo->revocationTime ) ? \
628 &certRevInfo->revocationTime : NULL );
641 static
int getIAndS(
const CERT_INFO *certInfoPtr,
643 *certInfoLength )
void *certInfo,
652 assert( ( certInfo == NULL && certInfoMaxLength == 0 ) || \
653 (
isWritePtr( certInfo, certInfoMaxLength ) ) );
654 assert(
isWritePtr( certInfoLength,
sizeof(
int ) ) );
656 REQUIRES( ( certInfo == NULL && certInfoMaxLength == 0 ) || \
657 ( certInfo != NULL && \
658 certInfoMaxLength > 0 && \
662 if( certInfo != NULL )
663 memset( certInfo, 0,
min( 16, certInfoMaxLength ) );
671 REVOCATION_INFO *crlInfoPtr = certInfoPtr->cCertRev->currentRevocation;
675 serialNumber = crlInfoPtr->id;
676 serialNumberLength = crlInfoPtr->idLength;
681 serialNumber = certInfoPtr->cCertCert->serialNumber;
682 serialNumberLength = certInfoPtr->cCertCert->serialNumberLength;
684 ENSURES( serialNumber != NULL );
685 *certInfoLength = ( int ) \
688 serialNumberLength ) );
689 if( certInfo == NULL )
691 if( *certInfoLength > certInfoMaxLength )
693 sMemOpen( &stream, certInfo, *certInfoLength );
696 swrite( &stream, certInfoPtr->issuerDNptr, certInfoPtr->
issuerDNsize );
697 status = writeInteger( &stream, serialNumber, serialNumberLength,
699 sMemDisconnect( &stream );
714 static
int extractDnComponent(
IN_BUFFER( encodedDnLength ) \
715 const char *encodedDn,
718 const char *componentName,
725 assert(
isReadPtr( encodedDn, encodedDnLength ) );
726 assert(
isReadPtr( componentName, componentNameLength ) );
727 assert(
isWritePtr( startOffset,
sizeof(
int ) ) );
728 assert(
isWritePtr( length,
sizeof(
int ) ) );
732 REQUIRES( componentNameLength > 0 && \
736 *startOffset = *length = 0;
741 startPos =
strFindStr( encodedDn, encodedDnLength,
742 componentName, componentNameLength );
745 startPos += componentNameLength;
748 for( endPos = startPos; endPos < encodedDnLength && \
749 encodedDn[
endPos ] !=
',' && \
750 encodedDn[
endPos ] !=
'+'; endPos++ );
751 if( endPos > startPos && \
752 encodedDn[ endPos ] ==
'+' && \
753 encodedDn[ endPos - 1 ] ==
' ' )
755 if( endPos <= startPos )
772 IN_BUFFER( encodedDnLength )
const char *encodedDn,
777 assert( ( name == NULL && nameMaxLength == 0 ) || \
779 assert(
isWritePtr( nameLength,
sizeof(
int ) ) );
780 assert(
isReadPtr( encodedDn, encodedDnLength ) );
782 REQUIRES( ( name == NULL && nameMaxLength == 0 ) || \
784 nameMaxLength > 0 && \
791 memset( name, 0,
min( 16, nameMaxLength ) );
795 status = extractDnComponent( encodedDn, encodedDnLength,
796 "oid.2.5.4.65=", 13, &startPos, &length );
798 length > 0 && length <= nameMaxLength )
800 return( attributeCopyParams( name, nameMaxLength, nameLength,
801 encodedDn + startPos, length ) );
805 status = extractDnComponent( encodedDn, encodedDnLength,
806 "G=", 2, &startPos, &length );
808 length > 0 && length <= nameMaxLength )
811 int startPos2, length2;
813 status = extractDnComponent( encodedDn, encodedDnLength,
814 "S=", 2, &startPos2, &length2 );
816 length2 > 0 && length + length2 <= nameMaxLength && \
819 memcpy( nameBuffer, encodedDn + startPos, length );
820 memcpy( nameBuffer + length, encodedDn + startPos2, length2 );
821 return( attributeCopyParams( name, nameMaxLength, nameLength,
822 nameBuffer, length + length2 ) );
835 static
int getHolderName(
const CERT_INFO *certInfoPtr,
837 *certInfoLength )
void *certInfo,
844 assert( ( certInfo == NULL && certInfoMaxLength == 0 ) || \
845 (
isWritePtr( certInfo, certInfoMaxLength ) ) );
846 assert(
isWritePtr( certInfoLength,
sizeof(
int ) ) );
848 REQUIRES( ( certInfo == NULL && certInfoMaxLength == 0 ) || \
849 ( certInfo != NULL && \
850 certInfoMaxLength > 0 && \
854 if( certInfo != NULL )
855 memset( certInfo, 0,
min( 16, certInfoMaxLength ) );
859 status = getDNComponentValue( certInfoPtr->
subjectName,
861 certInfoMaxLength, certInfoLength );
873 status = writeDNstring( &stream, certInfoPtr->
subjectName );
875 status = getNameFromDN( certInfo, certInfoMaxLength, certInfoLength,
876 encodedDnBuffer, stell( &stream ) );
877 sMemDisconnect( &stream );
887 status = getDNComponentValue( certInfoPtr->
subjectName,
889 certInfo, certInfoMaxLength,
892 status = getDNComponentValue( certInfoPtr->
subjectName,
894 certInfo, certInfoMaxLength,
903 static
int getHolderURI(
const CERT_INFO *certInfoPtr,
905 *certInfoLength )
void *certInfo,
914 assert( ( certInfo == NULL && certInfoMaxLength == 0 ) || \
915 (
isWritePtr( certInfo, certInfoMaxLength ) ) );
916 assert(
isWritePtr( certInfoLength,
sizeof(
int ) ) );
918 REQUIRES( ( certInfo == NULL && certInfoMaxLength == 0 ) || \
919 ( certInfo != NULL && \
920 certInfoMaxLength > 0 && \
924 if( certInfo != NULL )
925 memset( certInfo, 0,
min( 16, certInfoMaxLength ) );
931 if( attributePtr == NULL )
939 if( attributePtr == NULL )
943 if( attributePtr == NULL )
947 if( attributePtr == NULL )
951 status = getAttributeDataPtr( attributePtr, &dataPtr, &dataLength );
954 return( attributeCopyParams( certInfo, certInfoMaxLength,
955 certInfoLength, dataPtr, dataLength ) );
970 static
int getPkiUserInfo(
const CERT_INFO *certInfoPtr,
973 *certInfoLength )
void *certInfo,
977 CERT_PKIUSER_INFO *certUserInfo = certInfoPtr->cCertUser;
978 char encUserInfo[ CRYPT_MAX_TEXTSIZE + 8 ];
979 BYTE userInfo[ 128 + 8 ], *userInfoPtr = userInfo;
980 int userInfoLength, encUserInfoLength,
status;
983 assert( ( certInfo == NULL && certInfoMaxLength == 0 ) || \
984 (
isWritePtr( certInfo, certInfoMaxLength ) ) );
985 assert(
isWritePtr( certInfoLength,
sizeof(
int ) ) );
990 REQUIRES( ( certInfo == NULL && certInfoMaxLength == 0 ) || \
991 ( certInfo != NULL && \
992 certInfoMaxLength > 0 && \
996 if( certInfo != NULL )
997 memset( certInfo, 0,
min( 16, certInfoMaxLength ) );
1002 status = getCertAttributeComponent( certInfoPtr,
1004 userInfo, 128, &userInfoLength );
1010 certUserInfo->pkiIssuePW : certUserInfo->pkiRevPW;
1013 status = encodePKIUserValue( encUserInfo, CRYPT_MAX_TEXTSIZE,
1014 &encUserInfoLength, userInfoPtr,
1018 zeroise( userInfo, CRYPT_MAX_TEXTSIZE );
1022 decodePKIUserValue( userInfo, 128, &userInfoLength,
1023 encUserInfo, encUserInfoLength ) ) );
1024 status = attributeCopyParams( certInfo, certInfoMaxLength,
1025 certInfoLength, encUserInfo,
1026 encUserInfoLength );
1027 zeroise( encUserInfo, CRYPT_MAX_TEXTSIZE );
1045 *certInfoLength )
void *certInfo,
1049 const void *data = NULL;
1050 int dataLength = 0,
status;
1053 assert( ( certInfo == NULL && certInfoMaxLength == 0 ) || \
1054 ( certInfo != NULL && \
1055 certInfoMaxLength > 0 && \
1057 isWritePtr( certInfo, certInfoMaxLength ) ) );
1058 assert(
isWritePtr( certInfoLength,
sizeof(
int ) ) );
1062 REQUIRES( ( certInfo == NULL && certInfoMaxLength == 0 ) || \
1063 ( certInfo != NULL && \
1064 certInfoMaxLength > 0 && \
1068 if( certInfo != NULL )
1069 memset( certInfo, 0,
min( 16, certInfoMaxLength ) );
1070 *certInfoLength = 0;
1086 status = selectGeneralNameComponent( certInfoPtr, certInfoType );
1088 attributePtr = certInfoPtr->attributeCursor;
1092 ENSURES( attributePtr != NULL );
1095 status = getAttributeDataPtr( attributePtr, &dataPtr, &dataLength );
1098 return( attributeCopyParams( certInfo, certInfoMaxLength,
1099 certInfoLength, dataPtr, dataLength ) );
1107 if( certInfoPtr->currentSelection.dnComponent == certInfoType )
1108 count = certInfoPtr->currentSelection.dnComponentCount;
1115 return( getDNComponentValue( *certInfoPtr->currentSelection.dnPtr,
1116 certInfoType, count, certInfo,
1117 certInfoMaxLength, certInfoLength ) );
1121 if( ( certInfoType >= CRYPT_CERTINFO_FIRST_EXTENSION && \
1122 certInfoType <= CRYPT_CERTINFO_LAST_EXTENSION ) || \
1123 ( certInfoType >= CRYPT_CERTINFO_FIRST_CMS && \
1124 certInfoType <= CRYPT_CERTINFO_LAST_CMS ) )
1126 return( getCertAttributeComponent( certInfoPtr, certInfoType,
1127 certInfo, certInfoMaxLength,
1132 switch( certInfoType )
1138 return( getCertHash( certInfoPtr, certInfoType, certInfo,
1139 certInfoMaxLength, certInfoLength ) );
1142 switch( certInfoPtr->type )
1147 const CERT_REV_INFO *certRevInfo = certInfoPtr->cCertRev;
1149 const REVOCATION_INFO *revInfoPtr = \
1150 ( certRevInfo->currentRevocation != NULL ) ? \
1151 certRevInfo->currentRevocation : certRevInfo->revocations;
1153 if( revInfoPtr != NULL )
1155 data = revInfoPtr->id;
1156 dataLength = revInfoPtr->idLength;
1164 data = certInfoPtr->cCertReq->serialNumber;
1165 dataLength = certInfoPtr->cCertReq->serialNumberLength;
1172 data = certInfoPtr->cCertCert->serialNumber;
1173 dataLength = certInfoPtr->cCertCert->serialNumberLength;
1179 return( attributeCopyParams( certInfo, certInfoMaxLength,
1180 certInfoLength, data, dataLength ) );
1186 data = &certInfoPtr->startTime;
1187 dataLength =
sizeof( time_t );
1189 return( attributeCopyParams( certInfo, certInfoMaxLength,
1190 certInfoLength, data, dataLength ) );
1196 data = &certInfoPtr->endTime;
1197 dataLength =
sizeof( time_t );
1199 return( attributeCopyParams( certInfo, certInfoMaxLength,
1200 certInfoLength, data, dataLength ) );
1202 #ifdef USE_CERT_OBSOLETE
1204 return( attributeCopyParams( certInfo, certInfoMaxLength,
1206 certInfoPtr->cCertCert->issuerUniqueID,
1207 certInfoPtr->cCertCert->issuerUniqueIDlength ) );
1210 return( attributeCopyParams( certInfo, certInfoMaxLength,
1212 certInfoPtr->cCertCert->subjectUniqueID,
1213 certInfoPtr->cCertCert->subjectUniqueIDlength ) );
1217 switch( certInfoPtr->type )
1222 data = getRevocationTimePtr( certInfoPtr );
1228 data = getValidityTimePtr( certInfoPtr );
1236 dataLength =
sizeof( time_t );
1237 return( attributeCopyParams( certInfo, certInfoMaxLength,
1238 certInfoLength, data, dataLength ) );
1240 #ifdef USE_CERT_DNSTRING
1250 sMemOpenOpt( &stream, certInfo, certInfoMaxLength );
1251 status = writeDNstring( &stream,
1252 *certInfoPtr->currentSelection.dnPtr );
1254 *certInfoLength = stell( &stream );
1255 sMemDisconnect( &stream );
1264 return( getPkiUserInfo( certInfoPtr, certInfoType, certInfo,
1265 certInfoMaxLength, certInfoLength ) );
1269 case CRYPT_IATTRIBUTE_CRLENTRY:
1270 return( getCrlEntry( certInfoPtr, certInfo, certInfoMaxLength,
1274 case CRYPT_IATTRIBUTE_SUBJECT:
1283 certInfoPtr->certificate == NULL ) || \
1284 certInfoPtr->certificate != NULL );
1285 return( attributeCopyParams( certInfo, certInfoMaxLength,
1287 certInfoPtr->subjectDNptr,
1288 certInfoPtr->subjectDNsize ) );
1290 case CRYPT_IATTRIBUTE_ISSUER:
1291 return( attributeCopyParams( certInfo, certInfoMaxLength,
1293 certInfoPtr->issuerDNptr,
1294 certInfoPtr->issuerDNsize ) );
1296 case CRYPT_IATTRIBUTE_ISSUERANDSERIALNUMBER:
1297 return( getIAndS( certInfoPtr, certInfo, certInfoMaxLength,
1300 case CRYPT_IATTRIBUTE_HOLDERNAME:
1301 return( getHolderName( certInfoPtr, certInfo, certInfoMaxLength,
1304 case CRYPT_IATTRIBUTE_HOLDERURI:
1305 return( getHolderURI( certInfoPtr, certInfo, certInfoMaxLength,
1308 case CRYPT_IATTRIBUTE_SPKI:
1312 status = attributeCopyParams( certInfo, certInfoMaxLength,
1314 certInfoPtr->publicKeyInfo,
1315 certInfoPtr->publicKeyInfoSize );
1318 if( dataStartPtr != NULL && dataStartPtr[ 0 ] ==
MAKE_CTAG( 6 ) )
1326 #if defined( USE_CERTREV ) || defined( USE_CERTVAL )
1327 case CRYPT_IATTRIBUTE_RESPONDERURL:
1334 switch( certInfoPtr->type )
1338 if( certInfoPtr->cCertRev->responderUrl == NULL )
1340 return( attributeCopyParams( certInfo, certInfoMaxLength,
1342 certInfoPtr->cCertRev->responderUrl,
1343 certInfoPtr->cCertRev->responderUrlSize ) );
1348 if( certInfoPtr->cCertVal->responderUrl == NULL )
1350 return( attributeCopyParams( certInfo, certInfoMaxLength,
1352 certInfoPtr->cCertVal->responderUrl,
1353 certInfoPtr->cCertVal->responderUrlSize ) );
1362 case CRYPT_IATTRIBUTE_AUTHCERTID:
1367 if( !memcmp( certInfoPtr->cCertReq->authCertID,
1368 "\x00\x00\x00\x00\x00\x00\x00\x00", 8 ) )
1370 return( attributeCopyParams( certInfo, certInfoMaxLength,
1372 certInfoPtr->cCertReq->authCertID,
1376 case CRYPT_IATTRIBUTE_ESSCERTID:
1377 return( getESSCertID( certInfoPtr, certInfo, certInfoMaxLength,