diff options
Diffstat (limited to 'common/tlv.h')
-rw-r--r-- | common/tlv.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/common/tlv.h b/common/tlv.h index 3136195a5..cfd615003 100644 --- a/common/tlv.h +++ b/common/tlv.h @@ -150,18 +150,17 @@ size_t get_tlv_length (int class, int tag, int constructed, size_t length); /*-- tlv-parser.c --*/ +#define TLV_PARSER_FLAG_T5793 1 /* Enable workaround for Mozilla bug. */ -tlv_parser_t tlv_parser_new (const unsigned char *buffer, size_t bufsize, - int verbosity); -void tlv_parser_release (tlv_parser_t tlv); +tlv_parser_t _tlv_parser_new (const unsigned char *buffer, size_t bufsize, + int verbosity, tlv_parser_t lasttlv, int lno); +tlv_parser_t _tlv_parser_release (tlv_parser_t tlv, int lno); void _tlv_parser_dump_tag (const char *text, int lno, tlv_parser_t tlv); void _tlv_parser_dump_state (const char *text, const char *text2, int lno, tlv_parser_t tlv); -int _tlv_parser_peek (tlv_parser_t tlv, int class, int tag); -int _tlv_parser_peek_null (tlv_parser_t tlv); -gpg_error_t _tlv_parser_next (tlv_parser_t tlv, int lno); +gpg_error_t _tlv_parser_next (tlv_parser_t tlv, unsigned int flags, int lno); unsigned int tlv_parser_level (tlv_parser_t tlv); size_t tlv_parser_offset (tlv_parser_t tlv); @@ -178,7 +177,7 @@ gpg_error_t tlv_expect_set (tlv_parser_t tlv); gpg_error_t tlv_expect_object (tlv_parser_t tlv, int class, int tag, unsigned char const **r_data, size_t *r_datalen); -gpg_error_t tlv_expect_octet_string (tlv_parser_t tlv, int encapsulates, +gpg_error_t tlv_expect_octet_string (tlv_parser_t tlv, unsigned char const **r_data, size_t *r_datalen); gpg_error_t tlv_expect_integer (tlv_parser_t tlv, int *r_value); @@ -189,19 +188,20 @@ gpg_error_t tlv_expect_mpinteger (tlv_parser_t tlv, int ignore_zero, gpg_error_t tlv_expect_object_id (tlv_parser_t tlv, unsigned char const **r_oid, size_t *r_oidlen); +gpg_error_t tlv_expect_null (tlv_parser_t tlv); /* Easier to use wrapper around parse_ber_header. */ gpg_error_t tlv_parse_tag (unsigned char const **buffer, size_t *size, struct tag_info *ti); /* Convenience macro and macros to include the line number. */ +#define tlv_parser_new(a,b,c,d) _tlv_parser_new ((a),(b),(c),(d), __LINE__) +#define tlv_parser_release(a) _tlv_parser_release ((a), __LINE__) #define tlv_parser_dump_tag(a,b) _tlv_parser_dump_tag ((a),__LINE__,(b)) #define tlv_parser_dump_state(a,b,c) \ _tlv_parser_dump_state ((a),(b),__LINE__,(c)) -#define tlv_peek(a,b,c) _tlv_parser_peek ((a),(b),(c)) -#define tlv_peek_null(a) _tlv_parser_peek_null ((a)) -#define tlv_next(a) _tlv_parser_next ((a), __LINE__) - +#define tlv_next(a) _tlv_parser_next ((a),0, __LINE__) +#define tlv_next_with_flag(a,b) _tlv_parser_next ((a),(b), __LINE__) #endif /* SCD_TLV_H */ |