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_3_6-18-ge7272b3


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_6-18-ge7272b3
Date: Wed, 04 Jun 2014 12:28:53 +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=e7272b364e63548be8b92a6ae6236393a77d3cba

The branch, master has been updated
       via  e7272b364e63548be8b92a6ae6236393a77d3cba (commit)
       via  dee899dd68f595549493d8929478fd298e115ade (commit)
      from  4010bb04588fca86a9f6d683b637c05b4cec24e0 (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 e7272b364e63548be8b92a6ae6236393a77d3cba
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Wed Jun 4 14:28:47 2014 +0200

    doc update

commit dee899dd68f595549493d8929478fd298e115ade
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Wed Jun 4 14:26:35 2014 +0200

    asn1_read_value() and friends understand the ?CURRENT keyword.
    
    That keyword allows to specify the current element if the given
    node is a node in a sequence or set.

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

Summary of changes:
 NEWS             |    3 +++
 lib/element.c    |   10 +++++++---
 lib/parser_aux.c |    8 +++++++-
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 95d76d5..7d9290c 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ GNU Libtasn1 NEWS                                     -*- 
outline -*-
 - optimized asn1_der_decoding_startEnd(). It only performs the decoding
   step, if it is not already done.
 - Added asn1_copy_node2().
+- asn1_read_value() understands the ?CURRENT keyword, which can be used
+  to indicate the current element of a sequence, when the provided node
+  is a sequence element.
 - Fixes in DER decoding.
 
 * Noteworthy changes in release 3.6 (released 2014-05-25) [stable]
diff --git a/lib/element.c b/lib/element.c
index c2b7107..b45c3ec 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -676,7 +676,9 @@ asn1_write_value (asn1_node node_root, const char *name,
  * %ASN1_ELEMENT_NOT_FOUND, it means that this element wasn't present
  * in the der encoding that created the structure.  The first element
  * of a SEQUENCE_OF or SET_OF is named "?1". The second one "?2" and
- * so on.
+ * so on. If the @root provided is a node to specific sequence element,
+ * then the keyword "?CURRENT" is also acceptable and indicates the
+ * current sequence element of this node.
  *
  * Note that there can be valid values with length zero. In these case
  * this function will succeed and @len will be zero.
@@ -741,12 +743,14 @@ asn1_read_value (asn1_node root, const char *name, void 
*ivalue, int *len)
  *   holds the sizeof value.
  * @etype: The type of the value read (ASN1_ETYPE)
  *
- * Returns the value of one element inside a structure. 
+ * Returns the type and value of one element inside a structure. 
  * If an element is OPTIONAL and this returns
  * %ASN1_ELEMENT_NOT_FOUND, it means that this element wasn't present
  * in the der encoding that created the structure.  The first element
  * of a SEQUENCE_OF or SET_OF is named "?1". The second one "?2" and
- * so on.
+ * so on. If the @root provided is a node to specific sequence element,
+ * then the keyword "?CURRENT" is also acceptable and indicates the
+ * current sequence element of this node.
  *
  * Note that there can be valid values with length zero. In these case
  * this function will succeed and @len will be zero.
diff --git a/lib/parser_aux.c b/lib/parser_aux.c
index 32dfba0..4b15000 100644
--- a/lib/parser_aux.c
+++ b/lib/parser_aux.c
@@ -108,7 +108,13 @@ asn1_find_node (asn1_node pointer, const char *name)
   p = pointer;
   n_start = name;
 
-  if (p->name[0] != 0)
+  if (name[0] == '?' && name[1] == 'C' && p->name[0] == '?')
+    { /* ?CURRENT */
+      n_start = strchr(n_start, '.');
+      if (n_start)
+        n_start++;
+    }
+  else if (p->name[0] != 0)
     {                          /* has *pointer got a name ? */
       n_end = strchr (n_start, '.');   /* search the first dot */
       if (n_end)


hooks/post-receive
-- 
GNU libtasn1



reply via email to

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