20 #define OID_X509_USERCERTIFICATE MKOID( "\x06\x03\x55\x04\x24" )
301 #ifdef USE_CERTIFICATES
322 assert(
isWritePtr( offset,
sizeof(
int ) ) );
333 status = readEncodedOID( stream, oid,
MAX_OID_SIZE, &oidLength,
344 *offset = stell( stream );
345 return( readSequence( stream, NULL ) );
351 readConstructedI( stream, NULL, 0 );
352 readSequenceI( stream, NULL );
353 return( readSequence( stream, NULL ) );
359 readConstructedI( stream, NULL, 0 );
360 status = readSequenceI( stream, NULL );
371 if( integer < 1 || integer > 3 )
373 status = readSet( stream, &value );
375 status = sSkip( stream, value );
383 readSequenceI( stream, &innerLength );
384 status = readEncodedOID( stream, oid,
MAX_OID_SIZE, &oidLength,
398 if( innerLength > sizeofObject( oidLength ) )
399 readUniversal( stream );
401 status = readConstructedI( stream, NULL, 0 );
408 return( readSequence( stream, NULL ) );
426 assert(
isWritePtr( objectOffset,
sizeof(
int ) ) );
427 assert(
isWritePtr( objectLength,
sizeof(
int ) ) );
434 *objectOffset = *objectLength = 0;
439 if( formatHint == CRYPT_ICERTTYPE_SSL_CERTCHAIN )
441 *objectLength = sMemDataLeft( stream );
442 *objectType = CRYPT_ICERTTYPE_SSL_CERTCHAIN;
447 status = getStreamObjectLength( stream, &length );
463 sClearError( stream );
465 status = getLongStreamObjectLength( stream, &longLength );
468 length = ( int ) longLength;
480 if( peekTag( stream ) ==
MAKE_CTAG( 0 ) || \
481 formatHint == CRYPT_ICERTTYPE_CMS_CERTSET )
482 isContextTagged =
TRUE;
483 status = readConstructedI( stream, &length, \
497 case CRYPT_ICERTTYPE_DATAONLY:
503 case CRYPT_ICERTTYPE_CTL:
510 case CRYPT_ICERTTYPE_REVINFO:
517 *objectType = formatHint;
525 if( isContextTagged )
535 status = decodeCertWrapper( stream, objectType, objectOffset );
557 readSequence( stream, NULL );
559 readConstructed( stream, NULL, 0 );
560 readOctetStringHole( stream, NULL, 8,
DEFAULT_TAG );
561 readSequence( stream, NULL );
562 readSequence( stream, NULL );
564 readConstructed( stream, NULL, 0 );
565 readOctetStringHole( stream, NULL, 8,
DEFAULT_TAG );
566 readSequence( stream, NULL );
567 readSequence( stream, NULL );
568 readFixedOID( stream,
569 MKOID(
"\x06\x0B\x2A\x86\x48\x86\xF7\x0D\x01\x0C\x0A\x01\x03" ),
571 readConstructed( stream, NULL, 0 );
572 readSequence( stream, NULL );
573 readFixedOID( stream,
574 MKOID(
"\x06\x0A\x2A\x86\x48\x86\xF7\x0D\x01\x09\x16\x01" ),
576 readConstructed( stream, NULL, 0 );
577 status = readOctetStringHole( stream, &length, 8,
DEFAULT_TAG );
580 offset = stell( stream );
581 readSequence( stream, NULL );
582 status = readSequence( stream, NULL );
599 status = readLongSequence( stream, &longLength );
607 length = ( int ) longLength;
611 status = readSequence( stream, &length );
616 if( peekTag( stream ) ==
MAKE_CTAG( 0 ) )
617 status = readUniversal( stream );
618 if( peekTag( stream ) ==
MAKE_CTAG( 1 ) )
619 status = readUniversal( stream );
620 if( peekTag( stream ) ==
MAKE_CTAG( 2 ) )
621 status = readUniversal( stream );
623 status = readUniversal( stream );
639 tag = peekTag( stream );
672 status = readSequence( stream, &length );
675 if( length <= 0 || length > MAX_INTLENGTH )
677 tag = peekTag( stream );
685 sSkip( stream, length );
686 readUniversal( stream );
687 tag = readTag( stream );
728 sSkip( stream, length );
729 readSequence( stream, NULL );
730 tag = readTag( stream );
749 readSequence( stream, NULL );
750 tag = readTag( stream );