summaryrefslogtreecommitdiffstats
path: root/scd/tlv.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2005-04-27 21:47:53 +0200
committerWerner Koch <wk@gnupg.org>2005-04-27 21:47:53 +0200
commiteb3f014b5d57373b9eb7b3430c7afa115e2f871e (patch)
tree70ee2c81251953cfd24772a9023a4724315e8994 /scd/tlv.h
parent(symcryptrun): Added. (diff)
downloadgnupg2-eb3f014b5d57373b9eb7b3430c7afa115e2f871e.tar.xz
gnupg2-eb3f014b5d57373b9eb7b3430c7afa115e2f871e.zip
* app-p15.c (micardo_mse): New.
(do_sign): Call it. * iso7816.c (iso7816_manage_security_env): Allow passing DATA as NULL to indicate an empty Lc. * tlv.c (find_tlv): Check that a found object fits into the buffer. (find_tlv_unchecked): New as replacement for the old non-checking variant. * app.c (select_application): Keep on using the non-checking variant. * app-openpgp.c (get_one_do, dump_all_do): Ditto.
Diffstat (limited to 'scd/tlv.h')
-rw-r--r--scd/tlv.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/scd/tlv.h b/scd/tlv.h
index 26a9905f7..628580431 100644
--- a/scd/tlv.h
+++ b/scd/tlv.h
@@ -62,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