diff options
Diffstat (limited to 'g10/tlv.h')
-rw-r--r-- | g10/tlv.h | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -21,8 +21,6 @@ #ifndef SCD_TLV_H #define SCD_TLV_H 1 -#include "types.h" -#include "cardglue.h" enum tlv_tag_class { CLASS_UNIVERSAL = 0, @@ -64,13 +62,20 @@ enum tlv_tag_type { }; +/* Locate a TLV encoded data object in BUFFER of LENGTH and return a + pointer to value as well as its length in NBYTES. Return NULL if + it was not found or if the object does not fit into the buffer. */ +const unsigned char *find_tlv (const unsigned char *buffer, size_t length, + int tag, size_t *nbytes); + /* Locate a TLV encoded data object in BUFFER of LENGTH and return a pointer to value as well as its length in NBYTES. Return NULL if it was not found. Note, that the function does not check whether the value fits into the provided buffer.*/ -const unsigned char *find_tlv (const unsigned char *buffer, size_t length, - int tag, size_t *nbytes); +const unsigned char *find_tlv_unchecked (const unsigned char *buffer, + size_t length, + int tag, size_t *nbytes); /* ASN.1 BER parser: Parse BUFFER of length SIZE and return the tag |