|
| #define | BER_UNIVERSAL 0x00 |
| |
| #define | BER_APPLICATION 0x40 |
| |
| #define | BER_CONTEXT_SPECIFIC 0x80 |
| |
| #define | BER_PRIVATE 0xC0 |
| |
| #define | BER_CONSTRUCTED 0x20 |
| |
| #define | BER_PRIMITIVE 0x00 |
| |
| #define | BER_EOC 0 /* Pseudo-type for first EOC octet */ |
| |
| #define | BER_RESERVED ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_RESERVED ) |
| |
| #define | BER_BOOLEAN ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_BOOLEAN ) |
| |
| #define | BER_INTEGER ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_INTEGER ) |
| |
| #define | BER_BITSTRING ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_BITSTRING ) |
| |
| #define | BER_OCTETSTRING ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_OCTETSTRING ) |
| |
| #define | BER_NULL ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_NULL ) |
| |
| #define | BER_OBJECT_IDENTIFIER ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_OBJECT_IDENTIFIER ) |
| |
| #define | BER_OBJECT_DESCRIPTOR ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_OBJECT_DESCRIPTOR ) |
| |
| #define | BER_EXTERNAL ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_EXTERNAL ) |
| |
| #define | BER_REAL ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_REAL ) |
| |
| #define | BER_ENUMERATED ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_ENUMERATED ) |
| |
| #define | BER_EMBEDDED_PDV ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_EMBEDDED_PDV ) |
| |
| #define | BER_STRING_UTF8 ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_STRING_UTF8 ) |
| |
| #define | BER_13 ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_13 ) |
| |
| #define | BER_14 ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_14 ) |
| |
| #define | BER_15 ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_15 ) |
| |
| #define | BER_SEQUENCE ( BER_UNIVERSAL | BER_CONSTRUCTED | BER_ID_SEQUENCE ) |
| |
| #define | BER_SET ( BER_UNIVERSAL | BER_CONSTRUCTED | BER_ID_SET ) |
| |
| #define | BER_STRING_NUMERIC ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_STRING_NUMERIC ) |
| |
| #define | BER_STRING_PRINTABLE ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_STRING_PRINTABLE ) |
| |
| #define | BER_STRING_T61 ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_STRING_T61 ) |
| |
| #define | BER_STRING_VIDEOTEX ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_STRING_VIDEOTEX ) |
| |
| #define | BER_STRING_IA5 ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_STRING_IA5 ) |
| |
| #define | BER_TIME_UTC ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_TIME_UTC ) |
| |
| #define | BER_TIME_GENERALIZED ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_TIME_GENERALIZED ) |
| |
| #define | BER_STRING_GRAPHIC ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_STRING_GRAPHIC ) |
| |
| #define | BER_STRING_ISO646 ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_STRING_ISO646 ) |
| |
| #define | BER_STRING_GENERAL ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_STRING_GENERAL ) |
| |
| #define | BER_STRING_UNIVERSAL ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_STRING_UNIVERSAL ) |
| |
| #define | BER_29 ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_BER29 ) |
| |
| #define | BER_STRING_BMP ( BER_UNIVERSAL | BER_PRIMITIVE | BER_ID_STRING_BMP ) |
| |
| #define | BER_OCTETSTRING_INDEF MKDATA( "\x24\x80" ) |
| |
| #define | BER_SEQUENCE_INDEF MKDATA( "\x30\x80" ) |
| |
| #define | BER_SET_INDEF MKDATA( "\x31\x80" ) |
| |
| #define | BER_CTAG0_INDEF MKDATA( "\xA0\x80" ) |
| |
| #define | BER_END_INDEF MKDATA( "\x00\x00" ) |
| |
| #define | BER_CLASS_MASK 0xC0 |
| |
| #define | BER_CONSTRUCTED_MASK 0x20 |
| |
| #define | BER_SHORT_ID_MASK 0x1F |
| |
| #define | MAX_SHORT_BER_ID ( BER_STRING_BMP + 1 ) |
| |
| #define | LONG_BER_ID 0x1F |
| |
| #define | MAKE_CTAG(identifier) ( BER_CONTEXT_SPECIFIC | BER_CONSTRUCTED | ( identifier ) ) |
| |
| #define | MAKE_CTAG_PRIMITIVE(identifier) ( BER_CONTEXT_SPECIFIC | ( identifier ) ) |
| |
| #define | EXTRACT_CTAG(tag) ( ( tag ) & ~( BER_CONTEXT_SPECIFIC | BER_CONSTRUCTED ) ) |
| |
| #define | DEFAULT_TAG ( -1 ) |
| |
| #define | NO_TAG ( -2 ) |
| |
| #define | ANY_TAG ( -3 ) |
| |
| #define | MAX_TAG |
| |
| #define | MAX_TAG_VALUE MAX_SHORT_BER_ID |
| |
| #define | MAX_CONSTR_TAG_VALUE BER_SET |
| |
| #define | MAX_CTAG_VALUE 10 |
| |
| #define | MIN_OID_SIZE 5 |
| |
| #define | MAX_OID_SIZE 32 |
| |
| #define | WILDCARD_OID |
| |
| #define | WILDCARD_OID_SIZE 16 |
| |
| #define | MKOID(value) ( ( const BYTE * ) value ) |
| |
| #define | writeOctetStringIndef(stream) swrite( stream, BER_OCTETSTRING_INDEF, 2 ) |
| |
| #define | writeSequenceIndef(stream) swrite( stream, BER_SEQUENCE_INDEF, 2 ) |
| |
| #define | writeSetIndef(stream) swrite( stream, BER_SET_INDEF, 2 ) |
| |
| #define | writeCtag0Indef(stream) swrite( stream, BER_CTAG0_INDEF, 2 ) |
| |
| #define | writeEndIndef(stream) swrite( stream, BER_END_INDEF, 2 ) |
| |
| #define | sizeofEOC() 2 |
| |
| #define | writeTag(stream, tag) sputc( stream, tag ) |
| |
| #define | writeRawObject(stream, object, size) swrite( stream, object, size ) |
| |
| #define | sizeofOID(oid) ( 1 + 1 + ( int ) oid[ 1 ] ) |
| |
| #define | writeOID(stream, oid) swrite( ( stream ), ( oid ), sizeofOID( oid ) ) |
| |
| #define | sizeofInteger(value, valueLength) |
| |
| #define | readIntegerData(stream, integer, integerLength, maxLength) readIntegerTag( stream, integer, integerLength, maxLength, NO_TAG ) |
| |
| #define | readInteger(stream, integer, integerLength, maxLength) readIntegerTag( stream, integer, integerLength, maxLength, DEFAULT_TAG ) |
| |
| #define | sizeofBignum(bignum) ( ( int ) sizeofObject( signedBignumSize( bignum ) ) ) |
| |
| #define | readBignum(stream, bignum, minLen, maxLen, maxRange) readBignumTag( stream, bignum, minLen, maxLen, maxRange, DEFAULT_TAG ) |
| |
| #define | writeBignum(stream, bignum) writeBignumTag( stream, bignum, DEFAULT_TAG ) |
| |
| #define | sizeofShortInteger(value) |
| |
| #define | readShortIntegerData(stream, integer) readShortIntegerTag( stream, integer, NO_TAG ) |
| |
| #define | readShortInteger(stream, integer) readShortIntegerTag( stream, integer, DEFAULT_TAG ) |
| |
| #define | sizeofEnumerated(value) ( ( ( value ) < 128 ) ? 3 : 4 ) |
| |
| #define | readEnumeratedData(stream, enumeration) readEnumeratedTag( stream, enumeration, NO_TAG ) |
| |
| #define | readEnumerated(stream, enumeration) readEnumeratedTag( stream, enumeration, DEFAULT_TAG ) |
| |
| #define | sizeofBoolean() ( sizeof( BYTE ) + sizeof( BYTE ) + sizeof( BYTE ) ) |
| |
| #define | readBooleanData(stream, boolean) readBooleanTag( stream, boolean, NO_TAG ) |
| |
| #define | readBoolean(stream, boolean) readBooleanTag( stream, boolean, DEFAULT_TAG ) |
| |
| #define | sizeofNull() ( sizeof( BYTE ) + sizeof( BYTE ) ) |
| |
| #define | readNullData(stream) readNullTag( stream, NO_TAG ) |
| |
| #define | readNull(stream) readNullTag( stream, DEFAULT_TAG ) |
| |
| #define | readOctetStringData(stream, string, stringLength, minLength, maxLength) readOctetStringTag( stream, string, stringLength, minLength, maxLength, NO_TAG ) |
| |
| #define | readOctetString(stream, string, stringLength, minLength, maxLength) readOctetStringTag( stream, string, stringLength, minLength, maxLength, DEFAULT_TAG ) |
| |
| #define | sizeofBitString(value) |
| |
| #define | readBitStringData(stream, bitString) readBitStringTag( stream, bitString, NO_TAG ) |
| |
| #define | readBitString(stream, bitString) readBitStringTag( stream, bitString, DEFAULT_TAG ) |
| |
| #define | sizeofUTCTime() ( 1 + 1 + 13 ) |
| |
| #define | readUTCTimeData(stream, time) readUTCTimeTag( stream, time, NO_TAG ) |
| |
| #define | readUTCTime(stream, time) readUTCTimeTag( stream, time, DEFAULT_TAG ) |
| |
| #define | sizeofGeneralizedTime() ( 1 + 1 + 15 ) |
| |
| #define | readGeneralizedTimeData(stream, time) readGeneralizedTimeTag( stream, time, NO_TAG ) |
| |
| #define | readGeneralizedTime(stream, time) readGeneralizedTimeTag( stream, time, DEFAULT_TAG ) |
| |
|
| | RETVAL_RANGE (MAX_ERROR, TRUE) STDC_NONNULL_ARG((1)) int checkEOC(INOUT STREAM *stream) |
| |
| | RETVAL_RANGE (MAX_ERROR, 0xFF) STDC_NONNULL_ARG((1)) int readTag(INOUT STREAM *stream) |
| |
| | RETVAL_RANGE (MAX_ERROR, MAX_INTLENGTH) long sizeofObject(IN_LENGTH const long length) |
| |
| RETVAL | STDC_NONNULL_ARG ((1)) int readUniversalData(INOUT STREAM *stream) |
| |
| CHECK_RETVAL | STDC_NONNULL_ARG ((1, 2, 4)) int readRawObject(INOUT STREAM *stream |
| |
| CHECK_RETVAL | OUT_BUFFER (bufferMaxLength,*bufferLength) BYTE *buffer |
| |
| CHECK_RETVAL | IN_LENGTH_SHORT_MIN (3) const int bufferMaxLength |
| |
| RETVAL | IN_ARRAY (noOidSelectionEntries) const OID_INFO *oidSelection |
| |
| RETVAL | IN_RANGE (1, 50) const int noOidSelectionEntries |
| |
| RETVAL | OUT_RANGE (CRYPT_ERROR, noOidSelectionEntries) int *selectionID) |
| |
| RETVAL | STDC_NONNULL_ARG ((1, 2)) int readOIDEx(INOUT STREAM *stream |
| |
| RETVAL | IN_BUFFER (oidLength) const BYTE *oid |
| |
| RETVAL | OUT_BUFFER (oidMaxLength,*oidLength) BYTE *oid |
| |
| RETVAL | IN_LENGTH_SHORT_MIN (5) const int oidMaxLength |
| |
| RETVAL | STDC_NONNULL_ARG ((1, 4)) int readIntegerTag(INOUT STREAM *stream |
| |
| RETVAL | OUT_BUFFER_OPT (integerMaxLength,*integerLength) BYTE *integer |
| |
| RETVAL | IN_BUFFER (integerLength) const BYTE *integer |
| |
| | RETVAL_RANGE (MAX_ERROR, MAX_INTLENGTH_SHORT) STDC_NONNULL_ARG((1)) int signedBignumSize(IN TYPECAST(BIGNUM *) const void *bignum) |
| |
| int | writeBignumTag (INOUT STREAM *stream, const void *bignum, const int tag) STDC_NONNULL_ARG((1 |
| |
| CHECK_RETVAL INOUT | TYPECAST (BIGNUM *) void *bignum |
| |
| RETVAL | IN_RANGE (0, 999) const int enumerated |
| |
| RETVAL | IN_BUFFER (length) const BYTE *string |
| |
| RETVAL | STDC_NONNULL_ARG ((1, 2, 3)) int readOctetStringTag(INOUT STREAM *stream |
| |
| RETVAL | OUT_BUFFER (maxLength,*stringLength) BYTE *string |
| |
| RETVAL | OUT_BUFFER (stringMaxLength,*stringLength) void *string |
| |
CHECK_RETVAL
OUT_BUFFER_ALLOC_OPT length
void OUT_LENGTH_Z int | IN_LENGTH_SHORT_MIN (16) const int minLength |
| |
| CHECK_RETVAL | STDC_NONNULL_ARG ((1, 3)) int getObjectLength(IN_BUFFER(objectLength) const void *objectPtr |
| |