This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU libtasn1".
http://git.savannah.gnu.org/cgit/libtasn1.git/commit/?id=01d2e13165310dadc4aebb4003c5b56683e034b1 The branch, libtasn1_2_x has been updated via 01d2e13165310dadc4aebb4003c5b56683e034b1 (commit) via de80f5fc0dc779bc1a6bda51a0842a6ac12f76de (commit) via 58a6131c50771e603bde03984ff3b3ccf1dbd3cd (commit) via 92e29763d3cbde9a73d60e9883a75747a0389497 (commit) from c5226f57807bf53fd3aff5ce2f36d62f2e9b7553 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 01d2e13165310dadc4aebb4003c5b56683e034b1 Author: Nikos Mavrogiannopoulos <n...@gnutls.org> Date: Thu Sep 13 22:24:25 2012 +0200 added new symbol commit de80f5fc0dc779bc1a6bda51a0842a6ac12f76de Author: Nikos Mavrogiannopoulos <n...@gnutls.org> Date: Thu Sep 13 21:10:35 2012 +0200 no need to reserve. commit 58a6131c50771e603bde03984ff3b3ccf1dbd3cd Author: Nikos Mavrogiannopoulos <n...@gnutls.org> Date: Wed Sep 12 23:15:02 2012 +0200 Node type field is now included in ASN1_DATA_NODE. commit 92e29763d3cbde9a73d60e9883a75747a0389497 Author: Nikos Mavrogiannopoulos <n...@gnutls.org> Date: Wed Sep 12 22:32:20 2012 +0200 Added asn1_read_node_value() ----------------------------------------------------------------------- Summary of changes: NEWS | 3 ++- lib/element.c | 20 ++++++++++++++++++++ lib/int.h | 44 ++++++++++++++++++++++---------------------- lib/libtasn1.h | 36 ++++++++++++++++++++++++++++++++++++ lib/libtasn1.map | 2 ++ 5 files changed, 82 insertions(+), 23 deletions(-) diff --git a/NEWS b/NEWS index 7cc4a10..cb4dfd9 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ GNU Libtasn1 NEWS -*- outline -*- -* Noteworthy changes in release 2.14 (unreleased) [stable] +* Noteworthy changes in release 3.0 (unreleased) [stable] +- Added asn1_read_node_value() to obtain a node's value. * Noteworthy changes in release 2.13 (2012-05-31) [stable] - Updated fix for DER decoding issue to not depend on specific compilers. diff --git a/lib/element.c b/lib/element.c index ead899c..8e8807b 100644 --- a/lib/element.c +++ b/lib/element.c @@ -976,3 +976,23 @@ asn1_read_tag (ASN1_TYPE root, const char *name, int *tagValue, return ASN1_SUCCESS; } + +/** + * asn1_read_node_value: + * @node: pointer to a node. + * @data: a point to a node_data_struct + * + * Returns the value a data node inside a ASN1_TYPE structure. + * The data returned should be handled as constant values. + * + * Returns: %ASN1_SUCCESS if the node exists. + **/ +asn1_retCode asn1_read_node_value (ASN1_TYPE node, ASN1_DATA_NODE* data) +{ + data->name = node->name; + data->value = node->value; + data->value_len = node->value_len; + data->type = type_field(node->type); + + return ASN1_SUCCESS; +} diff --git a/lib/int.h b/lib/int.h index 82de579..aad7ba6 100644 --- a/lib/int.h +++ b/lib/int.h @@ -83,28 +83,28 @@ struct node_asn_struct #define type_field(x) (x&0xFF) /* List of constants for field type of typedef node_asn */ -#define TYPE_CONSTANT 1 -#define TYPE_IDENTIFIER 2 -#define TYPE_INTEGER 3 -#define TYPE_BOOLEAN 4 -#define TYPE_SEQUENCE 5 -#define TYPE_BIT_STRING 6 -#define TYPE_OCTET_STRING 7 -#define TYPE_TAG 8 -#define TYPE_DEFAULT 9 -#define TYPE_SIZE 10 -#define TYPE_SEQUENCE_OF 11 -#define TYPE_OBJECT_ID 12 -#define TYPE_ANY 13 -#define TYPE_SET 14 -#define TYPE_SET_OF 15 -#define TYPE_DEFINITIONS 16 -#define TYPE_TIME 17 -#define TYPE_CHOICE 18 -#define TYPE_IMPORTS 19 -#define TYPE_NULL 20 -#define TYPE_ENUMERATED 21 -#define TYPE_GENERALSTRING 27 +#define TYPE_CONSTANT ASN1_ETYPE_CONSTANT +#define TYPE_IDENTIFIER ASN1_ETYPE_IDENTIFIER +#define TYPE_INTEGER ASN1_ETYPE_INTEGER +#define TYPE_BOOLEAN ASN1_ETYPE_BOOLEAN +#define TYPE_SEQUENCE ASN1_ETYPE_SEQUENCE +#define TYPE_BIT_STRING ASN1_ETYPE_BIT_STRING +#define TYPE_OCTET_STRING ASN1_ETYPE_OCTET_STRING +#define TYPE_TAG ASN1_ETYPE_TAG +#define TYPE_DEFAULT ASN1_ETYPE_DEFAULT +#define TYPE_SIZE ASN1_ETYPE_SIZE +#define TYPE_SEQUENCE_OF ASN1_ETYPE_SEQUENCE_OF +#define TYPE_OBJECT_ID ASN1_ETYPE_OBJECT_ID +#define TYPE_ANY ASN1_ETYPE_ANY +#define TYPE_SET ASN1_ETYPE_SET +#define TYPE_SET_OF ASN1_ETYPE_SET_OF +#define TYPE_DEFINITIONS ASN1_ETYPE_DEFINITIONS +#define TYPE_TIME ASN1_ETYPE_TIME +#define TYPE_CHOICE ASN1_ETYPE_CHOICE +#define TYPE_IMPORTS ASN1_ETYPE_IMPORTS +#define TYPE_NULL ASN1_ETYPE_NULL +#define TYPE_ENUMERATED ASN1_ETYPE_ENUMERATED +#define TYPE_GENERALSTRING ASN1_ETYPE_GENERALSTRING /***********************************************************************/ diff --git a/lib/libtasn1.h b/lib/libtasn1.h index 784a67e..e9337e2 100644 --- a/lib/libtasn1.h +++ b/lib/libtasn1.h @@ -141,6 +141,39 @@ extern "C" }; typedef struct static_struct_asn ASN1_ARRAY_TYPE; +/* List of constants for field type of typedef node_asn */ +#define ASN1_ETYPE_CONSTANT 1 +#define ASN1_ETYPE_IDENTIFIER 2 +#define ASN1_ETYPE_INTEGER 3 +#define ASN1_ETYPE_BOOLEAN 4 +#define ASN1_ETYPE_SEQUENCE 5 +#define ASN1_ETYPE_BIT_STRING 6 +#define ASN1_ETYPE_OCTET_STRING 7 +#define ASN1_ETYPE_TAG 8 +#define ASN1_ETYPE_DEFAULT 9 +#define ASN1_ETYPE_SIZE 10 +#define ASN1_ETYPE_SEQUENCE_OF 11 +#define ASN1_ETYPE_OBJECT_ID 12 +#define ASN1_ETYPE_ANY 13 +#define ASN1_ETYPE_SET 14 +#define ASN1_ETYPE_SET_OF 15 +#define ASN1_ETYPE_DEFINITIONS 16 +#define ASN1_ETYPE_TIME 17 +#define ASN1_ETYPE_CHOICE 18 +#define ASN1_ETYPE_IMPORTS 19 +#define ASN1_ETYPE_NULL 20 +#define ASN1_ETYPE_ENUMERATED 21 +#define ASN1_ETYPE_GENERALSTRING 27 + + struct node_data_struct + { + const char *name; /* Node name */ + const void *value; /* Node value */ + unsigned int value_len; /* Node value size */ + unsigned int type; /* Node value type (ASN1_ETYPE_*) */ + }; + typedef struct node_data_struct ASN1_DATA_NODE; + /***********************************/ /* Fixed constants */ /***********************************/ @@ -193,6 +226,9 @@ extern "C" void *ivalue, int *len); extern ASN1_API asn1_retCode + asn1_read_node_value (ASN1_TYPE node, ASN1_DATA_NODE* data); + + extern ASN1_API asn1_retCode asn1_number_of_elements (ASN1_TYPE element, const char *name, int *num); extern ASN1_API asn1_retCode diff --git a/lib/libtasn1.map b/lib/libtasn1.map index 1906cd5..83235ed 100644 --- a/lib/libtasn1.map +++ b/lib/libtasn1.map @@ -49,6 +49,7 @@ LIBTASN1_0_3 asn1_read_value; asn1_strerror; asn1_write_value; + asn1_read_node_value; # Old symbols libtasn1_strerror; @@ -57,3 +58,4 @@ LIBTASN1_0_3 local: *; }; + hooks/post-receive -- GNU libtasn1