libtasn1-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU libtasn1 branch, master, updated. libtasn1_2_13-13-g92abf0c


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_2_13-13-g92abf0c
Date: Wed, 12 Sep 2012 20:45:39 +0000

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=92abf0cd89b512514a18754f913fb8d828ed5c8b

The branch, master has been updated
       via  92abf0cd89b512514a18754f913fb8d828ed5c8b (commit)
      from  b86e75de8bc3a35620f069b7b00d680284d86eb5 (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 92abf0cd89b512514a18754f913fb8d828ed5c8b
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Wed Sep 12 22:32:20 2012 +0200

    Added asn1_read_node_value()

-----------------------------------------------------------------------

Summary of changes:
 NEWS             |    3 ++-
 lib/element.c    |   19 +++++++++++++++++++
 lib/libtasn1.h   |   13 ++++++++++++-
 lib/libtasn1.map |    7 +++++++
 4 files changed, 40 insertions(+), 2 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 70b272b..a0f841f 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -976,3 +976,22 @@ 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;
+  
+  return ASN1_SUCCESS;
+}
diff --git a/lib/libtasn1.h b/lib/libtasn1.h
index 30154ae..01030df 100644
--- a/lib/libtasn1.h
+++ b/lib/libtasn1.h
@@ -112,7 +112,6 @@ extern "C"
 
   typedef node_asn *ASN1_TYPE;
 
-
   /* maximum number of characters of a name */
   /* inside a file with ASN1 definitons     */
 #define ASN1_MAX_NAME_SIZE 128
@@ -130,6 +129,15 @@ extern "C"
   };
   typedef struct static_struct_asn ASN1_ARRAY_TYPE;
 
+  struct node_data_struct
+  {
+    const char *name;          /* Node name */
+    const void *value;         /* Node value */
+    unsigned int value_len;     /* Node value size */
+    unsigned int vals[4];      /* reserved for future use */
+  };
+  typedef struct node_data_struct ASN1_DATA_NODE;
+
   /***********************************/
   /*  Fixed constants                */
   /***********************************/
@@ -179,6 +187,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..f4c3253 100644
--- a/lib/libtasn1.map
+++ b/lib/libtasn1.map
@@ -57,3 +57,10 @@ LIBTASN1_0_3
   local:
     *;
 };
+
+LIBTASN1_0_4
+{
+  global:
+    asn1_read_node_value;
+} LIBTASN1_0_3;
+


hooks/post-receive
-- 
GNU libtasn1



reply via email to

[Prev in Thread] Current Thread [Next in Thread]