From MAILER-DAEMON Thu Nov 01 10:23:51 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TTvgV-00054H-P5
	for mharc-libtasn1-commit@gnu.org; Thu, 01 Nov 2012 10:23:51 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50416)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TTvgS-00053C-Q8
	for libtasn1-commit@gnu.org; Thu, 01 Nov 2012 10:23:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TTvgQ-0004pp-Qy
	for libtasn1-commit@gnu.org; Thu, 01 Nov 2012 10:23:48 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:51641)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TTvgQ-0004pk-O7
	for libtasn1-commit@gnu.org; Thu, 01 Nov 2012 10:23:46 -0400
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TTvgQ-0002PD-8e
	for libtasn1-commit@gnu.org; Thu, 01 Nov 2012 14:23:46 +0000
Date: Thu, 01 Nov 2012 14:23:46 +0000
Message-Id: <E1TTvgQ-0002PD-8e@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_0-1-gb7bd8b0
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: b789eb8ad89e53f4c78be9d0a3d2afa9195250f0
X-Git-Newrev: b7bd8b012c913cf0a85b3e620ccdf408567f8027
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 01 Nov 2012 14:23:50 -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=b7bd8b012c913cf0a85b3e620ccdf408567f8027

The branch, master has been updated
       via  b7bd8b012c913cf0a85b3e620ccdf408567f8027 (commit)
      from  b789eb8ad89e53f4c78be9d0a3d2afa9195250f0 (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 b7bd8b012c913cf0a85b3e620ccdf408567f8027
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Thu Nov 1 15:21:49 2012 +0100

    Corrected type asn1_static_node_t -> asn1_static_node.
    
    The old type was left for compatibility. Reported by Andreas Metzler.

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

Summary of changes:
 NEWS                       |    4 ++++
 lib/libtasn1.h             |    7 ++++---
 lib/structure.c            |    4 ++--
 tests/Test_tree_asn1_tab.c |    2 +-
 4 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/NEWS b/NEWS
index 7ab3347..d2503bb 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,9 @@
 GNU Libtasn1 NEWS                                     -*- outline -*-
 
+* Noteworthy changes in release 3.1 (unreleased) [stable]
+- Completed rename of types:
+  ASN1_ARRAY_TYPE -> asn1_static_node (was asn1_static_node_t)
+
 * Noteworthy changes in release 3.0 (2012-10-28) [stable]
 - Added tool in tests/ to benchmark X.509 structure decoding.
 - Added asn1_read_node_value() to obtain a node's value.
diff --git a/lib/libtasn1.h b/lib/libtasn1.h
index 5be46d0..c80a5ca 100644
--- a/lib/libtasn1.h
+++ b/lib/libtasn1.h
@@ -124,7 +124,7 @@ extern "C"
     unsigned int type;		/* Node type */
     const void *value;		/* Node value */
   };
-  typedef struct asn1_static_node_st asn1_static_node_t;
+  typedef struct asn1_static_node_st asn1_static_node;
 
 /* List of constants for field type of typedef node_asn  */
 #define ASN1_ETYPE_CONSTANT       1
@@ -183,7 +183,7 @@ extern "C"
 		       const char *vectorName, char *errorDescription);
 
   extern ASN1_API int
-    asn1_array2tree (const asn1_static_node_t * array,
+    asn1_array2tree (const asn1_static_node * array,
 		     asn1_node * definitions, char *errorDescription);
 
   extern ASN1_API void
@@ -307,7 +307,8 @@ typedef int asn1_retCode;	/* type returned by libtasn1 functions */
 #define ASN1_TYPE_EMPTY NULL
 
 #define static_struct_asn asn1_static_node_st
-#define ASN1_ARRAY_TYPE asn1_static_node_t
+#define ASN1_ARRAY_TYPE asn1_static_node
+#define asn1_static_node_t asn1_static_node
 
 #define node_data_struct asn1_data_node_st
 #define ASN1_DATA_NODE asn1_data_node_st
diff --git a/lib/structure.c b/lib/structure.c
index 4613d06..32be50b 100644
--- a/lib/structure.c
+++ b/lib/structure.c
@@ -96,7 +96,7 @@ _asn1_create_static_structure (asn1_node pointer, char *output_file_name,
 
   fprintf (file, "#include <libtasn1.h>\n\n");
 
-  fprintf (file, "const asn1_static_node_t %s[] = {\n", vector_name);
+  fprintf (file, "const asn1_static_node %s[] = {\n", vector_name);
 
   p = pointer;
 
@@ -174,7 +174,7 @@ _asn1_create_static_structure (asn1_node pointer, char *output_file_name,
  *   %ASN1_ARRAY_ERROR if the array pointed by @array is wrong.
  **/
 int
-asn1_array2tree (const asn1_static_node_t * array, asn1_node * definitions,
+asn1_array2tree (const asn1_static_node * array, asn1_node * definitions,
 		 char *errorDescription)
 {
   asn1_node p, p_last = NULL;
diff --git a/tests/Test_tree_asn1_tab.c b/tests/Test_tree_asn1_tab.c
index 9866eab..3d406d1 100644
--- a/tests/Test_tree_asn1_tab.c
+++ b/tests/Test_tree_asn1_tab.c
@@ -4,7 +4,7 @@
 
 #include <libtasn1.h>
 
-const asn1_static_node_t Test_tree_asn1_tab[] = {
+const asn1_static_node Test_tree_asn1_tab[] = {
   { "TEST_TREE", 536875024, NULL },
   { NULL, 1610612748, NULL },
   { "iso", 1073741825, "1"},


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Thu Nov 01 11:11:15 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TTwQN-0004kU-RW
	for mharc-libtasn1-commit@gnu.org; Thu, 01 Nov 2012 11:11:15 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50584)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TTwQG-0004hv-Sv
	for libtasn1-commit@gnu.org; Thu, 01 Nov 2012 11:11:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TTwQB-0003M7-KO
	for libtasn1-commit@gnu.org; Thu, 01 Nov 2012 11:11:08 -0400
Received: from vcs.savannah.gnu.org ([140.186.70.72]:54463)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TTwQB-0003M3-GV
	for libtasn1-commit@gnu.org; Thu, 01 Nov 2012 11:11:03 -0400
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TTwQB-0004PO-3x
	for libtasn1-commit@gnu.org; Thu, 01 Nov 2012 15:11:03 +0000
Date: Thu, 01 Nov 2012 15:11:03 +0000
Message-Id: <E1TTwQB-0004PO-3x@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_0-3-g6285240
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: b7bd8b012c913cf0a85b3e620ccdf408567f8027
X-Git-Newrev: 62852408cf7e7afafcb9baa01cf7b2740cc46680
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 01 Nov 2012 15:11:13 -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=62852408cf7e7afafcb9baa01cf7b2740cc46680

The branch, master has been updated
       via  62852408cf7e7afafcb9baa01cf7b2740cc46680 (commit)
       via  3dc5d4be516c7c0a86c2fbe1098debb485e50289 (commit)
      from  b7bd8b012c913cf0a85b3e620ccdf408567f8027 (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 62852408cf7e7afafcb9baa01cf7b2740cc46680
Author: Thierry Reding <thierry.reding@avionic-design.de>
Date:   Thu Nov 1 09:13:54 2012 +0100

    Fix out of tree build
    
    This fixes a few occurrences where files are incorrectly referenced from
    the build directory instead of the source directory, therefore causing
    breakage when building out of tree.
    
    Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
    Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>

commit 3dc5d4be516c7c0a86c2fbe1098debb485e50289
Author: Thierry Reding <thierry.reding@avionic-design.de>
Date:   Thu Nov 1 09:13:53 2012 +0100

    Fix bootstrap with automake 1.12
    
    automake 1.12 and later require explicit checking for the archiver using
    the AM_PROG_AR command when building libraries using libtool.
    
    Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
    Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>

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

Summary of changes:
 configure.ac    |    1 +
 doc/Makefile.am |    4 ++--
 lib/Makefile.am |    2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index aae27f3..0acd74a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,6 +40,7 @@ AC_PROG_YACC
 dnl Checks for programs.
 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
 AC_LIBTOOL_WIN32_DLL
+AM_PROG_AR
 AM_PROG_LIBTOOL
 GTK_DOC_CHECK(1.2)
 
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 4cba357..037890b 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -136,8 +136,8 @@ $(gdoc_MANS) $(gdoc_TEXINFOS):
 GDOC_SRC = $(top_srcdir)/lib/decoding.c $(top_srcdir)/lib/errors.c	\
 	$(top_srcdir)/lib/parser_aux.c $(top_srcdir)/lib/coding.c	\
 	$(top_srcdir)/lib/element.c $(top_srcdir)/lib/gstr.c		\
-	$(top_srcdir)/lib/structure.c $(top_builddir)/lib/ASN1.c	\
-	$(top_builddir)/lib/version.c
+	$(top_srcdir)/lib/structure.c $(top_srcdir)/lib/ASN1.c		\
+	$(top_srcdir)/lib/version.c
 
 update-makefile:
 	@MANS=""; \
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 044f72d..2ea4c09 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -19,7 +19,7 @@
 SUBDIRS = gllib
 
 AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAG_VISIBILITY)
-AM_CPPFLAGS = -I$(builddir)/gllib -DASN1_BUILDING
+AM_CPPFLAGS = -I$(srcdir)/gllib -DASN1_BUILDING
 
 include_HEADERS = libtasn1.h
 


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Tue Nov 06 09:54:05 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TVkXV-0001Xh-3f
	for mharc-libtasn1-commit@gnu.org; Tue, 06 Nov 2012 09:54:05 -0500
Received: from eggs.gnu.org ([208.118.235.92]:41198)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TVkXM-0001Vp-GO
	for libtasn1-commit@gnu.org; Tue, 06 Nov 2012 09:54:03 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TVkXB-0002CL-Ix
	for libtasn1-commit@gnu.org; Tue, 06 Nov 2012 09:53:56 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:37054)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TVkXB-0002CH-EV
	for libtasn1-commit@gnu.org; Tue, 06 Nov 2012 09:53:45 -0500
Received: from jas by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TVkX9-0005Kx-Gk
	for libtasn1-commit@gnu.org; Tue, 06 Nov 2012 14:53:44 +0000
Date: Tue, 06 Nov 2012 14:53:43 +0000
Message-Id: <E1TVkX9-0005Kx-Gk@vcs.savannah.gnu.org>
From: "Simon Josefsson" <simon@josefsson.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_0-7-g05945e2
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 62852408cf7e7afafcb9baa01cf7b2740cc46680
X-Git-Newrev: 05945e2cc4b3bf1af7af21589cd377310b03f9dd
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 06 Nov 2012 14:54:03 -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=05945e2cc4b3bf1af7af21589cd377310b03f9dd

The branch, master has been updated
       via  05945e2cc4b3bf1af7af21589cd377310b03f9dd (commit)
       via  20c6a0120d22a3e6024319f8cfe4a97b2d8df88a (commit)
       via  c9944365bbd4e957e7df8f05dd5cf386ce7824a1 (commit)
       via  6ec5b1f5915f8c425ea5a436af01518fcb6eb04a (commit)
      from  62852408cf7e7afafcb9baa01cf7b2740cc46680 (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 05945e2cc4b3bf1af7af21589cd377310b03f9dd
Author: Ivan Shmakov <oneingray@gmail.com>
Date:   Tue Nov 6 12:47:48 2012 +0700

    Typographical and wording fixes to doc/libtasn1.texi
    
    doc/libtasn1.texi: A bunch of typographical and wording fixes
    and improvements.
    
    Signed-off-by: Simon Josefsson <simon@josefsson.org>

commit 20c6a0120d22a3e6024319f8cfe4a97b2d8df88a
Author: Simon Josefsson <simon@josefsson.org>
Date:   Tue Nov 6 15:49:59 2012 +0100

    Ignore more.

commit c9944365bbd4e957e7df8f05dd5cf386ce7824a1
Author: Simon Josefsson <simon@josefsson.org>
Date:   Tue Nov 6 15:49:29 2012 +0100

    Don't overload the 'time' global name.

commit 6ec5b1f5915f8c425ea5a436af01518fcb6eb04a
Author: Simon Josefsson <simon@josefsson.org>
Date:   Tue Nov 6 15:49:02 2012 +0100

    Generated.

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

Summary of changes:
 .gitignore        |   10 +++
 doc/Makefile.am   |    6 +-
 doc/libtasn1.texi |  158 +++++++++++++++++++++++++++++++---------------------
 src/benchmark.c   |   10 ++--
 4 files changed, 111 insertions(+), 73 deletions(-)

diff --git a/.gitignore b/.gitignore
index 9c56412..e6f9fc5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,11 +1,13 @@
 *.gcda
 *.gcno
 *.gcov
+ChangeLog
 INSTALL
 Makefile
 Makefile.in
 aclocal.m4
 autom4te.cache/
+build-aux/ar-lib
 build-aux/config.guess
 build-aux/config.sub
 build-aux/depcomp
@@ -100,6 +102,8 @@ gl/getopt.lo
 gl/getopt.o
 gl/getopt1.lo
 gl/getopt1.o
+gl/gettime.lo
+gl/gettime.o
 gl/libgnu.la
 gl/progname.lo
 gl/progname.o
@@ -107,8 +111,11 @@ gl/read-file.lo
 gl/read-file.o
 gl/stdio.h
 gl/stdlib.h
+gl/sys/
 gl/sys/stat.h
 gl/time.h
+gl/timespec.lo
+gl/timespec.o
 gl/unistd.h
 gl/version-etc-fsf.lo
 gl/version-etc-fsf.o
@@ -139,6 +146,8 @@ lib/gllib/arg-nonnull.h
 lib/gllib/c++defs.h
 lib/gllib/dummy.lo
 lib/gllib/dummy.o
+lib/gllib/hash-pjw-bare.lo
+lib/gllib/hash-pjw-bare.o
 lib/gllib/libgnu.la
 lib/gllib/string.h
 lib/gllib/warn-on-use.h
@@ -172,6 +181,7 @@ src/asn1Decoding
 src/asn1Decoding.o
 src/asn1Parser
 src/asn1Parser.o
+src/benchmark.o
 stamp-h1
 tests/.deps/
 tests/Makefile
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 037890b..71f4b69 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -63,8 +63,6 @@ gdoc_MANS += man/asn1_expand_any_defined_by.3
 gdoc_MANS += man/asn1_expand_octet_string.3
 gdoc_MANS += man/asn1_perror.3
 gdoc_MANS += man/asn1_strerror.3
-gdoc_MANS += man/libtasn1_perror.3
-gdoc_MANS += man/libtasn1_strerror.3
 gdoc_MANS += man/asn1_find_node.3
 gdoc_MANS += man/asn1_length_der.3
 gdoc_MANS += man/asn1_octet_der.3
@@ -73,6 +71,7 @@ gdoc_MANS += man/asn1_der_coding.3
 gdoc_MANS += man/asn1_write_value.3
 gdoc_MANS += man/asn1_read_value.3
 gdoc_MANS += man/asn1_read_tag.3
+gdoc_MANS += man/asn1_read_node_value.3
 gdoc_MANS += man/asn1_array2tree.3
 gdoc_MANS += man/asn1_delete_structure.3
 gdoc_MANS += man/asn1_delete_element.3
@@ -106,8 +105,6 @@ gdoc_TEXINFOS += texi/asn1_expand_any_defined_by.texi
 gdoc_TEXINFOS += texi/asn1_expand_octet_string.texi
 gdoc_TEXINFOS += texi/asn1_perror.texi
 gdoc_TEXINFOS += texi/asn1_strerror.texi
-gdoc_TEXINFOS += texi/libtasn1_perror.texi
-gdoc_TEXINFOS += texi/libtasn1_strerror.texi
 gdoc_TEXINFOS += texi/asn1_find_node.texi
 gdoc_TEXINFOS += texi/asn1_length_der.texi
 gdoc_TEXINFOS += texi/asn1_octet_der.texi
@@ -116,6 +113,7 @@ gdoc_TEXINFOS += texi/asn1_der_coding.texi
 gdoc_TEXINFOS += texi/asn1_write_value.texi
 gdoc_TEXINFOS += texi/asn1_read_value.texi
 gdoc_TEXINFOS += texi/asn1_read_tag.texi
+gdoc_TEXINFOS += texi/asn1_read_node_value.texi
 gdoc_TEXINFOS += texi/asn1_array2tree.texi
 gdoc_TEXINFOS += texi/asn1_delete_structure.texi
 gdoc_TEXINFOS += texi/asn1_delete_element.texi
diff --git a/doc/libtasn1.texi b/doc/libtasn1.texi
index 13238aa..799f71f 100644
--- a/doc/libtasn1.texi
+++ b/doc/libtasn1.texi
@@ -13,7 +13,7 @@
 This manual is for GNU Libtasn1
 (version @value{VERSION}, @value{UPDATED}),
 which is a library for Abstract Syntax Notation One (ASN.1) and
-Distinguish Encoding Rules (DER) manipulation.
+Distinguished Encoding Rules (DER) manipulation.
 
 Copyright @copyright{} 2001-2012 Free Software Foundation, Inc.
 
@@ -68,21 +68,23 @@ Indices
 @node Introduction
 @chapter Introduction
 
-This document describes the Libtasn1 library developed for ASN.1
-(Abstract Syntax Notation One) structures management and DER
-(Distinguished Encoding Rules) encoding functions.
+This document describes the Libtasn1 library that provides
+Abstract Syntax Notation One (ASN.1, as specified by the X.680 ITU-T
+recommendation) parsing and structures management,
+and Distinguished Encoding Rules (DER, as per X.690) encoding and
+decoding functions.
 
 The main features of this library are:
 
 @itemize @bullet
 
-@item On line ASN1 structure management that doesn't require any
+@item On-line ASN.1 structure management that doesn't require any
 C code file generation.
 
-@item Off line ASN1 structure management with C code file generation
+@item Off-line ASN.1 structure management with C code file generation
 containing an array.
 
-@item DER (Distinguish Encoding Rules) encoding.
+@item Distinguished Encoding Rules (DER) encoding support.
 
 @item No limits for INTEGER and ENUMERATED values.
 
@@ -92,14 +94,14 @@ of the GNU Lesser General Public License version 2.1 or later.  The
 command line tools, self-tests and build infrastructure are licensed
 under the GNU General Public License version 3.0 or later.
 
-@item It's thread-safe.
+@item Thread-safety.
 @cindex threads
 No global variables are used and multiple library handles and session
 handles may be used in parallel.
 
-@item It's portable.
+@item Portability.
 @cindex Porting
-It should work on all Unix like operating systems, including Windows.
+The code should work on all Unix like operating systems, and Windows.
 The library itself should be portable to any C89 system, not even
 POSIX is required.
 @end itemize
@@ -119,9 +121,15 @@ POSIX is required.
 
 @cindex ASN.1 schema
 
-The parser is case sensitive. The comments begin with "-- " and end at
-the end of lines.  An example is in "pkix.asn" file.  ASN.1
-definitions must have this syntax:
+The parser is case sensitive.  The comments begin with @code{--} and
+end either with another @code{--}, or at the end of the respective
+line, whichever comes first.  The C-style @code{/*}, @code{*/}
+comments are not supported.
+
+For an example of the syntax, check the @file{pkix.asn} file
+distributed with the library.
+
+ASN.1 definitions must follow the syntax below:
 
 @verbatim
       definitions_name {<object definition>}
@@ -135,15 +143,15 @@ definitions must have this syntax:
       END
 @end verbatim
 
-The token "::=" must be separate from others elements, so this is a
-wrong declaration:
+The @code{::=} token must be separate from other elements, so the
+following declaration is invalid:
 
 @example
-      ;; INCORRECT
-      Version ::=INTEGER
+   -- INCORRECT
+   Version ::=INTEGER
 @end example
 
-the correct form is:
+The correct form is:
 
 @example
    Version ::= INTEGER
@@ -155,30 +163,31 @@ Here is the list of types that the parser can manage:
 
 @itemize @bullet
 
-@item INTEGER
-@item ENUMERATED
-@item BOOLEAN
-@item OBJECT IDENTIFIER
-@item NULL
-@item BIT STRING
-@item OCTET STRING
-@item UTCTime
-@item GeneralizedTime
-@item GeneralString
-@item SEQUENCE
-@item SEQUENCE OF
-@item SET
-@item SET OF
-@item CHOICE
-@item ANY
-@item ANY DEFINED BY
+@item @code{INTEGER};
+@item @code{ENUMERATED};
+@item @code{BOOLEAN};
+@item @code{OBJECT IDENTIFIER};
+@item @code{NULL};
+@item @code{BIT STRING};
+@item @code{OCTET STRING};
+@item @code{UTCTime};
+@item @code{GeneralizedTime};
+@item @code{GeneralString};
+@item @code{SEQUENCE};
+@item @code{SEQUENCE OF};
+@item @code{SET};
+@item @code{SET OF};
+@item @code{CHOICE};
+@item @code{ANY};
+@item @code{ANY DEFINED BY}.
 
 @end itemize
 
-This version doesn't manage REAL type. It doesn't allow the "EXPORT"
-and "IMPORT" sections too.
+This version doesn't handle the @code{REAL} type.  It doesn't support
+the @code{AUTOMATIC TAGS} option, and the @code{EXPORT} and
+@code{IMPORT} sections, either.
 
-The SIZE constraints are allowed, but no check is done on them.
+The @code{SIZE} constraints are allowed, but no check is done on them.
 
 @node Naming
 @section Naming
@@ -205,22 +214,26 @@ Consider this definition:
       END
 @end verbatim
 
-To identify the type 'Group' you have to use the null terminated
-string "Example.Group".  These strings are used in functions that are
-described below.
+The notation to access the @samp{Group} type of the @samp{Example}
+definition above is @samp{Example.Group} (as a NUL-terminated string.)
+Such strings are used in the functions described below.
 
 Others examples:
 
-Field 'id' in 'Group' type : "Example.Group.id".
+@itemize @bullet
+
+@item field @samp{id} of the @samp{Group} type: @samp{Example.Group.id};
+
+@item field @samp{value1} of the @samp{value} field of the @samp{Group}
+type: @samp{Example.Group.value.value1}.
 
-Field 'value1' in field 'value' in type 'Group':
-"Example.Group.value.value1".
+@end itemize
 
-Elements of structured types that don't have a name, receive the name
-"?1","?2", and so on.
+Elements of structured types unnamed by the respective definition
+receive the names @code{?1}, @code{?2}, and so on.
 
-The name "?LAST" indicates the last element of a @code{SET_OF} or
-@code{SEQUENCE_OF}.
+The @code{?LAST} name indicates the last element of a @code{SET OF} or
+@code{SEQUENCE OF}.
 
 @node Library Notes
 @section Library Notes
@@ -234,20 +247,20 @@ The header file of this library is @file{libtasn1.h}.
 The main type used in it is @code{asn1_node}, and it's used to store
 the ASN.1 definitions and structures (instances).
 
-The constant @code{NULL} can be used for the variable
+The @code{NULL} constant can be used for the variable
 initialization.  For example:
 
 @example
- asn1_node definitions=NULL;
+ asn1_node definitions = NULL;
 @end example
 
-Some functions require a parameter named errorDescription of char*
-type.  The array must be already allocated and must have at least
-@code{ASN1_MAX_ERROR_DESCRIPTION_SIZE} bytes (E.g, as in @code{char
-Description[ASN1_MAX_ERROR_DESCRIPTION_SIZE];}).
+Some functions require an @code{errorDescription} argument of type
+@code{char *}, pointing to a pre-allocated buffer of at least
+@code{ASN1_MAX_ERROR_DESCRIPTION_SIZE} bytes size (e.g., as in
+@samp{char description[ASN1_MAX_ERROR_DESCRIPTION_SIZE];}).
 
-@code{ASN1_MAX_NAME_SIZE} indicates the maximum number of characters of a
-name inside a file with ASN1 definitions.
+@code{ASN1_MAX_NAME_SIZE} is the maximum number of characters allowed
+for an ASN.1 identifier.
 
 @node Future developments
 @section Future developments
@@ -258,7 +271,7 @@ name inside a file with ASN1 definitions.
 @item Add functions for a C code file generation containing equivalent
 data structures (not a single array like now).
 
-@item Type REAL.
+@item The @code{REAL} type.
 
 @end itemize
 
@@ -275,7 +288,8 @@ data structures (not a single array like now).
 @section Invoking asn1Parser
 @cindex asn1Parser program
 
-@file{asn1Parser} reads one file with ASN1 definitions and generates a
+@command{asn1Parser} reads a single file with ASN.1 definitions and
+generates a
 file with an array to use with libtasn1 functions.
 
 @verbatim
@@ -293,7 +307,7 @@ Options:
 @section Invoking asn1Coding
 @cindex asn1Coding program
 
-@file{asn1Coding} generates a DER encoding from a file with ASN1
+@command{asn1Coding} generates a DER encoding from a file with ASN.1
 definitions and another one with assignments.
 
 The file with assignments must have this syntax:
@@ -307,6 +321,11 @@ nameString  value
 ...
 @end verbatim
 
+To specify the field of a @code{CHOICE} to be used, specify its name
+as a value to the @code{CHOICE} element itself.  Use @code{''} to
+denote the root element itself.
+(as in the example below.)
+
 The output file is a binary file with the DER encoding.
 
 @verbatim
@@ -320,7 +339,7 @@ Options:
  -o file : output file.
 @end verbatim
 
-For example, consider a ASN.1 definitions file as follows:
+For example, consider an ASN.1 definitions file as follows:
 
 @verbatim
 PKIX1 { }
@@ -346,18 +365,28 @@ r 42
 s 47
 @end verbatim
 
-Running the command below will generate a file @file{assign.out}
+Running the command below will generate a @file{assign.out} file,
 containing the DER encoding of @code{PKIX1.Dss-Sig-Value}.
 
 @verbatim
 $ asn1Coding pkix.asn assign.asn1
 @end verbatim
 
+If the root element is of the @code{CHOICE} type, the assignment file
+may be like (using the types defined in @file{pkix.asn}):
+@verbatim
+elt PKIX1Implicit88.GeneralName
+
+''      dNSName
+dNSName example.org
+@end verbatim
+
 @node Invoking asn1Decoding
 @section Invoking asn1Decoding
 @cindex asn1Decoding program
 
-@file{asn1Decoding} generates an ASN1 structure from a file with ASN1
+@command{asn1Decoding} generates an ASN.1 structure from a file with
+ASN.1
 definitions and a binary file with a DER encoding.
 
 @verbatim
@@ -371,8 +400,9 @@ Options:
  -o file : output file.
 @end verbatim
 
-For example, after generating the file @file{assign.out} from the
-example section of the @code{asn1Coding} command, the following
+For example, after generating the @file{assign.out} file from the
+example section of the @command{asn1Coding} command above, the
+following
 invocation will decode the DER data.
 
 @verbatim
diff --git a/src/benchmark.c b/src/benchmark.c
index f18ed1c..1ebf6b6 100644
--- a/src/benchmark.c
+++ b/src/benchmark.c
@@ -47,34 +47,34 @@ alarm_handler (int signo)
 #endif
 
 static void
-value2human (unsigned long bytes, double time, double *data, double *speed,
+value2human (unsigned long bytes, double secs, double *data, double *speed,
              char *metric)
 {
   if (bytes > 1000 && bytes < 1000 * 1000)
     {
       *data = ((double) bytes) / 1000;
-      *speed = *data / time;
+      *speed = *data / secs;
       strcpy (metric, "KB");
       return;
     }
   else if (bytes >= 1000 * 1000 && bytes < 1000 * 1000 * 1000)
     {
       *data = ((double) bytes) / (1000 * 1000);
-      *speed = *data / time;
+      *speed = *data / secs;
       strcpy (metric, "MB");
       return;
     }
   else if (bytes >= 1000 * 1000 * 1000)
     {
       *data = ((double) bytes) / (1000 * 1000 * 1000);
-      *speed = *data / time;
+      *speed = *data / secs;
       strcpy (metric, "GB");
       return;
     }
   else
     {
       *data = (double) bytes;
-      *speed = *data / time;
+      *speed = *data / secs;
       strcpy (metric, "bytes");
       return;
     }


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Tue Nov 06 11:27:27 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TVlzr-0003pp-9a
	for mharc-libtasn1-commit@gnu.org; Tue, 06 Nov 2012 11:27:27 -0500
Received: from eggs.gnu.org ([208.118.235.92]:59487)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TVlzj-0003p7-AO
	for libtasn1-commit@gnu.org; Tue, 06 Nov 2012 11:27:25 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TVlzd-00018q-JT
	for libtasn1-commit@gnu.org; Tue, 06 Nov 2012 11:27:19 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:50987)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TVlzd-00018j-Ff
	for libtasn1-commit@gnu.org; Tue, 06 Nov 2012 11:27:13 -0500
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TVlzc-0001hD-V2
	for libtasn1-commit@gnu.org; Tue, 06 Nov 2012 16:27:13 +0000
Date: Tue, 06 Nov 2012 16:27:12 +0000
Message-Id: <E1TVlzc-0001hD-V2@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_0-8-g708e510
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 05945e2cc4b3bf1af7af21589cd377310b03f9dd
X-Git-Newrev: 708e5101fa8b1d4ee2b1dc8247216ea34182a963
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 06 Nov 2012 16:27:25 -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=708e5101fa8b1d4ee2b1dc8247216ea34182a963

The branch, master has been updated
       via  708e5101fa8b1d4ee2b1dc8247216ea34182a963 (commit)
      from  05945e2cc4b3bf1af7af21589cd377310b03f9dd (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 708e5101fa8b1d4ee2b1dc8247216ea34182a963
Author: Ivan Shmakov <oneingray@gmail.com>
Date:   Tue Nov 6 23:16:03 2012 +0700

    use stderr for status messages in asn1{Coding, Decoding, Parser}
    
    Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>

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

Summary of changes:
 src/asn1Coding.c   |   45 +++++++++++++++++++++++++--------------------
 src/asn1Decoding.c |   23 ++++++++++++++---------
 src/asn1Parser.c   |   17 ++++++++++-------
 tests/crlf         |    2 +-
 4 files changed, 50 insertions(+), 37 deletions(-)

diff --git a/src/asn1Coding.c b/src/asn1Coding.c
index 00057be..0a6a996 100644
--- a/src/asn1Coding.c
+++ b/src/asn1Coding.c
@@ -194,7 +194,7 @@ main (int argc, char *argv[])
   if (optind == argc || optind == argc - 1)
     {
       free (outputFileName);
-      fprintf (stderr, "asn1Coding: input files missing\n");
+      fputs ("asn1Coding: input files missing\n", stderr);
       usage (EXIT_FAILURE);
     }
 
@@ -210,18 +210,20 @@ main (int argc, char *argv[])
   switch (asn1_result)
     {
     case ASN1_SUCCESS:
-      printf ("Parse: done.\n");
+      fputs ("Parse: done.\n", stderr);
       break;
     case ASN1_FILE_NOT_FOUND:
-      printf ("asn1Coding: FILE %s NOT FOUND\n", inputFileAsnName);
+      fprintf (stderr, "asn1Coding: FILE %s NOT FOUND\n",
+               inputFileAsnName);
       break;
     case ASN1_SYNTAX_ERROR:
     case ASN1_IDENTIFIER_NOT_FOUND:
     case ASN1_NAME_TOO_LONG:
-      printf ("asn1Coding: %s\n", errorDescription);
+      fprintf (stderr, "asn1Coding: %s\n", errorDescription);
       break;
     default:
-      printf ("libtasn1 ERROR: %s\n", asn1_strerror (asn1_result));
+      fprintf (stderr, "libtasn1 ERROR: %s\n",
+               asn1_strerror (asn1_result));
     }
 
   if (asn1_result != ASN1_SUCCESS)
@@ -236,18 +238,19 @@ main (int argc, char *argv[])
 
   if (inputFile == NULL)
     {
-      printf ("asn1Coding: file '%s' not found\n", inputFileAssignmentName);
+      fprintf (stderr, "asn1Coding: file '%s' not found\n",
+               inputFileAssignmentName);
       free (inputFileAsnName);
       free (inputFileAssignmentName);
       exit (1);
     }
 
 
-  printf ("\n");
+  putc ('\n', stderr);
 
   while (readAssignment (inputFile, varName, value) == ASSIGNMENT_SUCCESS)
     {
-      printf ("var=%s, value=%s\n", varName, value);
+      fprintf (stderr, "var=%s, value=%s\n", varName, value);
       if (structure == NULL)
 	{
 	  asn1_result = asn1_create_element (definitions, value, &structure);
@@ -257,7 +260,8 @@ main (int argc, char *argv[])
 
       if (asn1_result != ASN1_SUCCESS)
 	{
-	  printf ("libtasn1 ERROR: %s\n", asn1_strerror (asn1_result));
+	  fprintf (stderr, "libtasn1 ERROR: %s\n",
+	           asn1_strerror (asn1_result));
 
 	  asn1_delete_structure (&definitions);
 	  asn1_delete_structure (&structure);
@@ -271,8 +275,8 @@ main (int argc, char *argv[])
     }
   fclose (inputFile);
 
-  printf ("\n");
-  asn1_print_structure (stdout, structure, "", ASN1_PRINT_NAME_TYPE_VALUE);
+  putc ('\n', stderr);
+  asn1_print_structure (stderr, structure, "", ASN1_PRINT_NAME_TYPE_VALUE);
 
   der_len = 0;
   asn1_result = asn1_der_coding (structure, "", der, &der_len,
@@ -283,10 +287,10 @@ main (int argc, char *argv[])
       asn1_result = asn1_der_coding (structure, "", der, &der_len,
 				     errorDescription);
     }
-  printf ("\nCoding: %s\n\n", asn1_strerror (asn1_result));
+  fprintf (stderr, "\nCoding: %s\n\n", asn1_strerror (asn1_result));
   if (asn1_result != ASN1_SUCCESS)
     {
-      printf ("asn1Coding: %s\n", errorDescription);
+      fprintf (stderr, "asn1Coding: %s\n", errorDescription);
 
       free (der);
 
@@ -300,10 +304,10 @@ main (int argc, char *argv[])
     }
 
   /* Print the 'Certificate1' DER encoding */
-  printf ("-----------------\nNumber of bytes=%i\n", der_len);
+  fprintf (stderr, "-----------------\nNumber of bytes=%i\n", der_len);
   for (k = 0; k < der_len; k++)
-    printf ("%02x ", der[k]);
-  printf ("\n-----------------\n");
+    fprintf (stderr, "%02x ", der[k]);
+  fputs ("\n-----------------\n", stderr);
 
   asn1_delete_structure (&definitions);
   asn1_delete_structure (&structure);
@@ -313,14 +317,15 @@ main (int argc, char *argv[])
       if (outputFileName == NULL)
 	createFileName (inputFileAssignmentName, &outputFileName);
 
-      printf ("\nOutputFile=%s\n", outputFileName);
+      fprintf (stderr, "\nOutputFile=%s\n", outputFileName);
 
       outputFile = fopen (outputFileName, "w");
 
       if (outputFile == NULL)
 	{
-	  printf ("asn1Coding: output file '%s' not available\n",
-		  outputFileName);
+	  fprintf (stderr,
+	           "asn1Coding: output file '%s' not available\n",
+	           outputFileName);
 	  free (der);
 	  free (inputFileAsnName);
 	  free (inputFileAssignmentName);
@@ -331,7 +336,7 @@ main (int argc, char *argv[])
       for (k = 0; k < der_len; k++)
 	fprintf (outputFile, "%c", der[k]);
       fclose (outputFile);
-      printf ("\nWriting: done.\n");
+      fputs ("\nWriting: done.\n", stderr);
     }
 
   free (der);
diff --git a/src/asn1Decoding.c b/src/asn1Decoding.c
index ee09e18..00156c5 100644
--- a/src/asn1Decoding.c
+++ b/src/asn1Decoding.c
@@ -144,18 +144,20 @@ main (int argc, char *argv[])
   switch (asn1_result)
     {
     case ASN1_SUCCESS:
-      printf ("Parse: done.\n");
+      fprintf (stderr, "Parse: done.\n");
       break;
     case ASN1_FILE_NOT_FOUND:
-      printf ("asn1Decoding: FILE %s NOT FOUND\n", inputFileAsnName);
+      fprintf (stderr, "asn1Decoding: FILE %s NOT FOUND\n",
+               inputFileAsnName);
       break;
     case ASN1_SYNTAX_ERROR:
     case ASN1_IDENTIFIER_NOT_FOUND:
     case ASN1_NAME_TOO_LONG:
-      printf ("asn1Decoding: %s\n", errorDescription);
+      fprintf (stderr, "asn1Decoding: %s\n", errorDescription);
       break;
     default:
-      printf ("libtasn1 ERROR: %s\n", asn1_strerror (asn1_result));
+      fprintf (stderr, "libtasn1 ERROR: %s\n",
+               asn1_strerror (asn1_result));
     }
 
   if (asn1_result != ASN1_SUCCESS)
@@ -175,7 +177,8 @@ main (int argc, char *argv[])
 
   if (der == NULL)
     {
-      printf ("asn1Decoding: could not read '%s'\n", inputFileDerName);
+      fprintf (stderr, "asn1Decoding: could not read '%s'\n",
+               inputFileDerName);
       asn1_delete_structure (&definitions);
 
       free (inputFileAsnName);
@@ -238,7 +241,8 @@ char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
 
   if (asn1_result != ASN1_SUCCESS)
     {
-      printf ("Structure creation: %s\n", asn1_strerror (asn1_result));
+      fprintf (stderr, "Structure creation: %s\n",
+               asn1_strerror (asn1_result));
       asn1_delete_structure (&structure);
       return asn1_result;
     }
@@ -246,17 +250,18 @@ char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
   asn1_result =
     asn1_der_decoding (&structure, der, der_len, errorDescription);
 
-  if (!benchmark) printf ("\nDecoding: %s\n", asn1_strerror (asn1_result));
+  if (!benchmark)
+    fprintf (stderr, "\nDecoding: %s\n", asn1_strerror (asn1_result));
   if (asn1_result != ASN1_SUCCESS)
     {
-      printf ("asn1Decoding: %s\n", errorDescription);
+      fprintf (stderr, "asn1Decoding: %s\n", errorDescription);
       asn1_delete_structure (&structure);
       return asn1_result;
     }
 
   if (!benchmark)
     {
-      printf ("\nDECODING RESULT:\n");
+      fprintf (stderr, "\nDECODING RESULT:\n");
       asn1_print_structure (stdout, structure, "", ASN1_PRINT_NAME_TYPE_VALUE);
     }
   asn1_delete_structure (&structure);
diff --git a/src/asn1Parser.c b/src/asn1Parser.c
index 430ac7f..f19a9ef 100644
--- a/src/asn1Parser.c
+++ b/src/asn1Parser.c
@@ -100,10 +100,11 @@ main (int argc, char *argv[])
       switch (option_result)
 	{
 	case 0:
-	  printf ("option %s", long_options[option_index].name);
+	  fprintf (stderr, "option %s",
+	           long_options[option_index].name);
 	  if (optarg)
-	    printf (" with arg %s", optarg);
-	  printf ("\n");
+	    fprintf (stderr, " with arg %s", optarg);
+	  putc ('\n', stderr);
 	  break;
 	case 'h':		/* HELP */
 	  free (outputFileName);
@@ -170,18 +171,20 @@ main (int argc, char *argv[])
   switch (parse_result)
     {
     case ASN1_SUCCESS:
-      printf ("Done.\n");
+      fputs ("Done.\n", stderr);
       break;
     case ASN1_FILE_NOT_FOUND:
-      printf ("asn1Parser: FILE %s NOT FOUND\n", inputFileName);
+      fprintf (stderr, "asn1Parser: FILE %s NOT FOUND\n",
+               inputFileName);
       break;
     case ASN1_SYNTAX_ERROR:
     case ASN1_IDENTIFIER_NOT_FOUND:
     case ASN1_NAME_TOO_LONG:
-      printf ("asn1Parser: %s\n", errorDescription);
+      fprintf (stderr, "asn1Parser: %s\n", errorDescription);
       break;
     default:
-      printf ("libtasn1 ERROR: %s\n", asn1_strerror (parse_result));
+      fprintf (stderr, "libtasn1 ERROR: %s\n",
+               asn1_strerror (parse_result));
     }
 
 
diff --git a/tests/crlf b/tests/crlf
index 7d74c8b..e2f88cc 100755
--- a/tests/crlf
+++ b/tests/crlf
@@ -32,4 +32,4 @@ ASN1DECODING=../src/asn1Decoding${EXEEXT}
 $ASN1DECODING \
     $srcdir/../examples/pkix.asn \
     $srcdir/crlf.cer \
-    PKIX1Implicit88.Certificate >/dev/null
+    PKIX1Implicit88.Certificate >/dev/null 2>&1


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Fri Nov 09 18:19:15 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TWxr1-0003VP-DI
	for mharc-libtasn1-commit@gnu.org; Fri, 09 Nov 2012 18:19:15 -0500
Received: from eggs.gnu.org ([208.118.235.92]:58829)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TWxqz-0003US-8x
	for libtasn1-commit@gnu.org; Fri, 09 Nov 2012 18:19:14 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TWxqw-0006Rx-KN
	for libtasn1-commit@gnu.org; Fri, 09 Nov 2012 18:19:13 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:35890)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TWxqw-0006RS-Gg
	for libtasn1-commit@gnu.org; Fri, 09 Nov 2012 18:19:10 -0500
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TWxqw-0004pH-3e
	for libtasn1-commit@gnu.org; Fri, 09 Nov 2012 23:19:10 +0000
Date: Fri, 09 Nov 2012 23:19:10 +0000
Message-Id: <E1TWxqw-0004pH-3e@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_0-9-ga26e0f5
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 708e5101fa8b1d4ee2b1dc8247216ea34182a963
X-Git-Newrev: a26e0f5c84405ba760022749984bb73f1d548431
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 09 Nov 2012 23:19:14 -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=a26e0f5c84405ba760022749984bb73f1d548431

The branch, master has been updated
       via  a26e0f5c84405ba760022749984bb73f1d548431 (commit)
      from  708e5101fa8b1d4ee2b1dc8247216ea34182a963 (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 a26e0f5c84405ba760022749984bb73f1d548431
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Sat Nov 10 00:18:37 2012 +0100

    Check for errors reading the assignment file in asn1Coding.
    
    src/asn1Coding.c: Check the value returned by readAssignment ()
    to be either ASSIGNMENT_SUCCESS or ASSIGNMENT_EOF.
    Patch by Ivan Shmakov.

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

Summary of changes:
 src/asn1Coding.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/asn1Coding.c b/src/asn1Coding.c
index 0a6a996..700e958 100644
--- a/src/asn1Coding.c
+++ b/src/asn1Coding.c
@@ -144,6 +144,7 @@ main (int argc, char *argv[])
   unsigned char *der = NULL;
   int der_len;
   int k;
+  int last_ra;
 
   set_program_name (argv[0]);
 
@@ -248,7 +249,8 @@ main (int argc, char *argv[])
 
   putc ('\n', stderr);
 
-  while (readAssignment (inputFile, varName, value) == ASSIGNMENT_SUCCESS)
+  while ((last_ra = readAssignment (inputFile, varName, value))
+          == ASSIGNMENT_SUCCESS)
     {
       fprintf (stderr, "var=%s, value=%s\n", varName, value);
       if (structure == NULL)
@@ -273,6 +275,11 @@ main (int argc, char *argv[])
 	  exit (1);
 	}
     }
+  if (last_ra != ASSIGNMENT_EOF)
+    {
+      fprintf (stderr, "asn1Coding: error reading assignment file\n");
+      exit (1);
+    }
   fclose (inputFile);
 
   putc ('\n', stderr);


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Thu Nov 22 13:14:10 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TbbHu-0003dV-IE
	for mharc-libtasn1-commit@gnu.org; Thu, 22 Nov 2012 13:14:10 -0500
Received: from eggs.gnu.org ([208.118.235.92]:46644)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TbbHa-0003Vu-Sq
	for libtasn1-commit@gnu.org; Thu, 22 Nov 2012 13:14:08 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TbbHL-0005Ys-Oj
	for libtasn1-commit@gnu.org; Thu, 22 Nov 2012 13:13:50 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:37136)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TbbHL-0005YV-Fs
	for libtasn1-commit@gnu.org; Thu, 22 Nov 2012 13:13:35 -0500
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TbbHL-00011K-4D
	for libtasn1-commit@gnu.org; Thu, 22 Nov 2012 18:13:35 +0000
Date: Thu, 22 Nov 2012 18:13:35 +0000
Message-Id: <E1TbbHL-00011K-4D@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_0-13-g3b545f0
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: a26e0f5c84405ba760022749984bb73f1d548431
X-Git-Newrev: 3b545f01f74778112769ef1a1225324d6428423a
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 22 Nov 2012 18:14:09 -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=3b545f01f74778112769ef1a1225324d6428423a

The branch, master has been updated
       via  3b545f01f74778112769ef1a1225324d6428423a (commit)
       via  19c67083e19f4618f4401cd4fcdee199f985a927 (commit)
       via  311898c383b794d46e076d3e60952663b2e50b5c (commit)
       via  63db52e21259ccb3910978af1d60d75699f478c0 (commit)
      from  a26e0f5c84405ba760022749984bb73f1d548431 (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 3b545f01f74778112769ef1a1225324d6428423a
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Thu Nov 22 19:13:30 2012 +0100

    documented updates

commit 19c67083e19f4618f4401cd4fcdee199f985a927
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Thu Nov 22 19:09:56 2012 +0100

    indented C code in ASN1.y, and added more verbose error reporting.

commit 311898c383b794d46e076d3e60952663b2e50b5c
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Thu Nov 22 18:23:34 2012 +0100

    idented code

commit 63db52e21259ccb3910978af1d60d75699f478c0
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Thu Nov 22 01:41:31 2012 +0100

    Added more ASN.1 string types and several simplifications.

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

Summary of changes:
 NEWS                |    4 +
 lib/ASN1.c          | 1622 ++++++++++++++++++++++++++++++---------------------
 lib/ASN1.y          |  762 ++++++++++++++-----------
 lib/coding.c        |  205 +++----
 lib/decoding.c      |  299 ++++------
 lib/element.c       |  176 +++---
 lib/int.h           |   32 +-
 lib/libtasn1.h      |   18 +-
 lib/parser_aux.c    |   44 +-
 lib/structure.c     |  152 +++--
 tests/Test_parser.c |   11 +-
 11 files changed, 1821 insertions(+), 1504 deletions(-)

diff --git a/NEWS b/NEWS
index d2503bb..9997ea1 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,10 @@ GNU Libtasn1 NEWS                                     -*- outline -*-
 * Noteworthy changes in release 3.1 (unreleased) [stable]
 - Completed rename of types:
   ASN1_ARRAY_TYPE -> asn1_static_node (was asn1_static_node_t)
+- Added new types: VisibleString, NumericString, IA5String, TeletexString,
+  PrintableString, UniversalString, BMPString, UTF8String. When re-defined
+  a warning is being instead of failing.
+- Parser outputs more detailed syntax error message.
 
 * Noteworthy changes in release 3.0 (2012-10-28) [stable]
 - Added tool in tests/ to benchmark X.509 structure decoding.
diff --git a/lib/ASN1.c b/lib/ASN1.c
index 1aaca9a..67d2f04 100644
--- a/lib/ASN1.c
+++ b/lib/ASN1.c
@@ -107,29 +107,31 @@
 #include <int.h>
 #include <parser_aux.h>
 #include <structure.h>
+#include <libtasn1.h>
 
 static FILE *file_asn1;			/* Pointer to file to parse */
-static int result_parse;	/* result of the parser
+static int result_parse = 0;	/* result of the parser
 					   algorithm */
 static asn1_node p_tree;		/* pointer to the root of the
 					   structure created by the
 					   parser*/
-static unsigned long lineNumber;	/* line number describing the
+static unsigned int line_number;	/* line number describing the
 					   parser position inside the
 					   file */
-static char lastToken[ASN1_MAX_NAME_SIZE+1];	/* last token find in the file
+static char last_error[ASN1_MAX_ERROR_DESCRIPTION_SIZE] = "";
+static char last_token[ASN1_MAX_NAME_SIZE+1];	/* last token find in the file
 					   to parse before the 'parse
 					   error' */
 extern char _asn1_identifierMissing[];
-static const char *fileName;		/* file to parse */
+static const char *file_name;		/* file to parse */
 
-static int _asn1_yyerror (const char *);
+static void _asn1_yyerror (const char *);
 static int _asn1_yylex(void);
 
 
 
 /* Line 268 of yacc.c  */
-#line 133 "ASN1.c"
+#line 135 "ASN1.c"
 
 /* Enabling traces.  */
 #ifndef YYDEBUG
@@ -141,7 +143,7 @@ static int _asn1_yylex(void);
 # undef YYERROR_VERBOSE
 # define YYERROR_VERBOSE 1
 #else
-# define YYERROR_VERBOSE 0
+# define YYERROR_VERBOSE 1
 #endif
 
 /* Enabling the token table.  */
@@ -191,9 +193,17 @@ static int _asn1_yylex(void);
      UTCTime = 290,
      GeneralizedTime = 291,
      GeneralString = 292,
-     FROM = 293,
-     IMPORTS = 294,
-     ENUMERATED = 295
+     NumericString = 293,
+     IA5String = 294,
+     TeletexString = 295,
+     PrintableString = 296,
+     UniversalString = 297,
+     BMPString = 298,
+     UTF8String = 299,
+     VisibleString = 300,
+     FROM = 301,
+     IMPORTS = 302,
+     ENUMERATED = 303
    };
 #endif
 /* Tokens.  */
@@ -232,9 +242,17 @@ static int _asn1_yylex(void);
 #define UTCTime 290
 #define GeneralizedTime 291
 #define GeneralString 292
-#define FROM 293
-#define IMPORTS 294
-#define ENUMERATED 295
+#define NumericString 293
+#define IA5String 294
+#define TeletexString 295
+#define PrintableString 296
+#define UniversalString 297
+#define BMPString 298
+#define UTF8String 299
+#define VisibleString 300
+#define FROM 301
+#define IMPORTS 302
+#define ENUMERATED 303
 
 
 
@@ -244,7 +262,7 @@ typedef union YYSTYPE
 {
 
 /* Line 293 of yacc.c  */
-#line 57 "ASN1.y"
+#line 61 "ASN1.y"
 
   unsigned int constant;
   char str[ASN1_MAX_NAME_SIZE+1];
@@ -253,7 +271,7 @@ typedef union YYSTYPE
 
 
 /* Line 293 of yacc.c  */
-#line 257 "ASN1.c"
+#line 275 "ASN1.c"
 } YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -265,7 +283,7 @@ typedef union YYSTYPE
 
 
 /* Line 343 of yacc.c  */
-#line 269 "ASN1.c"
+#line 287 "ASN1.c"
 
 #ifdef short
 # undef short
@@ -484,20 +502,20 @@ union yyalloc
 /* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  5
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   192
+#define YYLAST   217
 
 /* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS  52
+#define YYNTOKENS  60
 /* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS  43
+#define YYNNTS  51
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  100
+#define YYNRULES  125
 /* YYNRULES -- Number of states.  */
-#define YYNSTATES  190
+#define YYNSTATES  216
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 #define YYUNDEFTOK  2
-#define YYMAXUTOK   295
+#define YYMAXUTOK   303
 
 #define YYTRANSLATE(YYX)						\
   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -509,15 +527,15 @@ static const yytype_uint8 yytranslate[] =
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-      43,    44,     2,    41,    45,    42,    51,     2,     2,     2,
+      51,    52,     2,    49,    53,    50,    59,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,    46,     2,    47,     2,     2,     2,     2,     2,     2,
+       2,    54,     2,    55,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-       2,     2,     2,    49,    48,    50,     2,     2,     2,     2,
+       2,     2,     2,    57,    56,    58,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
@@ -534,7 +552,8 @@ static const yytype_uint8 yytranslate[] =
        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
-      35,    36,    37,    38,    39,    40
+      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
+      45,    46,    47,    48
 };
 
 #if YYDEBUG
@@ -546,67 +565,77 @@ static const yytype_uint16 yyprhs[] =
       28,    30,    32,    36,    41,    43,    47,    49,    54,    56,
       59,    61,    63,    65,    69,    74,    76,    79,    82,    85,
       88,    91,    93,    97,    99,   104,   109,   117,   119,   121,
-     123,   128,   136,   138,   142,   144,   147,   150,   154,   159,
-     161,   165,   168,   172,   178,   183,   186,   188,   191,   193,
-     195,   197,   199,   201,   203,   205,   207,   209,   211,   213,
-     215,   217,   219,   222,   224,   227,   230,   233,   235,   239,
-     244,   248,   253,   258,   262,   267,   272,   274,   279,   283,
-     291,   298,   303,   305,   307,   309,   312,   317,   321,   323,
-     325
+     123,   128,   136,   138,   142,   144,   147,   149,   152,   154,
+     157,   159,   162,   164,   167,   169,   172,   174,   177,   179,
+     182,   184,   187,   190,   194,   199,   201,   205,   208,   212,
+     218,   223,   226,   228,   231,   233,   235,   237,   239,   241,
+     243,   245,   247,   249,   251,   253,   255,   257,   259,   261,
+     263,   265,   267,   269,   271,   273,   275,   278,   280,   283,
+     286,   289,   291,   295,   300,   304,   309,   314,   318,   323,
+     328,   330,   335,   339,   342,   350,   357,   362,   364,   366,
+     368,   371,   376,   380,   382,   384
 };
 
 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
 static const yytype_int8 yyrhs[] =
 {
-      53,     0,    -1,    93,    31,    94,    32,     3,    33,    92,
-      34,    -1,     4,    -1,    41,     4,    -1,    42,     4,    -1,
-      54,    -1,    55,    -1,     4,    -1,     5,    -1,    56,    -1,
-       5,    -1,    43,    56,    44,    -1,     5,    43,    56,    44,
-      -1,    59,    -1,    60,    45,    59,    -1,    57,    -1,     5,
-      43,     4,    44,    -1,    61,    -1,    62,    61,    -1,    13,
-      -1,    14,    -1,    15,    -1,    46,     4,    47,    -1,    46,
-      63,     4,    47,    -1,    64,    -1,    64,    29,    -1,    64,
-      30,    -1,    16,    58,    -1,    16,    22,    -1,    16,    23,
-      -1,    56,    -1,    67,    48,    56,    -1,     7,    -1,     7,
-      49,    60,    50,    -1,    68,    43,    67,    44,    -1,    68,
-      43,    57,    51,    51,    57,    44,    -1,    21,    -1,    35,
-      -1,    36,    -1,     8,    43,    57,    44,    -1,     8,    43,
-      57,    51,    51,    57,    44,    -1,    71,    -1,    43,    71,
-      44,    -1,    37,    -1,    37,    72,    -1,     9,    10,    -1,
-       9,    10,    72,    -1,     5,    43,     4,    44,    -1,    75,
-      -1,    76,    45,    75,    -1,    12,    10,    -1,    12,    10,
-      72,    -1,    12,    10,    49,    76,    50,    -1,    40,    49,
-      76,    50,    -1,    19,    20,    -1,     5,    -1,     5,    72,
-      -1,    68,    -1,    78,    -1,    69,    -1,    70,    -1,    74,
-      -1,    77,    -1,    73,    -1,    85,    -1,    79,    -1,    87,
-      -1,    88,    -1,    86,    -1,    24,    -1,    80,    -1,    65,
-      80,    -1,    81,    -1,    81,    66,    -1,    81,     6,    -1,
-       5,    82,    -1,    83,    -1,    84,    45,    83,    -1,    11,
-      49,    84,    50,    -1,    11,    18,    80,    -1,    11,    72,
-      18,    80,    -1,    28,    49,    84,    50,    -1,    28,    18,
-      80,    -1,    28,    72,    18,    80,    -1,    17,    49,    84,
-      50,    -1,    25,    -1,    25,    26,    27,     5,    -1,     5,
-       3,    81,    -1,     5,    19,    20,     3,    49,    62,    50,
-      -1,     5,     5,     3,    49,    62,    50,    -1,     5,     7,
-       3,    56,    -1,    89,    -1,    90,    -1,    91,    -1,    92,
-      91,    -1,     5,    49,    62,    50,    -1,     5,    49,    50,
-      -1,     5,    -1,    29,    -1,    30,    -1
+      61,     0,    -1,   109,    31,   110,    32,     3,    33,   108,
+      34,    -1,     4,    -1,    49,     4,    -1,    50,     4,    -1,
+      62,    -1,    63,    -1,     4,    -1,     5,    -1,    64,    -1,
+       5,    -1,    51,    64,    52,    -1,     5,    51,    64,    52,
+      -1,    67,    -1,    68,    53,    67,    -1,    65,    -1,     5,
+      51,     4,    52,    -1,    69,    -1,    70,    69,    -1,    13,
+      -1,    14,    -1,    15,    -1,    54,     4,    55,    -1,    54,
+      71,     4,    55,    -1,    72,    -1,    72,    29,    -1,    72,
+      30,    -1,    16,    66,    -1,    16,    22,    -1,    16,    23,
+      -1,    64,    -1,    75,    56,    64,    -1,     7,    -1,     7,
+      57,    68,    58,    -1,    76,    51,    75,    52,    -1,    76,
+      51,    65,    59,    59,    65,    52,    -1,    21,    -1,    35,
+      -1,    36,    -1,     8,    51,    65,    52,    -1,     8,    51,
+      65,    59,    59,    65,    52,    -1,    79,    -1,    51,    79,
+      52,    -1,    37,    -1,    37,    80,    -1,    38,    -1,    38,
+      80,    -1,    39,    -1,    39,    80,    -1,    40,    -1,    40,
+      80,    -1,    41,    -1,    41,    80,    -1,    42,    -1,    42,
+      80,    -1,    43,    -1,    43,    80,    -1,    44,    -1,    44,
+      80,    -1,    45,    -1,    45,    80,    -1,     9,    10,    -1,
+       9,    10,    80,    -1,     5,    51,     4,    52,    -1,    91,
+      -1,    92,    53,    91,    -1,    12,    10,    -1,    12,    10,
+      80,    -1,    12,    10,    57,    92,    58,    -1,    48,    57,
+      92,    58,    -1,    19,    20,    -1,     5,    -1,     5,    80,
+      -1,    76,    -1,    94,    -1,    77,    -1,    78,    -1,    90,
+      -1,    93,    -1,    81,    -1,    82,    -1,    83,    -1,    84,
+      -1,    85,    -1,    86,    -1,    87,    -1,    88,    -1,    89,
+      -1,   101,    -1,    95,    -1,   103,    -1,   104,    -1,   102,
+      -1,    24,    -1,    96,    -1,    73,    96,    -1,    97,    -1,
+      97,    74,    -1,    97,     6,    -1,     5,    98,    -1,    99,
+      -1,   100,    53,    99,    -1,    11,    57,   100,    58,    -1,
+      11,    18,    96,    -1,    11,    80,    18,    96,    -1,    28,
+      57,   100,    58,    -1,    28,    18,    96,    -1,    28,    80,
+      18,    96,    -1,    17,    57,   100,    58,    -1,    25,    -1,
+      25,    26,    27,     5,    -1,     5,     3,    97,    -1,     1,
+      97,    -1,     5,    19,    20,     3,    57,    70,    58,    -1,
+       5,     5,     3,    57,    70,    58,    -1,     5,     7,     3,
+      64,    -1,   105,    -1,   106,    -1,   107,    -1,   108,   107,
+      -1,     5,    57,    70,    58,    -1,     5,    57,    58,    -1,
+       5,    -1,    29,    -1,    30,    -1
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const yytype_uint16 yyrline[] =
 {
-       0,   118,   118,   131,   132,   135,   139,   140,   143,   144,
-     147,   148,   151,   153,   158,   159,   163,   165,   170,   171,
-     175,   176,   177,   180,   182,   186,   187,   188,   191,   193,
-     194,   198,   199,   203,   204,   206,   207,   214,   217,   218,
-     221,   223,   229,   230,   233,   234,   238,   239,   243,   248,
-     249,   253,   254,   255,   260,   266,   269,   271,   274,   275,
-     276,   277,   278,   279,   280,   281,   282,   283,   284,   285,
-     286,   289,   290,   295,   296,   299,   302,   305,   306,   310,
-     312,   314,   319,   321,   323,   328,   332,   333,   338,   341,
-     345,   350,   356,   357,   360,   361,   365,   368,   370,   394,
-     395
+       0,   133,   133,   146,   147,   150,   154,   155,   158,   159,
+     162,   163,   166,   168,   173,   174,   178,   180,   185,   186,
+     190,   191,   192,   195,   197,   201,   202,   203,   206,   208,
+     209,   213,   214,   218,   219,   221,   222,   229,   232,   233,
+     236,   238,   244,   245,   248,   249,   253,   254,   258,   259,
+     263,   264,   268,   269,   273,   274,   278,   279,   283,   284,
+     288,   289,   293,   294,   298,   303,   304,   308,   309,   310,
+     315,   321,   324,   326,   329,   330,   331,   332,   333,   334,
+     335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
+     345,   346,   347,   348,   349,   352,   353,   358,   359,   362,
+     365,   368,   369,   373,   375,   377,   382,   384,   386,   391,
+     395,   396,   401,   403,   406,   410,   415,   421,   422,   425,
+     426,   430,   433,   435,   459,   460
 };
 #endif
 
@@ -621,19 +650,23 @@ static const char *const yytname[] =
   "OBJECT", "STR_IDENTIFIER", "BOOLEAN", "ASN1_TRUE", "ASN1_FALSE",
   "TOKEN_NULL", "ANY", "DEFINED", "BY", "SET", "EXPLICIT", "IMPLICIT",
   "DEFINITIONS", "TAGS", "BEGIN", "END", "UTCTime", "GeneralizedTime",
-  "GeneralString", "FROM", "IMPORTS", "ENUMERATED", "'+'", "'-'", "'('",
+  "GeneralString", "NumericString", "IA5String", "TeletexString",
+  "PrintableString", "UniversalString", "BMPString", "UTF8String",
+  "VisibleString", "FROM", "IMPORTS", "ENUMERATED", "'+'", "'-'", "'('",
   "')'", "','", "'['", "']'", "'|'", "'{'", "'}'", "'.'", "$accept",
   "definitions", "pos_num", "neg_num", "pos_neg_num", "num_identifier",
   "pos_neg_identifier", "constant", "constant_list", "obj_constant",
   "obj_constant_list", "class", "tag_type", "tag", "default",
   "pos_neg_list", "integer_def", "boolean_def", "Time", "size_def2",
-  "size_def", "generalstring_def", "octet_string_def", "bit_element",
-  "bit_element_list", "bit_string_def", "enumerated_def", "object_def",
-  "type_assig_right", "type_assig_right_tag",
-  "type_assig_right_tag_default", "type_assig", "type_assig_list",
-  "sequence_def", "set_def", "choise_def", "any_def", "type_def",
-  "constant_def", "type_constant", "type_constant_list", "definitions_id",
-  "explicit_implicit", 0
+  "size_def", "generalstring_def", "numericstring_def", "ia5string_def",
+  "teletexstring_def", "printablestring_def", "universalstring_def",
+  "bmpstring_def", "utf8string_def", "visiblestring_def",
+  "octet_string_def", "bit_element", "bit_element_list", "bit_string_def",
+  "enumerated_def", "object_def", "type_assig_right",
+  "type_assig_right_tag", "type_assig_right_tag_default", "type_assig",
+  "type_assig_list", "sequence_def", "set_def", "choise_def", "any_def",
+  "type_def", "constant_def", "type_constant", "type_constant_list",
+  "definitions_id", "explicit_implicit", 0
 };
 #endif
 
@@ -646,25 +679,27 @@ static const yytype_uint16 yytoknum[] =
      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,    43,    45,    40,    41,    44,    91,    93,   124,   123,
-     125,    46
+     295,   296,   297,   298,   299,   300,   301,   302,   303,    43,
+      45,    40,    41,    44,    91,    93,   124,   123,   125,    46
 };
 # endif
 
 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
 static const yytype_uint8 yyr1[] =
 {
-       0,    52,    53,    54,    54,    55,    56,    56,    57,    57,
-      58,    58,    59,    59,    60,    60,    61,    61,    62,    62,
-      63,    63,    63,    64,    64,    65,    65,    65,    66,    66,
-      66,    67,    67,    68,    68,    68,    68,    69,    70,    70,
-      71,    71,    72,    72,    73,    73,    74,    74,    75,    76,
-      76,    77,    77,    77,    78,    79,    80,    80,    80,    80,
-      80,    80,    80,    80,    80,    80,    80,    80,    80,    80,
-      80,    81,    81,    82,    82,    82,    83,    84,    84,    85,
-      85,    85,    86,    86,    86,    87,    88,    88,    89,    90,
-      90,    90,    91,    91,    92,    92,    93,    93,    93,    94,
-      94
+       0,    60,    61,    62,    62,    63,    64,    64,    65,    65,
+      66,    66,    67,    67,    68,    68,    69,    69,    70,    70,
+      71,    71,    71,    72,    72,    73,    73,    73,    74,    74,
+      74,    75,    75,    76,    76,    76,    76,    77,    78,    78,
+      79,    79,    80,    80,    81,    81,    82,    82,    83,    83,
+      84,    84,    85,    85,    86,    86,    87,    87,    88,    88,
+      89,    89,    90,    90,    91,    92,    92,    93,    93,    93,
+      94,    95,    96,    96,    96,    96,    96,    96,    96,    96,
+      96,    96,    96,    96,    96,    96,    96,    96,    96,    96,
+      96,    96,    96,    96,    96,    97,    97,    98,    98,    98,
+      99,   100,   100,   101,   101,   101,   102,   102,   102,   103,
+     104,   104,   105,   105,   106,   106,   106,   107,   107,   108,
+     108,   109,   109,   109,   110,   110
 };
 
 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
@@ -674,13 +709,15 @@ static const yytype_uint8 yyr2[] =
        1,     1,     3,     4,     1,     3,     1,     4,     1,     2,
        1,     1,     1,     3,     4,     1,     2,     2,     2,     2,
        2,     1,     3,     1,     4,     4,     7,     1,     1,     1,
-       4,     7,     1,     3,     1,     2,     2,     3,     4,     1,
-       3,     2,     3,     5,     4,     2,     1,     2,     1,     1,
+       4,     7,     1,     3,     1,     2,     1,     2,     1,     2,
+       1,     2,     1,     2,     1,     2,     1,     2,     1,     2,
+       1,     2,     2,     3,     4,     1,     3,     2,     3,     5,
+       4,     2,     1,     2,     1,     1,     1,     1,     1,     1,
        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-       1,     1,     2,     1,     2,     2,     2,     1,     3,     4,
-       3,     4,     4,     3,     4,     4,     1,     4,     3,     7,
-       6,     4,     1,     1,     1,     2,     4,     3,     1,     1,
-       1
+       1,     1,     1,     1,     1,     1,     2,     1,     2,     2,
+       2,     1,     3,     4,     3,     4,     4,     3,     4,     4,
+       1,     4,     3,     2,     7,     6,     4,     1,     1,     1,
+       2,     4,     3,     1,     1,     1
 };
 
 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
@@ -688,71 +725,79 @@ static const yytype_uint8 yyr2[] =
    means the default is an error.  */
 static const yytype_uint8 yydefact[] =
 {
-       0,    98,     0,     0,     0,     1,     0,     8,     9,    97,
-      16,    18,     0,    99,   100,     0,     0,    96,    19,     0,
-       0,     0,    17,     0,     0,    92,    93,    94,     0,     0,
-       0,     0,     0,     2,    95,    56,    33,     0,     0,     0,
-       0,     0,    37,    70,    86,     0,    38,    39,    44,     0,
-       0,    25,     0,    58,    60,    61,    64,    62,    63,    59,
-      66,    71,    88,    65,    69,    67,    68,     0,     0,     0,
-       0,     0,    42,    57,     0,    46,     0,     0,     0,    51,
-       0,    55,     0,     0,     0,     0,    45,     0,     0,    20,
-      21,    22,     0,    26,    27,    72,     0,     0,     3,     0,
-       0,     6,     7,    91,     0,     0,     0,     0,     0,    14,
-       0,    47,    80,     0,    77,     0,     0,     0,    52,     0,
-       0,    83,     0,     0,     0,    49,     0,    23,     0,     3,
-       9,    31,     0,     0,     0,     4,     5,     0,     0,    43,
-       0,     0,     0,    34,    73,    76,     0,    79,    81,     0,
-      85,    87,    82,    84,     0,     0,    54,    24,     0,    35,
-       0,    90,     0,    40,     0,     0,    12,    15,    75,     0,
-      74,    78,    53,     0,    50,     0,    32,    89,     0,    13,
-      11,    29,    30,    10,    28,    48,     0,     0,    36,    41
+       0,   123,     0,     0,     0,     1,     0,     8,     9,   122,
+      16,    18,     0,   124,   125,     0,     0,   121,    19,     0,
+       0,     0,    17,     0,     0,     0,   117,   118,   119,     0,
+      72,    33,     0,     0,     0,     0,     0,    37,    94,   110,
+       0,    38,    39,    44,    46,    48,    50,    52,    54,    56,
+      58,    60,     0,     0,    25,     0,    74,    76,    77,    80,
+      81,    82,    83,    84,    85,    86,    87,    88,    78,    79,
+      75,    90,    95,   113,    89,    93,    91,    92,     0,     0,
+       0,     0,     2,   120,     0,     0,    42,    73,     0,    62,
+       0,     0,     0,    67,     0,    71,     0,     0,     0,     0,
+      45,    47,    49,    51,    53,    55,    57,    59,    61,     0,
+       0,    20,    21,    22,     0,    26,    27,    96,     0,   112,
+       0,     0,     0,     0,     0,     0,     0,    14,     0,    63,
+     104,     0,   101,     0,     0,     0,    68,     0,     0,   107,
+       0,     0,     0,    65,     0,    23,     0,     3,     9,     0,
+       0,     6,     7,    31,     0,     0,     0,     3,   116,     0,
+       0,    43,     0,     0,     0,    34,    97,   100,     0,   103,
+     105,     0,   109,   111,   106,   108,     0,     0,    70,    24,
+       4,     5,     0,    35,     0,     0,     0,    40,     0,     0,
+      12,    15,    99,     0,    98,   102,    69,     0,    66,     0,
+      32,   115,     0,     0,    13,    11,    29,    30,    10,    28,
+      64,     0,   114,     0,    36,    41
 };
 
 /* YYDEFGOTO[NTERM-NUM].  */
 static const yytype_int16 yydefgoto[] =
 {
-      -1,     2,   101,   102,   103,    10,   184,   109,   110,    11,
-      12,    92,    51,    52,   170,   133,    53,    54,    55,    72,
-      73,    56,    57,   125,   126,    58,    59,    60,    61,    62,
-     145,   114,   115,    63,    64,    65,    66,    25,    26,    27,
-      28,     3,    15
+      -1,     2,   151,   152,   153,    10,   209,   127,   128,    11,
+      12,   114,    54,    55,   194,   155,    56,    57,    58,    86,
+      87,    59,    60,    61,    62,    63,    64,    65,    66,    67,
+      68,   143,   144,    69,    70,    71,    72,    73,   167,   132,
+     133,    74,    75,    76,    77,    26,    27,    28,    29,     3,
+      15
 };
 
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    STATE-NUM.  */
-#define YYPACT_NINF -96
+#define YYPACT_NINF -118
 static const yytype_int16 yypact[] =
 {
-      24,   -14,    48,    56,     0,   -96,   -10,   -96,    -2,   -96,
-     -96,   -96,     2,   -96,   -96,    71,   111,   -96,   -96,   117,
-      83,    96,   -96,   127,    42,   -96,   -96,   -96,    10,    77,
-     130,   131,   115,   -96,   -96,     8,    90,   132,    13,   135,
-      92,   126,   -96,   -96,   122,    15,   -96,   -96,     8,   100,
-      93,    49,   119,    94,   -96,   -96,   -96,   -96,   -96,   -96,
-     -96,   -96,   -96,   -96,   -96,   -96,   -96,   102,    28,   149,
-     110,   150,   -96,   -96,    17,     8,   119,   152,   142,    22,
-     152,   -96,   134,   119,   152,   144,   -96,   158,   118,   -96,
-     -96,   -96,   160,   -96,   -96,   -96,    35,    88,   -96,   162,
-     163,   -96,   -96,   -96,   120,   114,   124,   128,    28,   -96,
-      -8,   -96,   -96,    77,   -96,    -7,   119,   158,   -96,    18,
-     165,   -96,    50,   119,   129,   -96,    54,   -96,   133,   123,
-     -96,   -96,   125,    37,     4,   -96,   -96,    88,   -27,   -96,
-      28,   137,    17,   -96,    20,   -96,   152,   -96,   -96,    66,
-     -96,   -96,   -96,   -96,   169,   158,   -96,   -96,   136,   -96,
-      28,   -96,     7,   -96,   138,   139,   -96,   -96,   -96,    68,
-     -96,   -96,   -96,   140,   -96,   114,   -96,   -96,   114,   -96,
-     -96,   -96,   -96,   -96,   -96,   -96,   141,   146,   -96,   -96
+       9,   -25,    35,    61,     2,  -118,    12,  -118,    49,  -118,
+    -118,  -118,     6,  -118,  -118,    70,   100,  -118,  -118,    54,
+      58,   112,  -118,    45,    84,    44,  -118,  -118,  -118,    32,
+      31,    90,   144,    22,   145,    92,   137,  -118,  -118,   133,
+      26,  -118,  -118,    31,    31,    31,    31,    31,    31,    31,
+      31,    31,   104,   103,   111,   139,   114,  -118,  -118,  -118,
+    -118,  -118,  -118,  -118,  -118,  -118,  -118,  -118,  -118,  -118,
+    -118,  -118,  -118,  -118,  -118,  -118,  -118,  -118,    84,   159,
+     163,   149,  -118,  -118,   117,   162,  -118,  -118,    21,    31,
+     139,   166,   154,     5,   166,  -118,   158,   139,   166,   168,
+    -118,  -118,  -118,  -118,  -118,  -118,  -118,  -118,  -118,   183,
+     134,  -118,  -118,  -118,   187,  -118,  -118,  -118,    64,  -118,
+     135,    25,   190,   138,   142,   146,    25,  -118,     1,  -118,
+    -118,    84,  -118,    41,   139,   183,  -118,    53,   191,  -118,
+      77,   139,   147,  -118,    78,  -118,   140,   141,  -118,   195,
+     197,  -118,  -118,  -118,   143,    34,   148,  -118,  -118,   150,
+     -21,  -118,    25,   151,    21,  -118,    42,  -118,   166,  -118,
+    -118,    81,  -118,  -118,  -118,  -118,   200,   183,  -118,  -118,
+    -118,  -118,   152,  -118,    25,    20,   148,  -118,   153,   156,
+    -118,  -118,  -118,    48,  -118,  -118,  -118,   157,  -118,   138,
+    -118,  -118,    23,   138,  -118,  -118,  -118,  -118,  -118,  -118,
+    -118,   161,  -118,   164,  -118,  -118
 };
 
 /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int16 yypgoto[] =
 {
-     -96,   -96,   -96,   -96,   -94,   -95,   -96,    33,   -96,   -12,
-     -84,   -96,   -96,   -96,   -96,   -96,   -96,   -96,   -96,   106,
-     -20,   -96,   -96,    23,    62,   -96,   -96,   -96,   -49,    69,
-     -96,    40,    41,   -96,   -96,   -96,   -96,   -96,   -96,   164,
-     -96,   -96,   -96
+    -118,  -118,  -118,  -118,  -117,  -115,  -118,    46,  -118,   -12,
+     -71,  -118,  -118,  -118,  -118,  -118,  -118,  -118,  -118,   120,
+     -28,  -118,  -118,  -118,  -118,  -118,  -118,  -118,  -118,  -118,
+    -118,    29,    79,  -118,  -118,  -118,   -54,   -76,  -118,    47,
+      39,  -118,  -118,  -118,  -118,  -118,  -118,   188,  -118,  -118,
+    -118
 };
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
@@ -761,81 +806,88 @@ static const yytype_int16 yypgoto[] =
 #define YYTABLE_NINF -9
 static const yytype_int16 yytable[] =
 {
-      18,   132,   131,    95,     7,     8,     7,     8,     7,     8,
-     138,     7,     8,   134,   141,    24,    70,   163,    78,    13,
-      14,    70,   107,    70,   164,    85,   168,   112,    86,     1,
-      70,    76,    98,    83,   121,     4,   169,   142,   146,   129,
-     130,    16,   143,   147,    33,    29,   165,    30,     5,    31,
-       9,    71,    17,   162,   161,   111,    71,   177,    71,   118,
-     108,    32,    77,   146,    84,    71,   176,   148,   150,    99,
-     100,   117,    98,   180,   153,   183,    99,   100,    93,    94,
-     186,   159,    35,   187,    36,   160,    37,     6,    38,    39,
-     181,   182,     7,     8,    40,   146,    41,    88,    42,   155,
-     152,    43,    44,    19,   156,    45,    89,    90,    91,    99,
-     100,   155,    46,    47,    48,    20,   172,    49,     7,   130,
-      21,   119,    18,    50,    35,   122,    36,    22,    37,    23,
-      38,    39,    24,    67,    68,    69,    40,    96,    41,    74,
-      42,    80,    75,    43,    44,    79,    81,    45,    82,    87,
-      18,    97,   104,   105,    46,    47,    48,   113,    70,    49,
-     116,   120,   123,   124,   128,   127,   135,   136,   139,   137,
-     151,   140,   154,   173,    -8,   167,   158,   106,   174,   149,
-     157,   166,   144,   179,   185,   188,   171,   175,     0,   178,
-     189,     0,    34
+      18,   117,   119,   154,   158,    92,     7,     8,   160,   163,
+       7,     8,    99,    84,     1,   100,   101,   102,   103,   104,
+     105,   106,   107,   108,     7,     8,   125,     7,     8,   157,
+      84,   187,     4,    24,    84,     5,   130,    25,   188,    84,
+      90,    13,    14,   139,    97,   189,    24,    78,   192,    79,
+      25,    80,   157,   205,   164,   166,    85,    21,   193,   165,
+       9,   129,   135,    81,    17,   136,    82,   200,   147,   148,
+     206,   207,   126,    85,   149,   150,   208,    85,   201,    91,
+     170,   212,    85,    98,   211,   185,   183,   175,   213,    30,
+     184,    31,     6,    32,   168,    33,    34,   149,   150,   169,
+      16,    35,    19,    36,    20,    37,   168,   110,    38,    39,
+      22,   172,    40,   149,   150,   202,   111,   112,   113,    41,
+      42,    43,    44,    45,    46,    47,    48,    49,    50,    51,
+     168,   177,    52,   137,   177,   174,   178,   140,    53,   196,
+     115,   116,     7,   148,    30,    23,    31,    88,    32,    94,
+      33,    34,     7,     8,    89,    93,    35,    95,    36,    96,
+      37,   109,   120,    38,    39,   118,   121,    40,   123,   122,
+      84,   131,   134,    18,    41,    42,    43,    44,    45,    46,
+      47,    48,    49,    50,    51,   138,   141,    52,   142,   145,
+      18,   146,   156,   159,   161,   179,   173,   162,   176,   180,
+      -8,   181,   182,   190,   197,   124,   198,   186,   204,   210,
+     191,   199,   203,   214,   171,   195,   215,    83
 };
 
 #define yypact_value_is_default(yystate) \
-  ((yystate) == (-96))
+  ((yystate) == (-118))
 
 #define yytable_value_is_error(yytable_value) \
   YYID (0)
 
-static const yytype_int16 yycheck[] =
+static const yytype_uint8 yycheck[] =
 {
-      12,    96,    96,    52,     4,     5,     4,     5,     4,     5,
-     105,     4,     5,    97,   108,     5,     8,    44,    38,    29,
-      30,     8,     5,     8,    51,    45,     6,    76,    48,     5,
-       8,    18,     4,    18,    83,    49,    16,    45,    45,     4,
-       5,    43,    50,    50,    34,     3,   140,     5,     0,     7,
-      50,    43,    50,   137,    50,    75,    43,    50,    43,    79,
-      43,    19,    49,    45,    49,    43,   160,   116,    50,    41,
-      42,    49,     4,     5,   123,   169,    41,    42,    29,    30,
-     175,    44,     5,   178,     7,    48,     9,    31,    11,    12,
-      22,    23,     4,     5,    17,    45,    19,     4,    21,    45,
-      50,    24,    25,    32,    50,    28,    13,    14,    15,    41,
-      42,    45,    35,    36,    37,     4,    50,    40,     4,     5,
-       3,    80,   134,    46,     5,    84,     7,    44,     9,    33,
-      11,    12,     5,     3,     3,    20,    17,    43,    19,    49,
-      21,    49,    10,    24,    25,    10,    20,    28,    26,    49,
-     162,    49,     3,    43,    35,    36,    37,     5,     8,    40,
-      18,    27,    18,     5,     4,    47,     4,     4,    44,    49,
-       5,    43,    43,     4,    51,   142,    51,    71,   155,   117,
-      47,    44,   113,    44,    44,    44,   146,    51,    -1,    51,
-      44,    -1,    28
+      12,    55,    78,   118,   121,    33,     4,     5,   123,   126,
+       4,     5,    40,     8,     5,    43,    44,    45,    46,    47,
+      48,    49,    50,    51,     4,     5,     5,     4,     5,     4,
+       8,    52,    57,     1,     8,     0,    90,     5,    59,     8,
+      18,    29,    30,    97,    18,   162,     1,     3,     6,     5,
+       5,     7,     4,     5,    53,   131,    51,     3,    16,    58,
+      58,    89,    57,    19,    58,    93,    34,   184,     4,     5,
+      22,    23,    51,    51,    49,    50,   193,    51,    58,    57,
+     134,    58,    51,    57,   199,   156,    52,   141,   203,     5,
+      56,     7,    31,     9,    53,    11,    12,    49,    50,    58,
+      51,    17,    32,    19,     4,    21,    53,     4,    24,    25,
+      52,    58,    28,    49,    50,   186,    13,    14,    15,    35,
+      36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
+      53,    53,    48,    94,    53,    58,    58,    98,    54,    58,
+      29,    30,     4,     5,     5,    33,     7,    57,     9,    57,
+      11,    12,     4,     5,    10,    10,    17,    20,    19,    26,
+      21,    57,     3,    24,    25,    51,     3,    28,    51,    20,
+       8,     5,    18,   185,    35,    36,    37,    38,    39,    40,
+      41,    42,    43,    44,    45,    27,    18,    48,     5,    55,
+     202,     4,    57,     3,    52,    55,     5,    51,    51,     4,
+      59,     4,    59,    52,     4,    85,   177,    57,    52,    52,
+     164,    59,    59,    52,   135,   168,    52,    29
 };
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
    symbol of state STATE-NUM.  */
 static const yytype_uint8 yystos[] =
 {
-       0,     5,    53,    93,    49,     0,    31,     4,     5,    50,
-      57,    61,    62,    29,    30,    94,    43,    50,    61,    32,
-       4,     3,    44,    33,     5,    89,    90,    91,    92,     3,
-       5,     7,    19,    34,    91,     5,     7,     9,    11,    12,
-      17,    19,    21,    24,    25,    28,    35,    36,    37,    40,
-      46,    64,    65,    68,    69,    70,    73,    74,    77,    78,
-      79,    80,    81,    85,    86,    87,    88,     3,     3,    20,
-       8,    43,    71,    72,    49,    10,    18,    49,    72,    10,
-      49,    20,    26,    18,    49,    72,    72,    49,     4,    13,
-      14,    15,    63,    29,    30,    80,    43,    49,     4,    41,
-      42,    54,    55,    56,     3,    43,    71,     5,    43,    59,
-      60,    72,    80,     5,    83,    84,    18,    49,    72,    84,
-      27,    80,    84,    18,     5,    75,    76,    47,     4,     4,
-       5,    56,    57,    67,    62,     4,     4,    49,    57,    44,
-      43,    56,    45,    50,    81,    82,    45,    50,    80,    76,
-      50,     5,    50,    80,    43,    45,    50,    47,    51,    44,
-      48,    50,    62,    44,    51,    56,    44,    59,     6,    16,
-      66,    83,    50,     4,    75,    51,    56,    50,    51,    44,
-       5,    22,    23,    56,    58,    44,    57,    57,    44,    44
+       0,     5,    61,   109,    57,     0,    31,     4,     5,    58,
+      65,    69,    70,    29,    30,   110,    51,    58,    69,    32,
+       4,     3,    52,    33,     1,     5,   105,   106,   107,   108,
+       5,     7,     9,    11,    12,    17,    19,    21,    24,    25,
+      28,    35,    36,    37,    38,    39,    40,    41,    42,    43,
+      44,    45,    48,    54,    72,    73,    76,    77,    78,    81,
+      82,    83,    84,    85,    86,    87,    88,    89,    90,    93,
+      94,    95,    96,    97,   101,   102,   103,   104,     3,     5,
+       7,    19,    34,   107,     8,    51,    79,    80,    57,    10,
+      18,    57,    80,    10,    57,    20,    26,    18,    57,    80,
+      80,    80,    80,    80,    80,    80,    80,    80,    80,    57,
+       4,    13,    14,    15,    71,    29,    30,    96,    51,    97,
+       3,     3,    20,    51,    79,     5,    51,    67,    68,    80,
+      96,     5,    99,   100,    18,    57,    80,   100,    27,    96,
+     100,    18,     5,    91,    92,    55,     4,     4,     5,    49,
+      50,    62,    63,    64,    65,    75,    57,     4,    64,     3,
+      65,    52,    51,    64,    53,    58,    97,    98,    53,    58,
+      96,    92,    58,     5,    58,    96,    51,    53,    58,    55,
+       4,     4,    59,    52,    56,    70,    57,    52,    59,    64,
+      52,    67,     6,    16,    74,    99,    58,     4,    91,    59,
+      64,    58,    70,    59,    52,     5,    22,    23,    64,    66,
+      52,    65,    58,    65,    52,    52
 };
 
 #define yyerrok		(yyerrstatus = 0)
@@ -1672,8 +1724,8 @@ yyreduce:
         case 2:
 
 /* Line 1806 of yacc.c  */
-#line 121 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_DEFINITIONS|(yyvsp[(3) - (8)].constant));
+#line 136 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_DEFINITIONS|(yyvsp[(3) - (8)].constant));
                     _asn1_set_name((yyval.node),_asn1_get_name((yyvsp[(1) - (8)].node)));
                     _asn1_set_name((yyvsp[(1) - (8)].node),"");
                     _asn1_set_right((yyvsp[(1) - (8)].node),(yyvsp[(7) - (8)].node));
@@ -1686,21 +1738,21 @@ yyreduce:
   case 3:
 
 /* Line 1806 of yacc.c  */
-#line 131 "ASN1.y"
+#line 146 "ASN1.y"
     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
     break;
 
   case 4:
 
 /* Line 1806 of yacc.c  */
-#line 132 "ASN1.y"
+#line 147 "ASN1.y"
     {strcpy((yyval.str),(yyvsp[(2) - (2)].str));}
     break;
 
   case 5:
 
 /* Line 1806 of yacc.c  */
-#line 135 "ASN1.y"
+#line 150 "ASN1.y"
     {strcpy((yyval.str),"-");
                        strcat((yyval.str),(yyvsp[(2) - (2)].str));}
     break;
@@ -1708,58 +1760,58 @@ yyreduce:
   case 6:
 
 /* Line 1806 of yacc.c  */
-#line 139 "ASN1.y"
+#line 154 "ASN1.y"
     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
     break;
 
   case 7:
 
 /* Line 1806 of yacc.c  */
-#line 140 "ASN1.y"
+#line 155 "ASN1.y"
     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
     break;
 
   case 8:
 
 /* Line 1806 of yacc.c  */
-#line 143 "ASN1.y"
+#line 158 "ASN1.y"
     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
     break;
 
   case 9:
 
 /* Line 1806 of yacc.c  */
-#line 144 "ASN1.y"
+#line 159 "ASN1.y"
     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
     break;
 
   case 10:
 
 /* Line 1806 of yacc.c  */
-#line 147 "ASN1.y"
+#line 162 "ASN1.y"
     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
     break;
 
   case 11:
 
 /* Line 1806 of yacc.c  */
-#line 148 "ASN1.y"
+#line 163 "ASN1.y"
     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
     break;
 
   case 12:
 
 /* Line 1806 of yacc.c  */
-#line 151 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_CONSTANT);
+#line 166 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT);
                                        _asn1_set_value((yyval.node),(yyvsp[(2) - (3)].str),strlen((yyvsp[(2) - (3)].str))+1);}
     break;
 
   case 13:
 
 /* Line 1806 of yacc.c  */
-#line 153 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_CONSTANT);
+#line 168 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT);
 	                               _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str));
                                        _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);}
     break;
@@ -1767,14 +1819,14 @@ yyreduce:
   case 14:
 
 /* Line 1806 of yacc.c  */
-#line 158 "ASN1.y"
+#line 173 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 15:
 
 /* Line 1806 of yacc.c  */
-#line 159 "ASN1.y"
+#line 174 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (3)].node);
                                             _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (3)].node)),(yyvsp[(3) - (3)].node));}
     break;
@@ -1782,16 +1834,16 @@ yyreduce:
   case 16:
 
 /* Line 1806 of yacc.c  */
-#line 163 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_CONSTANT);
+#line 178 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT);
                                    _asn1_set_value((yyval.node),(yyvsp[(1) - (1)].str),strlen((yyvsp[(1) - (1)].str))+1);}
     break;
 
   case 17:
 
 /* Line 1806 of yacc.c  */
-#line 165 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_CONSTANT);
+#line 180 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT);
 	                            _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str));
                                     _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);}
     break;
@@ -1799,14 +1851,14 @@ yyreduce:
   case 18:
 
 /* Line 1806 of yacc.c  */
-#line 170 "ASN1.y"
+#line 185 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 19:
 
 /* Line 1806 of yacc.c  */
-#line 171 "ASN1.y"
+#line 186 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (2)].node);
                                                     _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (2)].node)),(yyvsp[(2) - (2)].node));}
     break;
@@ -1814,111 +1866,111 @@ yyreduce:
   case 20:
 
 /* Line 1806 of yacc.c  */
-#line 175 "ASN1.y"
+#line 190 "ASN1.y"
     {(yyval.constant)=CONST_UNIVERSAL;}
     break;
 
   case 21:
 
 /* Line 1806 of yacc.c  */
-#line 176 "ASN1.y"
+#line 191 "ASN1.y"
     {(yyval.constant)=CONST_PRIVATE;}
     break;
 
   case 22:
 
 /* Line 1806 of yacc.c  */
-#line 177 "ASN1.y"
+#line 192 "ASN1.y"
     {(yyval.constant)=CONST_APPLICATION;}
     break;
 
   case 23:
 
 /* Line 1806 of yacc.c  */
-#line 180 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_TAG);
+#line 195 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TAG);
                             _asn1_set_value((yyval.node),(yyvsp[(2) - (3)].str),strlen((yyvsp[(2) - (3)].str))+1);}
     break;
 
   case 24:
 
 /* Line 1806 of yacc.c  */
-#line 182 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_TAG | (yyvsp[(2) - (4)].constant));
+#line 197 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TAG | (yyvsp[(2) - (4)].constant));
                                 _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);}
     break;
 
   case 25:
 
 /* Line 1806 of yacc.c  */
-#line 186 "ASN1.y"
+#line 201 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 26:
 
 /* Line 1806 of yacc.c  */
-#line 187 "ASN1.y"
+#line 202 "ASN1.y"
     {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_EXPLICIT);}
     break;
 
   case 27:
 
 /* Line 1806 of yacc.c  */
-#line 188 "ASN1.y"
+#line 203 "ASN1.y"
     {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_IMPLICIT);}
     break;
 
   case 28:
 
 /* Line 1806 of yacc.c  */
-#line 191 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_DEFAULT);
+#line 206 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_DEFAULT);
                                        _asn1_set_value((yyval.node),(yyvsp[(2) - (2)].str),strlen((yyvsp[(2) - (2)].str))+1);}
     break;
 
   case 29:
 
 /* Line 1806 of yacc.c  */
-#line 193 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_DEFAULT|CONST_TRUE);}
+#line 208 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_DEFAULT|CONST_TRUE);}
     break;
 
   case 30:
 
 /* Line 1806 of yacc.c  */
-#line 194 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_DEFAULT|CONST_FALSE);}
+#line 209 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_DEFAULT|CONST_FALSE);}
     break;
 
   case 33:
 
 /* Line 1806 of yacc.c  */
-#line 203 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_INTEGER);}
+#line 218 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER);}
     break;
 
   case 34:
 
 /* Line 1806 of yacc.c  */
-#line 204 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_INTEGER|CONST_LIST);
+#line 219 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER|CONST_LIST);
 	                                 _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
     break;
 
   case 35:
 
 /* Line 1806 of yacc.c  */
-#line 206 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_INTEGER);}
+#line 221 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER);}
     break;
 
   case 36:
 
 /* Line 1806 of yacc.c  */
-#line 208 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_INTEGER|CONST_MIN_MAX);
-                                         _asn1_set_down((yyval.node),_asn1_add_static_node(TYPE_SIZE));
+#line 223 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER|CONST_MIN_MAX);
+                                         _asn1_set_down((yyval.node),_asn1_add_static_node(ASN1_ETYPE_SIZE));
                                          _asn1_set_value(_asn1_get_down((yyval.node)),(yyvsp[(6) - (7)].str),strlen((yyvsp[(6) - (7)].str))+1);
                                          _asn1_set_name(_asn1_get_down((yyval.node)),(yyvsp[(3) - (7)].str));}
     break;
@@ -1926,37 +1978,37 @@ yyreduce:
   case 37:
 
 /* Line 1806 of yacc.c  */
-#line 214 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_BOOLEAN);}
+#line 229 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BOOLEAN);}
     break;
 
   case 38:
 
 /* Line 1806 of yacc.c  */
-#line 217 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_TIME|CONST_UTC);}
+#line 232 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TIME|CONST_UTC);}
     break;
 
   case 39:
 
 /* Line 1806 of yacc.c  */
-#line 218 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_TIME|CONST_GENERALIZED);}
+#line 233 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TIME|CONST_GENERALIZED);}
     break;
 
   case 40:
 
 /* Line 1806 of yacc.c  */
-#line 221 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_SIZE|CONST_1_PARAM);
+#line 236 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SIZE|CONST_1_PARAM);
 	                              _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);}
     break;
 
   case 41:
 
 /* Line 1806 of yacc.c  */
-#line 224 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_SIZE|CONST_MIN_MAX);
+#line 239 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SIZE|CONST_MIN_MAX);
 	                              _asn1_set_value((yyval.node),(yyvsp[(3) - (7)].str),strlen((yyvsp[(3) - (7)].str))+1);
                                       _asn1_set_name((yyval.node),(yyvsp[(6) - (7)].str));}
     break;
@@ -1964,451 +2016,634 @@ yyreduce:
   case 42:
 
 /* Line 1806 of yacc.c  */
-#line 229 "ASN1.y"
+#line 244 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 43:
 
 /* Line 1806 of yacc.c  */
-#line 230 "ASN1.y"
+#line 245 "ASN1.y"
     {(yyval.node)=(yyvsp[(2) - (3)].node);}
     break;
 
   case 44:
 
 /* Line 1806 of yacc.c  */
-#line 233 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_GENERALSTRING);}
+#line 248 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_GENERALSTRING);}
     break;
 
   case 45:
 
 /* Line 1806 of yacc.c  */
-#line 234 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_GENERALSTRING|CONST_SIZE);
+#line 249 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_GENERALSTRING|CONST_SIZE);
 					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
   case 46:
 
 /* Line 1806 of yacc.c  */
-#line 238 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_OCTET_STRING);}
+#line 253 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_NUMERICSTRING|CONST_UNIVERSAL);}
     break;
 
   case 47:
 
 /* Line 1806 of yacc.c  */
-#line 239 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_OCTET_STRING|CONST_SIZE);
-                                           _asn1_set_down((yyval.node),(yyvsp[(3) - (3)].node));}
+#line 254 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_NUMERICSTRING|CONST_SIZE);
+					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
   case 48:
 
 /* Line 1806 of yacc.c  */
-#line 243 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_CONSTANT);
-	                           _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str));
-                                    _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);}
+#line 258 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IA5STRING);}
     break;
 
   case 49:
 
 /* Line 1806 of yacc.c  */
-#line 248 "ASN1.y"
-    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+#line 259 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IA5STRING|CONST_SIZE);
+					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
   case 50:
 
 /* Line 1806 of yacc.c  */
-#line 249 "ASN1.y"
-    {(yyval.node)=(yyvsp[(1) - (3)].node);
-                                                       _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (3)].node)),(yyvsp[(3) - (3)].node));}
+#line 263 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TELETEXSTRING);}
     break;
 
   case 51:
 
 /* Line 1806 of yacc.c  */
-#line 253 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_BIT_STRING);}
+#line 264 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TELETEXSTRING|CONST_SIZE);
+					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
   case 52:
 
 /* Line 1806 of yacc.c  */
-#line 254 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_BIT_STRING|CONST_SIZE);}
+#line 268 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_PRINTABLESTRING);}
     break;
 
   case 53:
 
 /* Line 1806 of yacc.c  */
-#line 256 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_BIT_STRING|CONST_LIST);
-                                _asn1_set_down((yyval.node),(yyvsp[(4) - (5)].node));}
+#line 269 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_PRINTABLESTRING|CONST_SIZE);
+					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
   case 54:
 
 /* Line 1806 of yacc.c  */
-#line 261 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_ENUMERATED|CONST_LIST);
-                                _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
+#line 273 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UNIVERSALSTRING);}
     break;
 
   case 55:
 
 /* Line 1806 of yacc.c  */
-#line 266 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_OBJECT_ID);}
+#line 274 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UNIVERSALSTRING|CONST_SIZE);
+					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
   case 56:
 
 /* Line 1806 of yacc.c  */
-#line 269 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_IDENTIFIER);
-                                       _asn1_set_value((yyval.node),(yyvsp[(1) - (1)].str),strlen((yyvsp[(1) - (1)].str))+1);}
+#line 278 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BMPSTRING);}
     break;
 
   case 57:
 
 /* Line 1806 of yacc.c  */
-#line 271 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_IDENTIFIER|CONST_SIZE);
-                                       _asn1_set_value((yyval.node),(yyvsp[(1) - (2)].str),strlen((yyvsp[(1) - (2)].str))+1);
-                                       _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
+#line 279 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BMPSTRING|CONST_SIZE);
+					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
   case 58:
 
 /* Line 1806 of yacc.c  */
-#line 274 "ASN1.y"
-    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+#line 283 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UTF8STRING);}
     break;
 
   case 59:
 
 /* Line 1806 of yacc.c  */
-#line 275 "ASN1.y"
-    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+#line 284 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UTF8STRING|CONST_SIZE);
+					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
   case 60:
 
 /* Line 1806 of yacc.c  */
-#line 276 "ASN1.y"
-    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+#line 288 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_VISIBLESTRING);}
+    break;
+
+  case 61:
+
+/* Line 1806 of yacc.c  */
+#line 289 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_VISIBLESTRING|CONST_SIZE);
+					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
   case 62:
 
 /* Line 1806 of yacc.c  */
-#line 278 "ASN1.y"
-    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+#line 293 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OCTET_STRING);}
     break;
 
   case 63:
 
 /* Line 1806 of yacc.c  */
-#line 279 "ASN1.y"
-    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+#line 294 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OCTET_STRING|CONST_SIZE);
+                                           _asn1_set_down((yyval.node),(yyvsp[(3) - (3)].node));}
     break;
 
   case 64:
 
 /* Line 1806 of yacc.c  */
-#line 280 "ASN1.y"
-    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+#line 298 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT);
+	                           _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str));
+                                    _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);}
     break;
 
   case 65:
 
 /* Line 1806 of yacc.c  */
-#line 281 "ASN1.y"
+#line 303 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 66:
 
 /* Line 1806 of yacc.c  */
-#line 282 "ASN1.y"
-    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+#line 304 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (3)].node);
+                                                       _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (3)].node)),(yyvsp[(3) - (3)].node));}
     break;
 
   case 67:
 
 /* Line 1806 of yacc.c  */
-#line 283 "ASN1.y"
-    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+#line 308 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BIT_STRING);}
     break;
 
   case 68:
 
 /* Line 1806 of yacc.c  */
-#line 284 "ASN1.y"
-    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+#line 309 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BIT_STRING|CONST_SIZE);}
     break;
 
   case 69:
 
 /* Line 1806 of yacc.c  */
-#line 285 "ASN1.y"
-    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+#line 311 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BIT_STRING|CONST_LIST);
+                                _asn1_set_down((yyval.node),(yyvsp[(4) - (5)].node));}
     break;
 
   case 70:
 
 /* Line 1806 of yacc.c  */
-#line 286 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_NULL);}
+#line 316 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_ENUMERATED|CONST_LIST);
+                                _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
     break;
 
   case 71:
 
 /* Line 1806 of yacc.c  */
-#line 289 "ASN1.y"
-    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+#line 321 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID);}
     break;
 
   case 72:
 
 /* Line 1806 of yacc.c  */
-#line 290 "ASN1.y"
+#line 324 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IDENTIFIER);
+                                       _asn1_set_value((yyval.node),(yyvsp[(1) - (1)].str),strlen((yyvsp[(1) - (1)].str))+1);}
+    break;
+
+  case 73:
+
+/* Line 1806 of yacc.c  */
+#line 326 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IDENTIFIER|CONST_SIZE);
+                                       _asn1_set_value((yyval.node),(yyvsp[(1) - (2)].str),strlen((yyvsp[(1) - (2)].str))+1);
+                                       _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
+    break;
+
+  case 74:
+
+/* Line 1806 of yacc.c  */
+#line 329 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 75:
+
+/* Line 1806 of yacc.c  */
+#line 330 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 76:
+
+/* Line 1806 of yacc.c  */
+#line 331 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 78:
+
+/* Line 1806 of yacc.c  */
+#line 333 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 79:
+
+/* Line 1806 of yacc.c  */
+#line 334 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 80:
+
+/* Line 1806 of yacc.c  */
+#line 335 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 81:
+
+/* Line 1806 of yacc.c  */
+#line 336 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 82:
+
+/* Line 1806 of yacc.c  */
+#line 337 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 83:
+
+/* Line 1806 of yacc.c  */
+#line 338 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 84:
+
+/* Line 1806 of yacc.c  */
+#line 339 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 85:
+
+/* Line 1806 of yacc.c  */
+#line 340 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 86:
+
+/* Line 1806 of yacc.c  */
+#line 341 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 87:
+
+/* Line 1806 of yacc.c  */
+#line 342 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 88:
+
+/* Line 1806 of yacc.c  */
+#line 343 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 89:
+
+/* Line 1806 of yacc.c  */
+#line 344 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 90:
+
+/* Line 1806 of yacc.c  */
+#line 345 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 91:
+
+/* Line 1806 of yacc.c  */
+#line 346 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 92:
+
+/* Line 1806 of yacc.c  */
+#line 347 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 93:
+
+/* Line 1806 of yacc.c  */
+#line 348 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 94:
+
+/* Line 1806 of yacc.c  */
+#line 349 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_NULL);}
+    break;
+
+  case 95:
+
+/* Line 1806 of yacc.c  */
+#line 352 "ASN1.y"
+    {(yyval.node)=(yyvsp[(1) - (1)].node);}
+    break;
+
+  case 96:
+
+/* Line 1806 of yacc.c  */
+#line 353 "ASN1.y"
     {(yyval.node)=_asn1_mod_type((yyvsp[(2) - (2)].node),CONST_TAG);
                                                _asn1_set_right((yyvsp[(1) - (2)].node),_asn1_get_down((yyval.node)));
                                                _asn1_set_down((yyval.node),(yyvsp[(1) - (2)].node));}
     break;
 
-  case 73:
+  case 97:
 
 /* Line 1806 of yacc.c  */
-#line 295 "ASN1.y"
+#line 358 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
-  case 74:
+  case 98:
 
 /* Line 1806 of yacc.c  */
-#line 296 "ASN1.y"
+#line 359 "ASN1.y"
     {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_DEFAULT);
                                                        _asn1_set_right((yyvsp[(2) - (2)].node),_asn1_get_down((yyval.node)));
 						       _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
-  case 75:
+  case 99:
 
 /* Line 1806 of yacc.c  */
-#line 299 "ASN1.y"
+#line 362 "ASN1.y"
     {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_OPTION);}
     break;
 
-  case 76:
+  case 100:
 
 /* Line 1806 of yacc.c  */
-#line 302 "ASN1.y"
+#line 365 "ASN1.y"
     {(yyval.node)=_asn1_set_name((yyvsp[(2) - (2)].node),(yyvsp[(1) - (2)].str));}
     break;
 
-  case 77:
+  case 101:
 
 /* Line 1806 of yacc.c  */
-#line 305 "ASN1.y"
+#line 368 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
-  case 78:
+  case 102:
 
 /* Line 1806 of yacc.c  */
-#line 306 "ASN1.y"
+#line 369 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (3)].node);
                                                 _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (3)].node)),(yyvsp[(3) - (3)].node));}
     break;
 
-  case 79:
+  case 103:
 
 /* Line 1806 of yacc.c  */
-#line 310 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_SEQUENCE);
+#line 373 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SEQUENCE);
                                               _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
     break;
 
-  case 80:
+  case 104:
 
 /* Line 1806 of yacc.c  */
-#line 312 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_SEQUENCE_OF);
+#line 375 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SEQUENCE_OF);
                                               _asn1_set_down((yyval.node),(yyvsp[(3) - (3)].node));}
     break;
 
-  case 81:
+  case 105:
 
 /* Line 1806 of yacc.c  */
-#line 314 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_SEQUENCE_OF|CONST_SIZE);
+#line 377 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SEQUENCE_OF|CONST_SIZE);
                                             _asn1_set_right((yyvsp[(2) - (4)].node),(yyvsp[(4) - (4)].node));
                                             _asn1_set_down((yyval.node),(yyvsp[(2) - (4)].node));}
     break;
 
-  case 82:
+  case 106:
 
 /* Line 1806 of yacc.c  */
-#line 319 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_SET);
+#line 382 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SET);
                                      _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
     break;
 
-  case 83:
+  case 107:
 
 /* Line 1806 of yacc.c  */
-#line 321 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_SET_OF);
+#line 384 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SET_OF);
                                      _asn1_set_down((yyval.node),(yyvsp[(3) - (3)].node));}
     break;
 
-  case 84:
+  case 108:
 
 /* Line 1806 of yacc.c  */
-#line 323 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_SET_OF|CONST_SIZE);
+#line 386 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SET_OF|CONST_SIZE);
                                        _asn1_set_right((yyvsp[(2) - (4)].node),(yyvsp[(4) - (4)].node));
                                        _asn1_set_down((yyval.node),(yyvsp[(2) - (4)].node));}
     break;
 
-  case 85:
+  case 109:
 
 /* Line 1806 of yacc.c  */
-#line 328 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_CHOICE);
+#line 391 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CHOICE);
                                              _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
     break;
 
-  case 86:
+  case 110:
 
 /* Line 1806 of yacc.c  */
-#line 332 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_ANY);}
+#line 395 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_ANY);}
     break;
 
-  case 87:
+  case 111:
 
 /* Line 1806 of yacc.c  */
-#line 333 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_ANY|CONST_DEFINED_BY);
-                                        _asn1_set_down((yyval.node),_asn1_add_static_node(TYPE_CONSTANT));
+#line 396 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_ANY|CONST_DEFINED_BY);
+                                        _asn1_set_down((yyval.node),_asn1_add_static_node(ASN1_ETYPE_CONSTANT));
 	                                _asn1_set_name(_asn1_get_down((yyval.node)),(yyvsp[(4) - (4)].str));}
     break;
 
-  case 88:
+  case 112:
 
 /* Line 1806 of yacc.c  */
-#line 338 "ASN1.y"
+#line 401 "ASN1.y"
     {(yyval.node)=_asn1_set_name((yyvsp[(3) - (3)].node),(yyvsp[(1) - (3)].str));}
     break;
 
-  case 89:
+  case 113:
 
 /* Line 1806 of yacc.c  */
-#line 342 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_OBJECT_ID|CONST_ASSIGN);
+#line 403 "ASN1.y"
+    {(yyval.node)=_asn1_set_name((yyvsp[(2) - (2)].node), "");}
+    break;
+
+  case 114:
+
+/* Line 1806 of yacc.c  */
+#line 407 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID|CONST_ASSIGN);
                          _asn1_set_name((yyval.node),(yyvsp[(1) - (7)].str));
                          _asn1_set_down((yyval.node),(yyvsp[(6) - (7)].node));}
     break;
 
-  case 90:
+  case 115:
 
 /* Line 1806 of yacc.c  */
-#line 346 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_OBJECT_ID|CONST_ASSIGN|CONST_1_PARAM);
+#line 411 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID|CONST_ASSIGN|CONST_1_PARAM);
                          _asn1_set_name((yyval.node),(yyvsp[(1) - (6)].str));
                          _asn1_set_value((yyval.node),(yyvsp[(2) - (6)].str),strlen((yyvsp[(2) - (6)].str))+1);
                          _asn1_set_down((yyval.node),(yyvsp[(5) - (6)].node));}
     break;
 
-  case 91:
+  case 116:
 
 /* Line 1806 of yacc.c  */
-#line 351 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_INTEGER|CONST_ASSIGN);
+#line 416 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER|CONST_ASSIGN);
                          _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str));
                          _asn1_set_value((yyval.node),(yyvsp[(4) - (4)].str),strlen((yyvsp[(4) - (4)].str))+1);}
     break;
 
-  case 92:
+  case 117:
 
 /* Line 1806 of yacc.c  */
-#line 356 "ASN1.y"
+#line 421 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
-  case 93:
+  case 118:
 
 /* Line 1806 of yacc.c  */
-#line 357 "ASN1.y"
+#line 422 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
-  case 94:
+  case 119:
 
 /* Line 1806 of yacc.c  */
-#line 360 "ASN1.y"
+#line 425 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
-  case 95:
+  case 120:
 
 /* Line 1806 of yacc.c  */
-#line 361 "ASN1.y"
+#line 426 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (2)].node);
                                                           _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (2)].node)),(yyvsp[(2) - (2)].node));}
     break;
 
-  case 96:
+  case 121:
 
 /* Line 1806 of yacc.c  */
-#line 365 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_OBJECT_ID);
+#line 430 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID);
                                                           _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));
                                                           _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str));}
     break;
 
-  case 97:
+  case 122:
 
 /* Line 1806 of yacc.c  */
-#line 368 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_OBJECT_ID);
+#line 433 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID);
                                                           _asn1_set_name((yyval.node),(yyvsp[(1) - (3)].str));}
     break;
 
-  case 98:
+  case 123:
 
 /* Line 1806 of yacc.c  */
-#line 370 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(TYPE_OBJECT_ID);
+#line 435 "ASN1.y"
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID);
                                                           _asn1_set_name((yyval.node),(yyvsp[(1) - (1)].str));}
     break;
 
-  case 99:
+  case 124:
 
 /* Line 1806 of yacc.c  */
-#line 394 "ASN1.y"
+#line 459 "ASN1.y"
     {(yyval.constant)=CONST_EXPLICIT;}
     break;
 
-  case 100:
+  case 125:
 
 /* Line 1806 of yacc.c  */
-#line 395 "ASN1.y"
+#line 460 "ASN1.y"
     {(yyval.constant)=CONST_IMPLICIT;}
     break;
 
 
 
 /* Line 1806 of yacc.c  */
-#line 2412 "ASN1.c"
+#line 2647 "ASN1.c"
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
@@ -2639,27 +2874,31 @@ yyreturn:
 
 
 /* Line 2067 of yacc.c  */
-#line 399 "ASN1.y"
+#line 464 "ASN1.y"
 
 
 
 
 static const char *key_word[] = {
-  "::=","OPTIONAL","INTEGER","SIZE","OCTET","STRING"
-  ,"SEQUENCE","BIT","UNIVERSAL","PRIVATE","OPTIONAL"
-  ,"DEFAULT","CHOICE","OF","OBJECT","IDENTIFIER"
-  ,"BOOLEAN","TRUE","FALSE","APPLICATION","ANY","DEFINED"
-  ,"SET","BY","EXPLICIT","IMPLICIT","DEFINITIONS","TAGS"
-  ,"BEGIN","END","UTCTime","GeneralizedTime"
-  ,"GeneralString","FROM","IMPORTS","NULL","ENUMERATED"};
+  "::=","OPTIONAL","INTEGER","SIZE","OCTET","STRING",
+  "SEQUENCE","BIT","UNIVERSAL","PRIVATE","OPTIONAL",
+  "DEFAULT","CHOICE","OF","OBJECT","IDENTIFIER",
+  "BOOLEAN","TRUE","FALSE","APPLICATION","ANY","DEFINED",
+  "SET","BY","EXPLICIT","IMPLICIT","DEFINITIONS","TAGS",
+  "BEGIN","END","UTCTime","GeneralizedTime",
+  "GeneralString","FROM","IMPORTS","NULL","ENUMERATED",
+  "NumericString", "IA5String", "TeletexString", "PrintableString",
+  "UniversalString", "BMPString", "UTF8String", "VisibleString"};
+
 static const int key_word_token[] = {
-  ASSIG,OPTIONAL,INTEGER,SIZE,OCTET,STRING
-  ,SEQUENCE,BIT,UNIVERSAL,PRIVATE,OPTIONAL
-  ,DEFAULT,CHOICE,OF,OBJECT,STR_IDENTIFIER
-  ,BOOLEAN,ASN1_TRUE,ASN1_FALSE,APPLICATION,ANY,DEFINED
-  ,SET,BY,EXPLICIT,IMPLICIT,DEFINITIONS,TAGS
-  ,BEGIN,END,UTCTime,GeneralizedTime
-  ,GeneralString,FROM,IMPORTS,TOKEN_NULL,ENUMERATED};
+  ASSIG, OPTIONAL, INTEGER, SIZE, OCTET, STRING, SEQUENCE, BIT, UNIVERSAL,
+      PRIVATE, OPTIONAL, DEFAULT, CHOICE, OF, OBJECT, STR_IDENTIFIER,
+      BOOLEAN, ASN1_TRUE, ASN1_FALSE, APPLICATION, ANY, DEFINED, SET, BY,
+      EXPLICIT, IMPLICIT, DEFINITIONS, TAGS, BEGIN, END, UTCTime,
+      GeneralizedTime, GeneralString, FROM, IMPORTS, TOKEN_NULL,
+      ENUMERATED, NumericString, IA5String, TeletexString, PrintableString,
+      UniversalString, BMPString, UTF8String, VisibleString
+};
 
 /*************************************************************/
 /*  Function: _asn1_yylex                                    */
@@ -2668,83 +2907,98 @@ static const int key_word_token[] = {
 /*    Token identifier or ASCII code or 0(zero: End Of File) */
 /*************************************************************/
 static int
-_asn1_yylex()
+_asn1_yylex ()
 {
-  int c,counter=0,k,lastc;
-  char string[ASN1_MAX_NAME_SIZE+1]; /* will contain the next token */
+  int c, counter = 0, k, lastc;
+  char string[ASN1_MAX_NAME_SIZE + 1];  /* will contain the next token */
   size_t i;
 
-  while(1)
+  while (1)
     {
-    while((c=fgetc(file_asn1))==' ' || c=='\t' || c=='\n')
-      if(c=='\n') lineNumber++;
+      while ((c = fgetc (file_asn1)) == ' ' || c == '\t' || c == '\n')
+        if (c == '\n')
+          line_number++;
 
-    if(c==EOF){
-      strcpy(lastToken,"End Of File");
-      return 0;
-    }
+      if (c == EOF)
+        {
+          strcpy (last_token, "End Of File");
+          return 0;
+        }
 
-    if(c=='(' || c==')' || c=='[' || c==']' ||
-       c=='{' || c=='}' || c==',' || c=='.' ||
-       c=='+' || c=='|'){
-      lastToken[0]=c;lastToken[1]=0;
-      return c;
-    }
-    if(c=='-'){  /* Maybe the first '-' of a comment */
-      if((c=fgetc(file_asn1))!='-'){
-	ungetc(c,file_asn1);
-	lastToken[0]='-';lastToken[1]=0;
-	return '-';
-      }
-      else{ /* Comments */
-	lastc=0;
-	counter=0;
-	/* A comment finishes at the next double hypen or the end of line */
-	while((c=fgetc(file_asn1))!=EOF && c!='\n' &&
-	      (lastc!='-' || (lastc=='-' && c!='-')))
-	  lastc=c;
-	if(c==EOF){
-	  strcpy(lastToken,"End Of File");
-	  return 0;
-	}
-	else{
-	  if(c=='\n') lineNumber++;
-	  continue; /* next char, please! (repeat the search) */
-	}
-      }
-    }
-    string[counter++]=c;
-    /* Till the end of the token */
-    while(!((c=fgetc(file_asn1))==EOF || c==' '|| c=='\t' || c=='\n' ||
-	     c=='(' || c==')' || c=='[' || c==']' ||
-	     c=='{' || c=='}' || c==',' || c=='.'))
-      {
-	if(counter>=ASN1_MAX_NAME_SIZE){
-	  result_parse=ASN1_NAME_TOO_LONG;
-	  return 0;
-	}
-	string[counter++]=c;
-      }
-    ungetc(c,file_asn1);
-    string[counter]=0;
-    strcpy(lastToken,string);
-
-    /* Is STRING a number? */
-    for(k=0;k<counter;k++)
-      if(!isdigit(string[k])) break;
-    if(k>=counter)
-      {
-      strcpy(yylval.str,string);
-      return NUM; /* return the number */
-      }
+      if (c == '(' || c == ')' || c == '[' || c == ']' ||
+          c == '{' || c == '}' || c == ',' || c == '.' ||
+          c == '+' || c == '|')
+        {
+          last_token[0] = c;
+          last_token[1] = 0;
+          return c;
+        }
+      if (c == '-')
+        {                       /* Maybe the first '-' of a comment */
+          if ((c = fgetc (file_asn1)) != '-')
+            {
+              ungetc (c, file_asn1);
+              last_token[0] = '-';
+              last_token[1] = 0;
+              return '-';
+            }
+          else
+            {                   /* Comments */
+              lastc = 0;
+              counter = 0;
+              /* A comment finishes at the next double hypen or the end of line */
+              while ((c = fgetc (file_asn1)) != EOF && c != '\n' &&
+                     (lastc != '-' || (lastc == '-' && c != '-')))
+                lastc = c;
+              if (c == EOF)
+                {
+                  strcpy (last_token, "End Of File");
+                  return 0;
+                }
+              else
+                {
+                  if (c == '\n')
+                    line_number++;
+                  continue;     /* next char, please! (repeat the search) */
+                }
+            }
+        }
+      string[counter++] = c;
+      /* Till the end of the token */
+      while (!
+             ((c = fgetc (file_asn1)) == EOF || c == ' ' || c == '\t'
+              || c == '\n' || c == '(' || c == ')' || c == '[' || c == ']'
+              || c == '{' || c == '}' || c == ',' || c == '.'))
+        {
+          if (counter >= ASN1_MAX_NAME_SIZE)
+            {
+              result_parse = ASN1_NAME_TOO_LONG;
+              return 0;
+            }
+          string[counter++] = c;
+        }
+      ungetc (c, file_asn1);
+      string[counter] = 0;
+      strcpy (last_token, string);
+
+      /* Is STRING a number? */
+      for (k = 0; k < counter; k++)
+        if (!isdigit (string[k]))
+          break;
+      if (k >= counter)
+        {
+          strcpy (yylval.str, string);
+          return NUM;           /* return the number */
+        }
 
-    /* Is STRING a keyword? */
-    for(i=0;i<(sizeof(key_word)/sizeof(char*));i++)
-      if(!strcmp(string,key_word[i])) return key_word_token[i];
+      /* Is STRING a keyword? */
+      for (i = 0; i < (sizeof (key_word) / sizeof (char *)); i++)
+        if (!strcmp (string, key_word[i]))
+          return key_word_token[i];
 
-    /* STRING is an IDENTIFIER */
-    strcpy(yylval.str,string);
-    return IDENTIFIER;
+      /* STRING is an IDENTIFIER */
+      strcpy (yylval.str, string);
+      return IDENTIFIER;
     }
 }
 
@@ -2754,129 +3008,118 @@ _asn1_yylex()
 /*    error.                                                 */
 /*  Parameters:                                              */
 /*    error : error to describe.                             */
-/*    errorDescription: string that will contain the         */
+/*    error_desc: string that will contain the         */
 /*                      description.                         */
 /*************************************************************/
 static void
-_asn1_create_errorDescription(int error,char *errorDescription)
+_asn1_create_errorDescription (int error, char *error_desc)
 {
-  switch(error){
-  case ASN1_SUCCESS: case ASN1_FILE_NOT_FOUND:
-    if (errorDescription!=NULL) errorDescription[0]=0;
-    break;
-  case ASN1_SYNTAX_ERROR:
-    if (errorDescription!=NULL) {
-	strcpy(errorDescription,fileName);
-	strcat(errorDescription,":");
-	_asn1_ltostr(lineNumber,errorDescription+strlen(fileName)+1);
-	strcat(errorDescription,": parse error near '");
-	strcat(errorDescription,lastToken);
-	strcat(errorDescription,"'");
-    }
-    break;
-  case ASN1_NAME_TOO_LONG:
-    if (errorDescription!=NULL) {
-       strcpy(errorDescription,fileName);
-       strcat(errorDescription,":");
-       _asn1_ltostr(lineNumber,errorDescription+strlen(fileName)+1);
-       strcat(errorDescription,": name too long (more than ");
-       _asn1_ltostr(ASN1_MAX_NAME_SIZE,errorDescription+strlen(errorDescription));
-       strcat(errorDescription," characters)");
-    }
-    break;
-  case ASN1_IDENTIFIER_NOT_FOUND:
-    if (errorDescription!=NULL) {
-       strcpy(errorDescription,fileName);
-       strcat(errorDescription,":");
-       strcat(errorDescription,": identifier '");
-       strcat(errorDescription,_asn1_identifierMissing);
-       strcat(errorDescription,"' not found");
+  if (error_desc == NULL)
+    return;
+
+
+  switch (error)
+    {
+    case ASN1_SYNTAX_ERROR:
+      strcpy(error_desc, last_error);
+      break;
+    case ASN1_NAME_TOO_LONG:
+      snprintf (error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
+                "%s:%u: name too long (more than %u characters)", file_name,
+                line_number, ASN1_MAX_NAME_SIZE);
+      break;
+    case ASN1_IDENTIFIER_NOT_FOUND:
+      snprintf (error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
+                "%s:: identifier '%s' not found", file_name,
+                _asn1_identifierMissing);
+      break;
+    default:
+      error_desc[0] = 0;
+      break;
     }
-    break;
-  default:
-    if (errorDescription!=NULL) errorDescription[0]=0;
-    break;
-  }
 
 }
 
 /**
  * asn1_parser2tree:
- * @file_name: specify the path and the name of file that contains
+ * @file: specify the path and the name of file that contains
  *   ASN.1 declarations.
  * @definitions: return the pointer to the structure created from
- *   "file_name" ASN.1 declarations.
- * @errorDescription: return the error description or an empty
+ *   "file" ASN.1 declarations.
+ * @error_desc: return the error description or an empty
  * string if success.
  *
  * Function used to start the parse algorithm.  Creates the structures
- * needed to manage the definitions included in @file_name file.
+ * needed to manage the definitions included in @file file.
  *
  * Returns: %ASN1_SUCCESS if the file has a correct syntax and every
  *   identifier is known, %ASN1_ELEMENT_NOT_EMPTY if @definitions not
  *   %NULL, %ASN1_FILE_NOT_FOUND if an error occured while
- *   opening @file_name, %ASN1_SYNTAX_ERROR if the syntax is not
+ *   opening @file, %ASN1_SYNTAX_ERROR if the syntax is not
  *   correct, %ASN1_IDENTIFIER_NOT_FOUND if in the file there is an
  *   identifier that is not defined, %ASN1_NAME_TOO_LONG if in the
  *   file there is an identifier whith more than %ASN1_MAX_NAME_SIZE
  *   characters.
  **/
 int
-asn1_parser2tree(const char *file_name, asn1_node *definitions,
-		 char *errorDescription) 
+asn1_parser2tree (const char *file, asn1_node * definitions,
+                  char *error_desc)
 {
 
-  p_tree=NULL;
+  p_tree = NULL;
 
-  if(*definitions != NULL)
+  if (*definitions != NULL)
     return ASN1_ELEMENT_NOT_EMPTY;
 
-  *definitions=NULL;
+  *definitions = NULL;
 
-  fileName = file_name;
+  file_name = file;
 
   /* open the file to parse */
-  file_asn1=fopen(file_name,"r");
+  file_asn1 = fopen (file, "r");
 
-  if(file_asn1==NULL){
-    result_parse=ASN1_FILE_NOT_FOUND;
-  }
-  else{
-    result_parse=ASN1_SUCCESS;
-
-    lineNumber=1;
-    yyparse();
-
-    fclose(file_asn1);
-
-    if(result_parse==ASN1_SUCCESS){ /* syntax OK */
-      /* set IMPLICIT or EXPLICIT property */
-      _asn1_set_default_tag(p_tree);
-      /* set CONST_SET and CONST_NOT_USED */
-      _asn1_type_set_config(p_tree);
-      /* check the identifier definitions */
-      result_parse=_asn1_check_identifier(p_tree);
-      if(result_parse==ASN1_SUCCESS){ /* all identifier defined */
-	/* Delete the list and keep the ASN1 structure */
-	_asn1_delete_list();
-	/* Convert into DER coding the value assign to INTEGER constants */
-	_asn1_change_integer_value(p_tree);
-	/* Expand the IDs of OBJECT IDENTIFIER constants */
-	_asn1_expand_object_id(p_tree);
-
-	*definitions=p_tree;
-      }
-      else /* some identifiers not defined */
-	/* Delete the list and the ASN1 structure */
-	_asn1_delete_list_and_nodes();
+  if (file_asn1 == NULL)
+    {
+      result_parse = ASN1_FILE_NOT_FOUND;
+    }
+  else
+    {
+      result_parse = ASN1_SUCCESS;
+
+      line_number = 1;
+      yyparse ();
+
+      fclose (file_asn1);
+
+      if (result_parse == ASN1_SUCCESS)
+        {                       /* syntax OK */
+          /* set IMPLICIT or EXPLICIT property */
+          _asn1_set_default_tag (p_tree);
+          /* set CONST_SET and CONST_NOT_USED */
+          _asn1_type_set_config (p_tree);
+          /* check the identifier definitions */
+          result_parse = _asn1_check_identifier (p_tree);
+          if (result_parse == ASN1_SUCCESS)
+            {                   /* all identifier defined */
+              /* Delete the list and keep the ASN1 structure */
+              _asn1_delete_list ();
+              /* Convert into DER coding the value assign to INTEGER constants */
+              _asn1_change_integer_value (p_tree);
+              /* Expand the IDs of OBJECT IDENTIFIER constants */
+              _asn1_expand_object_id (p_tree);
+
+              *definitions = p_tree;
+            }
+          else                  /* some identifiers not defined */
+            /* Delete the list and the ASN1 structure */
+            _asn1_delete_list_and_nodes ();
+        }
+      else                      /* syntax error */
+        /* Delete the list and the ASN1 structure */
+        _asn1_delete_list_and_nodes ();
     }
-    else  /* syntax error */
-      /* Delete the list and the ASN1 structure */
-      _asn1_delete_list_and_nodes();
-  }
 
-  if (errorDescription!=NULL)
-	_asn1_create_errorDescription(result_parse,errorDescription);
+  _asn1_create_errorDescription (result_parse, error_desc);
 
   return result_parse;
 }
@@ -2888,7 +3131,7 @@ asn1_parser2tree(const char *file_name, asn1_node *definitions,
  * @outputFileName: specify the path and the name of file that will
  *   contain the C vector definition.
  * @vectorName: specify the name of the C vector.
- * @errorDescription : return the error description or an empty
+ * @error_desc : return the error description or an empty
  *   string if success.
  *
  * Function that generates a C structure from an ASN1 file.  Creates a
@@ -2906,98 +3149,110 @@ asn1_parser2tree(const char *file_name, asn1_node *definitions,
  *   file there is an identifier whith more than %ASN1_MAX_NAME_SIZE
  *   characters.
  **/
-int asn1_parser2array(const char *inputFileName,const char *outputFileName,
-		      const char *vectorName,char *errorDescription){
-  char *file_out_name=NULL;
-  char *vector_name=NULL;
-  const char *char_p,*slash_p,*dot_p;
+int
+asn1_parser2array (const char *inputFileName, const char *outputFileName,
+                   const char *vectorName, char *error_desc)
+{
+  char *file_out_name = NULL;
+  char *vector_name = NULL;
+  const char *char_p, *slash_p, *dot_p;
 
-  p_tree=NULL;
+  p_tree = NULL;
 
-  fileName = inputFileName;
+  file_name = inputFileName;
 
   /* open the file to parse */
-  file_asn1=fopen(inputFileName,"r");
-
-  if(file_asn1==NULL)
-    result_parse=ASN1_FILE_NOT_FOUND;
-  else{
-    result_parse=ASN1_SUCCESS;
-
-    lineNumber=1;
-    yyparse();
-
-    fclose(file_asn1);
-
-    if(result_parse==ASN1_SUCCESS){ /* syntax OK */
-      /* set IMPLICIT or EXPLICIT property */
-      _asn1_set_default_tag(p_tree);
-      /* set CONST_SET and CONST_NOT_USED */
-      _asn1_type_set_config(p_tree);
-      /* check the identifier definitions */
-      result_parse=_asn1_check_identifier(p_tree);
-
-      if(result_parse==ASN1_SUCCESS){ /* all identifier defined */
-
-	/* searching the last '/' and '.' in inputFileName */
-	char_p=inputFileName;
-	slash_p=inputFileName;
-	while((char_p=strchr(char_p,'/'))){
-	  char_p++;
-	  slash_p=char_p;
-	}
+  file_asn1 = fopen (inputFileName, "r");
 
-	char_p=slash_p;
-	dot_p=inputFileName+strlen(inputFileName);
-
-	while((char_p=strchr(char_p,'.'))){
-	  dot_p=char_p;
-	  char_p++;
-	}
-
-	if(outputFileName == NULL){
-	  /* file_out_name = inputFileName + _asn1_tab.c */
-	  file_out_name=malloc(dot_p-inputFileName+1+
-				       strlen("_asn1_tab.c"));
-	  memcpy(file_out_name,inputFileName,dot_p-inputFileName);
-	  file_out_name[dot_p-inputFileName]=0;
-	  strcat(file_out_name,"_asn1_tab.c");
-	}
-	else{
-	  /* file_out_name = inputFileName */
-	  file_out_name=(char *)malloc(strlen(outputFileName)+1);
-	  strcpy(file_out_name,outputFileName);
-	}
-
-	if(vectorName == NULL){
-	  /* vector_name = file name + _asn1_tab */
-	  vector_name=malloc(dot_p-slash_p+1+
-				     strlen("_asn1_tab"));
-	  memcpy(vector_name,slash_p,dot_p-slash_p);
-	  vector_name[dot_p-slash_p]=0;
-	  strcat(vector_name,"_asn1_tab");
-	}
-	else{
-	  /* vector_name = vectorName */
-	  vector_name=(char *)malloc(strlen(vectorName)+1);
-	  strcpy(vector_name,vectorName);
-	}
-
-	/* Save structure in a file */
-	_asn1_create_static_structure(p_tree,
-				      file_out_name,vector_name);
-
-	free(file_out_name);
-	free(vector_name);
-      } /* result == OK */
-    }   /* result == OK */
+  if (file_asn1 == NULL)
+    result_parse = ASN1_FILE_NOT_FOUND;
+  else
+    {
+      result_parse = ASN1_SUCCESS;
+
+      line_number = 1;
+      yyparse ();
+
+      fclose (file_asn1);
+
+      if (result_parse == ASN1_SUCCESS)
+        {                       /* syntax OK */
+          /* set IMPLICIT or EXPLICIT property */
+          _asn1_set_default_tag (p_tree);
+          /* set CONST_SET and CONST_NOT_USED */
+          _asn1_type_set_config (p_tree);
+          /* check the identifier definitions */
+          result_parse = _asn1_check_identifier (p_tree);
+
+          if (result_parse == ASN1_SUCCESS)
+            {                   /* all identifier defined */
+
+              /* searching the last '/' and '.' in inputFileName */
+              char_p = inputFileName;
+              slash_p = inputFileName;
+              while ((char_p = strchr (char_p, '/')))
+                {
+                  char_p++;
+                  slash_p = char_p;
+                }
+
+              char_p = slash_p;
+              dot_p = inputFileName + strlen (inputFileName);
+
+              while ((char_p = strchr (char_p, '.')))
+                {
+                  dot_p = char_p;
+                  char_p++;
+                }
+
+              if (outputFileName == NULL)
+                {
+                  /* file_out_name = inputFileName + _asn1_tab.c */
+                  file_out_name = malloc (dot_p - inputFileName + 1 +
+                                          strlen ("_asn1_tab.c"));
+                  memcpy (file_out_name, inputFileName,
+                          dot_p - inputFileName);
+                  file_out_name[dot_p - inputFileName] = 0;
+                  strcat (file_out_name, "_asn1_tab.c");
+                }
+              else
+                {
+                  /* file_out_name = inputFileName */
+                  file_out_name =
+                      (char *) malloc (strlen (outputFileName) + 1);
+                  strcpy (file_out_name, outputFileName);
+                }
+
+              if (vectorName == NULL)
+                {
+                  /* vector_name = file name + _asn1_tab */
+                  vector_name = malloc (dot_p - slash_p + 1 +
+                                        strlen ("_asn1_tab"));
+                  memcpy (vector_name, slash_p, dot_p - slash_p);
+                  vector_name[dot_p - slash_p] = 0;
+                  strcat (vector_name, "_asn1_tab");
+                }
+              else
+                {
+                  /* vector_name = vectorName */
+                  vector_name = (char *) malloc (strlen (vectorName) + 1);
+                  strcpy (vector_name, vectorName);
+                }
+
+              /* Save structure in a file */
+              _asn1_create_static_structure (p_tree,
+                                             file_out_name, vector_name);
+
+              free (file_out_name);
+              free (vector_name);
+            }                   /* result == OK */
+        }                       /* result == OK */
 
-    /* Delete the list and the ASN1 structure */
-    _asn1_delete_list_and_nodes();
-  } /* inputFile exist */
+      /* Delete the list and the ASN1 structure */
+      _asn1_delete_list_and_nodes ();
+    }                           /* inputFile exist */
 
-  if (errorDescription!=NULL)
-	_asn1_create_errorDescription(result_parse,errorDescription);
+  _asn1_create_errorDescription (result_parse, error_desc);
 
   return result_parse;
 }
@@ -3010,18 +3265,35 @@ int asn1_parser2array(const char *inputFileName,const char *outputFileName,
 /*  Return: int                                              */
 /*                                                           */
 /*************************************************************/
-static int _asn1_yyerror (const char *s)
+static void
+_asn1_yyerror (const char *s)
 {
   /* Sends the error description to the std_out */
 
-#if 0
-  printf("_asn1_yyerror:%s:%ld: %s (Last Token:'%s')\n",fileName,
-	 lineNumber,s,lastToken);
-#endif
+  if (strcmp (last_token, "VisibleString") == 0 ||
+      strcmp (last_token, "PrintableString") == 0 ||
+      strcmp (last_token, "UniversalString") == 0 ||
+      strcmp (last_token, "IA5String") == 0 ||
+      strcmp (last_token, "UTF8String") == 0 ||
+      strcmp (last_token, "NumericString") == 0 ||
+      strcmp (last_token, "TeletexString") == 0 ||
+      strcmp (last_token, "BMPString") == 0)
+    {
+      fprintf(stderr, 
+               "%s:%ld: Warning: %s is a built-in ASN.1 type.\n",
+               file_name, line_number, last_token);
+      return;
+    }
 
-  if(result_parse!=ASN1_NAME_TOO_LONG)
-    result_parse=ASN1_SYNTAX_ERROR;
 
-  return 0;
+  if (result_parse != ASN1_NAME_TOO_LONG)
+    {
+      snprintf (last_error, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
+                "%s:%ld: Error: %s near '%s'", file_name,
+                line_number, s, last_token);
+      result_parse = ASN1_SYNTAX_ERROR;
+    }
+
+  return;
 }
 
diff --git a/lib/ASN1.y b/lib/ASN1.y
index 69f43b5..c5bca99 100644
--- a/lib/ASN1.y
+++ b/lib/ASN1.y
@@ -30,28 +30,32 @@
 #include <int.h>
 #include <parser_aux.h>
 #include <structure.h>
+#include <libtasn1.h>
 
 static FILE *file_asn1;			/* Pointer to file to parse */
-static int result_parse;	/* result of the parser
+static int result_parse = 0;	/* result of the parser
 					   algorithm */
 static asn1_node p_tree;		/* pointer to the root of the
 					   structure created by the
 					   parser*/
-static unsigned long lineNumber;	/* line number describing the
+static unsigned int line_number;	/* line number describing the
 					   parser position inside the
 					   file */
-static char lastToken[ASN1_MAX_NAME_SIZE+1];	/* last token find in the file
+static char last_error[ASN1_MAX_ERROR_DESCRIPTION_SIZE] = "";
+static char last_token[ASN1_MAX_NAME_SIZE+1];	/* last token find in the file
 					   to parse before the 'parse
 					   error' */
 extern char _asn1_identifierMissing[];
-static const char *fileName;		/* file to parse */
+static const char *file_name;		/* file to parse */
 
-static int _asn1_yyerror (const char *);
+static void _asn1_yyerror (const char *);
 static int _asn1_yylex(void);
 
 %}
 
 /* Prefix symbols and functions with _asn1_ */
+/* %define parse.lac full */
+%error-verbose
 %name-prefix="_asn1_yy"
 
 %union {
@@ -96,6 +100,15 @@ static int _asn1_yylex(void);
 %token UTCTime
 %token GeneralizedTime
 %token GeneralString
+%token NumericString
+%token IA5String
+%token TeletexString
+%token PrintableString
+%token UniversalString
+%token BMPString
+%token UTF8String
+%token VisibleString
+
 %token FROM
 %token IMPORTS
 %token ENUMERATED
@@ -107,6 +120,8 @@ static int _asn1_yylex(void);
 %type <node> constant_def type_constant type_constant_list definitions
 %type <node> definitions_id Time bit_element bit_element_list set_def
 %type <node> tag_type tag type_assig_right_tag generalstring_def
+%type <node> numericstring_def ia5string_def printablestring_def universalstring_def
+%type <node> bmpstring_def utf8string_def visiblestring_def teletexstring_def
 %type <node> type_assig_right_tag_default enumerated_def
 %type <str>  pos_num neg_num pos_neg_num pos_neg_identifier pos_neg_list
 %type <str>  num_identifier
@@ -118,7 +133,7 @@ static int _asn1_yylex(void);
 definitions:   definitions_id
                DEFINITIONS explicit_implicit TAGS "::=" BEGIN  /* imports_def */
                type_constant_list END
-                   {$$=_asn1_add_static_node(TYPE_DEFINITIONS|$3);
+                   {$$=_asn1_add_static_node(ASN1_ETYPE_DEFINITIONS|$3);
                     _asn1_set_name($$,_asn1_get_name($1));
                     _asn1_set_name($1,"");
                     _asn1_set_right($1,$7);
@@ -148,9 +163,9 @@ pos_neg_identifier :  pos_neg_num    {strcpy($$,$1);}
                     | IDENTIFIER     {strcpy($$,$1);}
 ;
 
-constant: '(' pos_neg_num ')'         {$$=_asn1_add_static_node(TYPE_CONSTANT);
+constant: '(' pos_neg_num ')'         {$$=_asn1_add_static_node(ASN1_ETYPE_CONSTANT);
                                        _asn1_set_value($$,$2,strlen($2)+1);}
-        | IDENTIFIER'('pos_neg_num')' {$$=_asn1_add_static_node(TYPE_CONSTANT);
+        | IDENTIFIER'('pos_neg_num')' {$$=_asn1_add_static_node(ASN1_ETYPE_CONSTANT);
 	                               _asn1_set_name($$,$1);
                                        _asn1_set_value($$,$3,strlen($3)+1);}
 ;
@@ -160,9 +175,9 @@ constant_list:  constant                   {$$=$1;}
                                             _asn1_set_right(_asn1_get_last_right($1),$3);}
 ;
 
-obj_constant:  num_identifier     {$$=_asn1_add_static_node(TYPE_CONSTANT);
+obj_constant:  num_identifier     {$$=_asn1_add_static_node(ASN1_ETYPE_CONSTANT);
                                    _asn1_set_value($$,$1,strlen($1)+1);}
-             | IDENTIFIER'('NUM')' {$$=_asn1_add_static_node(TYPE_CONSTANT);
+             | IDENTIFIER'('NUM')' {$$=_asn1_add_static_node(ASN1_ETYPE_CONSTANT);
 	                            _asn1_set_name($$,$1);
                                     _asn1_set_value($$,$3,strlen($3)+1);}
 ;
@@ -177,9 +192,9 @@ class :  UNIVERSAL    {$$=CONST_UNIVERSAL;}
        | APPLICATION  {$$=CONST_APPLICATION;}
 ;
 
-tag_type :  '[' NUM ']'    {$$=_asn1_add_static_node(TYPE_TAG);
+tag_type :  '[' NUM ']'    {$$=_asn1_add_static_node(ASN1_ETYPE_TAG);
                             _asn1_set_value($$,$2,strlen($2)+1);}
-          | '[' class NUM ']'  {$$=_asn1_add_static_node(TYPE_TAG | $2);
+          | '[' class NUM ']'  {$$=_asn1_add_static_node(ASN1_ETYPE_TAG | $2);
                                 _asn1_set_value($$,$3,strlen($3)+1);}
 ;
 
@@ -188,10 +203,10 @@ tag :  tag_type           {$$=$1;}
      | tag_type IMPLICIT  {$$=_asn1_mod_type($1,CONST_IMPLICIT);}
 ;
 
-default :  DEFAULT pos_neg_identifier {$$=_asn1_add_static_node(TYPE_DEFAULT);
+default :  DEFAULT pos_neg_identifier {$$=_asn1_add_static_node(ASN1_ETYPE_DEFAULT);
                                        _asn1_set_value($$,$2,strlen($2)+1);}
-         | DEFAULT ASN1_TRUE           {$$=_asn1_add_static_node(TYPE_DEFAULT|CONST_TRUE);}
-         | DEFAULT ASN1_FALSE          {$$=_asn1_add_static_node(TYPE_DEFAULT|CONST_FALSE);}
+         | DEFAULT ASN1_TRUE           {$$=_asn1_add_static_node(ASN1_ETYPE_DEFAULT|CONST_TRUE);}
+         | DEFAULT ASN1_FALSE          {$$=_asn1_add_static_node(ASN1_ETYPE_DEFAULT|CONST_FALSE);}
 ;
 
 
@@ -200,28 +215,28 @@ pos_neg_list:  pos_neg_num
 ;
 
 
-integer_def: INTEGER                    {$$=_asn1_add_static_node(TYPE_INTEGER);}
-           | INTEGER'{'constant_list'}' {$$=_asn1_add_static_node(TYPE_INTEGER|CONST_LIST);
+integer_def: INTEGER                    {$$=_asn1_add_static_node(ASN1_ETYPE_INTEGER);}
+           | INTEGER'{'constant_list'}' {$$=_asn1_add_static_node(ASN1_ETYPE_INTEGER|CONST_LIST);
 	                                 _asn1_set_down($$,$3);}
-           | integer_def'(' pos_neg_list ')' {$$=_asn1_add_static_node(TYPE_INTEGER);}
+           | integer_def'(' pos_neg_list ')' {$$=_asn1_add_static_node(ASN1_ETYPE_INTEGER);}
            | integer_def'('num_identifier'.''.'num_identifier')'
-                                        {$$=_asn1_add_static_node(TYPE_INTEGER|CONST_MIN_MAX);
-                                         _asn1_set_down($$,_asn1_add_static_node(TYPE_SIZE));
+                                        {$$=_asn1_add_static_node(ASN1_ETYPE_INTEGER|CONST_MIN_MAX);
+                                         _asn1_set_down($$,_asn1_add_static_node(ASN1_ETYPE_SIZE));
                                          _asn1_set_value(_asn1_get_down($$),$6,strlen($6)+1);
                                          _asn1_set_name(_asn1_get_down($$),$3);}
 ;
 
-boolean_def: BOOLEAN   {$$=_asn1_add_static_node(TYPE_BOOLEAN);}
+boolean_def: BOOLEAN   {$$=_asn1_add_static_node(ASN1_ETYPE_BOOLEAN);}
 ;
 
-Time:   UTCTime          {$$=_asn1_add_static_node(TYPE_TIME|CONST_UTC);}
-      | GeneralizedTime  {$$=_asn1_add_static_node(TYPE_TIME|CONST_GENERALIZED);}
+Time:   UTCTime          {$$=_asn1_add_static_node(ASN1_ETYPE_TIME|CONST_UTC);}
+      | GeneralizedTime  {$$=_asn1_add_static_node(ASN1_ETYPE_TIME|CONST_GENERALIZED);}
 ;
 
-size_def2: SIZE'('num_identifier')'  {$$=_asn1_add_static_node(TYPE_SIZE|CONST_1_PARAM);
+size_def2: SIZE'('num_identifier')'  {$$=_asn1_add_static_node(ASN1_ETYPE_SIZE|CONST_1_PARAM);
 	                              _asn1_set_value($$,$3,strlen($3)+1);}
         | SIZE'('num_identifier'.''.'num_identifier')'
-                                     {$$=_asn1_add_static_node(TYPE_SIZE|CONST_MIN_MAX);
+                                     {$$=_asn1_add_static_node(ASN1_ETYPE_SIZE|CONST_MIN_MAX);
 	                              _asn1_set_value($$,$3,strlen($3)+1);
                                       _asn1_set_name($$,$6);}
 ;
@@ -230,17 +245,57 @@ size_def:   size_def2          {$$=$1;}
           | '(' size_def2 ')'  {$$=$2;}
 ;
 
-generalstring_def: GeneralString {$$=_asn1_add_static_node(TYPE_GENERALSTRING);}
-                | GeneralString size_def {$$=_asn1_add_static_node(TYPE_GENERALSTRING|CONST_SIZE);
+generalstring_def: GeneralString {$$=_asn1_add_static_node(ASN1_ETYPE_GENERALSTRING);}
+                | GeneralString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_GENERALSTRING|CONST_SIZE);
+					  _asn1_set_down($$,$2);}
+;
+
+numericstring_def: NumericString {$$=_asn1_add_static_node(ASN1_ETYPE_NUMERICSTRING|CONST_UNIVERSAL);}
+                | NumericString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_NUMERICSTRING|CONST_SIZE);
+					  _asn1_set_down($$,$2);}
+;
+
+ia5string_def: IA5String {$$=_asn1_add_static_node(ASN1_ETYPE_IA5STRING);}
+                | IA5String size_def {$$=_asn1_add_static_node(ASN1_ETYPE_IA5STRING|CONST_SIZE);
 					  _asn1_set_down($$,$2);}
 ;
 
-octet_string_def : OCTET STRING           {$$=_asn1_add_static_node(TYPE_OCTET_STRING);}
-                 | OCTET STRING size_def  {$$=_asn1_add_static_node(TYPE_OCTET_STRING|CONST_SIZE);
+teletexstring_def: TeletexString {$$=_asn1_add_static_node(ASN1_ETYPE_TELETEXSTRING);}
+                | TeletexString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_TELETEXSTRING|CONST_SIZE);
+					  _asn1_set_down($$,$2);}
+;
+
+printablestring_def: PrintableString {$$=_asn1_add_static_node(ASN1_ETYPE_PRINTABLESTRING);}
+                | PrintableString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_PRINTABLESTRING|CONST_SIZE);
+					  _asn1_set_down($$,$2);}
+;
+
+universalstring_def: UniversalString {$$=_asn1_add_static_node(ASN1_ETYPE_UNIVERSALSTRING);}
+                | UniversalString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_UNIVERSALSTRING|CONST_SIZE);
+					  _asn1_set_down($$,$2);}
+;
+
+bmpstring_def: BMPString {$$=_asn1_add_static_node(ASN1_ETYPE_BMPSTRING);}
+                | BMPString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_BMPSTRING|CONST_SIZE);
+					  _asn1_set_down($$,$2);}
+;
+
+utf8string_def: UTF8String {$$=_asn1_add_static_node(ASN1_ETYPE_UTF8STRING);}
+                | UTF8String size_def {$$=_asn1_add_static_node(ASN1_ETYPE_UTF8STRING|CONST_SIZE);
+					  _asn1_set_down($$,$2);}
+;
+
+visiblestring_def: VisibleString {$$=_asn1_add_static_node(ASN1_ETYPE_VISIBLESTRING);}
+                | VisibleString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_VISIBLESTRING|CONST_SIZE);
+					  _asn1_set_down($$,$2);}
+;
+
+octet_string_def : OCTET STRING           {$$=_asn1_add_static_node(ASN1_ETYPE_OCTET_STRING);}
+                 | OCTET STRING size_def  {$$=_asn1_add_static_node(ASN1_ETYPE_OCTET_STRING|CONST_SIZE);
                                            _asn1_set_down($$,$3);}
 ;
 
-bit_element :  IDENTIFIER'('NUM')' {$$=_asn1_add_static_node(TYPE_CONSTANT);
+bit_element :  IDENTIFIER'('NUM')' {$$=_asn1_add_static_node(ASN1_ETYPE_CONSTANT);
 	                           _asn1_set_name($$,$1);
                                     _asn1_set_value($$,$3,strlen($3)+1);}
 ;
@@ -250,25 +305,25 @@ bit_element_list :  bit_element   {$$=$1;}
                                                        _asn1_set_right(_asn1_get_last_right($1),$3);}
 ;
 
-bit_string_def : BIT STRING    {$$=_asn1_add_static_node(TYPE_BIT_STRING);}
-               | BIT STRING size_def {$$=_asn1_add_static_node(TYPE_BIT_STRING|CONST_SIZE);}
+bit_string_def : BIT STRING    {$$=_asn1_add_static_node(ASN1_ETYPE_BIT_STRING);}
+               | BIT STRING size_def {$$=_asn1_add_static_node(ASN1_ETYPE_BIT_STRING|CONST_SIZE);}
                | BIT STRING'{'bit_element_list'}'
-                               {$$=_asn1_add_static_node(TYPE_BIT_STRING|CONST_LIST);
+                               {$$=_asn1_add_static_node(ASN1_ETYPE_BIT_STRING|CONST_LIST);
                                 _asn1_set_down($$,$4);}
 ;
 
 enumerated_def : ENUMERATED'{'bit_element_list'}'
-                               {$$=_asn1_add_static_node(TYPE_ENUMERATED|CONST_LIST);
+                               {$$=_asn1_add_static_node(ASN1_ETYPE_ENUMERATED|CONST_LIST);
                                 _asn1_set_down($$,$3);}
 ;
 
 
-object_def :  OBJECT STR_IDENTIFIER {$$=_asn1_add_static_node(TYPE_OBJECT_ID);}
+object_def :  OBJECT STR_IDENTIFIER {$$=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID);}
 ;
 
-type_assig_right: IDENTIFIER          {$$=_asn1_add_static_node(TYPE_IDENTIFIER);
+type_assig_right: IDENTIFIER          {$$=_asn1_add_static_node(ASN1_ETYPE_IDENTIFIER);
                                        _asn1_set_value($$,$1,strlen($1)+1);}
-                | IDENTIFIER size_def {$$=_asn1_add_static_node(TYPE_IDENTIFIER|CONST_SIZE);
+                | IDENTIFIER size_def {$$=_asn1_add_static_node(ASN1_ETYPE_IDENTIFIER|CONST_SIZE);
                                        _asn1_set_value($$,$1,strlen($1)+1);
                                        _asn1_set_down($$,$2);}
                 | integer_def         {$$=$1;}
@@ -278,12 +333,20 @@ type_assig_right: IDENTIFIER          {$$=_asn1_add_static_node(TYPE_IDENTIFIER)
                 | octet_string_def    {$$=$1;}
                 | bit_string_def      {$$=$1;}
                 | generalstring_def   {$$=$1;}
+                | numericstring_def   {$$=$1;}
+                | ia5string_def       {$$=$1;}
+                | teletexstring_def   {$$=$1;}
+                | printablestring_def {$$=$1;}
+                | universalstring_def {$$=$1;}
+                | bmpstring_def       {$$=$1;}
+                | utf8string_def      {$$=$1;}
+                | visiblestring_def   {$$=$1;}
                 | sequence_def        {$$=$1;}
                 | object_def          {$$=$1;}
                 | choise_def          {$$=$1;}
                 | any_def             {$$=$1;}
                 | set_def             {$$=$1;}
-                | TOKEN_NULL          {$$=_asn1_add_static_node(TYPE_NULL);}
+                | TOKEN_NULL          {$$=_asn1_add_static_node(ASN1_ETYPE_NULL);}
 ;
 
 type_assig_right_tag :   type_assig_right     {$$=$1;}
@@ -307,48 +370,50 @@ type_assig_list : type_assig                   {$$=$1;}
                                                 _asn1_set_right(_asn1_get_last_right($1),$3);}
 ;
 
-sequence_def : SEQUENCE'{'type_assig_list'}' {$$=_asn1_add_static_node(TYPE_SEQUENCE);
+sequence_def : SEQUENCE'{'type_assig_list'}' {$$=_asn1_add_static_node(ASN1_ETYPE_SEQUENCE);
                                               _asn1_set_down($$,$3);}
-   | SEQUENCE OF type_assig_right            {$$=_asn1_add_static_node(TYPE_SEQUENCE_OF);
+   | SEQUENCE OF type_assig_right            {$$=_asn1_add_static_node(ASN1_ETYPE_SEQUENCE_OF);
                                               _asn1_set_down($$,$3);}
-   | SEQUENCE size_def OF type_assig_right {$$=_asn1_add_static_node(TYPE_SEQUENCE_OF|CONST_SIZE);
+   | SEQUENCE size_def OF type_assig_right {$$=_asn1_add_static_node(ASN1_ETYPE_SEQUENCE_OF|CONST_SIZE);
                                             _asn1_set_right($2,$4);
                                             _asn1_set_down($$,$2);}
 ;
 
-set_def :  SET'{'type_assig_list'}' {$$=_asn1_add_static_node(TYPE_SET);
+set_def :  SET'{'type_assig_list'}' {$$=_asn1_add_static_node(ASN1_ETYPE_SET);
                                      _asn1_set_down($$,$3);}
-   | SET OF type_assig_right        {$$=_asn1_add_static_node(TYPE_SET_OF);
+   | SET OF type_assig_right        {$$=_asn1_add_static_node(ASN1_ETYPE_SET_OF);
                                      _asn1_set_down($$,$3);}
-   | SET size_def OF type_assig_right {$$=_asn1_add_static_node(TYPE_SET_OF|CONST_SIZE);
+   | SET size_def OF type_assig_right {$$=_asn1_add_static_node(ASN1_ETYPE_SET_OF|CONST_SIZE);
                                        _asn1_set_right($2,$4);
                                        _asn1_set_down($$,$2);}
 ;
 
-choise_def :   CHOICE'{'type_assig_list'}'  {$$=_asn1_add_static_node(TYPE_CHOICE);
+choise_def :   CHOICE'{'type_assig_list'}'  {$$=_asn1_add_static_node(ASN1_ETYPE_CHOICE);
                                              _asn1_set_down($$,$3);}
 ;
 
-any_def :  ANY                         {$$=_asn1_add_static_node(TYPE_ANY);}
-         | ANY DEFINED BY IDENTIFIER   {$$=_asn1_add_static_node(TYPE_ANY|CONST_DEFINED_BY);
-                                        _asn1_set_down($$,_asn1_add_static_node(TYPE_CONSTANT));
+any_def :  ANY                         {$$=_asn1_add_static_node(ASN1_ETYPE_ANY);}
+         | ANY DEFINED BY IDENTIFIER   {$$=_asn1_add_static_node(ASN1_ETYPE_ANY|CONST_DEFINED_BY);
+                                        _asn1_set_down($$,_asn1_add_static_node(ASN1_ETYPE_CONSTANT));
 	                                _asn1_set_name(_asn1_get_down($$),$4);}
 ;
 
 type_def : IDENTIFIER "::=" type_assig_right_tag  {$$=_asn1_set_name($3,$1);}
+              /* below should match: BMPString ::= [UNIVERSAL 30] IMPLICIT OCTET STRING etc*/
+              | error type_assig_right_tag {$$=_asn1_set_name($2, "");}
 ;
 
 constant_def :  IDENTIFIER OBJECT STR_IDENTIFIER "::=" '{'obj_constant_list'}'
-                        {$$=_asn1_add_static_node(TYPE_OBJECT_ID|CONST_ASSIGN);
+                        {$$=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID|CONST_ASSIGN);
                          _asn1_set_name($$,$1);
                          _asn1_set_down($$,$6);}
               | IDENTIFIER IDENTIFIER "::=" '{' obj_constant_list '}'
-                        {$$=_asn1_add_static_node(TYPE_OBJECT_ID|CONST_ASSIGN|CONST_1_PARAM);
+                        {$$=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID|CONST_ASSIGN|CONST_1_PARAM);
                          _asn1_set_name($$,$1);
                          _asn1_set_value($$,$2,strlen($2)+1);
                          _asn1_set_down($$,$5);}
               | IDENTIFIER INTEGER "::=" pos_neg_num
-                        {$$=_asn1_add_static_node(TYPE_INTEGER|CONST_ASSIGN);
+                        {$$=_asn1_add_static_node(ASN1_ETYPE_INTEGER|CONST_ASSIGN);
                          _asn1_set_name($$,$1);
                          _asn1_set_value($$,$4,strlen($4)+1);}
 ;
@@ -362,29 +427,29 @@ type_constant_list :   type_constant    {$$=$1;}
                                                           _asn1_set_right(_asn1_get_last_right($1),$2);}
 ;
 
-definitions_id  :  IDENTIFIER  '{' obj_constant_list '}' {$$=_asn1_add_static_node(TYPE_OBJECT_ID);
+definitions_id  :  IDENTIFIER  '{' obj_constant_list '}' {$$=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID);
                                                           _asn1_set_down($$,$3);
                                                           _asn1_set_name($$,$1);}
-                 | IDENTIFIER  '{' '}'                   {$$=_asn1_add_static_node(TYPE_OBJECT_ID);
+                 | IDENTIFIER  '{' '}'                   {$$=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID);
                                                           _asn1_set_name($$,$1);}
-                 | IDENTIFIER                            {$$=_asn1_add_static_node(TYPE_OBJECT_ID);
+                 | IDENTIFIER                            {$$=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID);
                                                           _asn1_set_name($$,$1);}
 ;
 
 /*
-identifier_list  :  IDENTIFIER  {$$=_asn1_add_static_node(TYPE_IDENTIFIER);
+identifier_list  :  IDENTIFIER  {$$=_asn1_add_static_node(ASN1_ETYPE_IDENTIFIER);
                                  _asn1_set_name($$,$1);}
                   | identifier_list IDENTIFIER
                                 {$$=$1;
-                                 _asn1_set_right(_asn1_get_last_right($$),_asn1_add_static_node(TYPE_IDENTIFIER));
+                                 _asn1_set_right(_asn1_get_last_right($$),_asn1_add_static_node(ASN1_ETYPE_IDENTIFIER));
                                  _asn1_set_name(_asn1_get_last_right($$),$2);}
 ;
 
 
 imports_def :    empty   {$$=NULL;}
               | IMPORTS identifier_list FROM IDENTIFIER obj_constant_list
-                        {$$=_asn1_add_static_node(TYPE_IMPORTS);
-                         _asn1_set_down($$,_asn1_add_static_node(TYPE_OBJECT_ID));
+                        {$$=_asn1_add_static_node(ASN1_ETYPE_IMPORTS);
+                         _asn1_set_down($$,_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID));
                          _asn1_set_name(_asn1_get_down($$),$4);
                          _asn1_set_down(_asn1_get_down($$),$5);
                          _asn1_set_right($$,$2);}
@@ -401,21 +466,25 @@ explicit_implicit :  EXPLICIT  {$$=CONST_EXPLICIT;}
 
 
 static const char *key_word[] = {
-  "::=","OPTIONAL","INTEGER","SIZE","OCTET","STRING"
-  ,"SEQUENCE","BIT","UNIVERSAL","PRIVATE","OPTIONAL"
-  ,"DEFAULT","CHOICE","OF","OBJECT","IDENTIFIER"
-  ,"BOOLEAN","TRUE","FALSE","APPLICATION","ANY","DEFINED"
-  ,"SET","BY","EXPLICIT","IMPLICIT","DEFINITIONS","TAGS"
-  ,"BEGIN","END","UTCTime","GeneralizedTime"
-  ,"GeneralString","FROM","IMPORTS","NULL","ENUMERATED"};
+  "::=","OPTIONAL","INTEGER","SIZE","OCTET","STRING",
+  "SEQUENCE","BIT","UNIVERSAL","PRIVATE","OPTIONAL",
+  "DEFAULT","CHOICE","OF","OBJECT","IDENTIFIER",
+  "BOOLEAN","TRUE","FALSE","APPLICATION","ANY","DEFINED",
+  "SET","BY","EXPLICIT","IMPLICIT","DEFINITIONS","TAGS",
+  "BEGIN","END","UTCTime","GeneralizedTime",
+  "GeneralString","FROM","IMPORTS","NULL","ENUMERATED",
+  "NumericString", "IA5String", "TeletexString", "PrintableString",
+  "UniversalString", "BMPString", "UTF8String", "VisibleString"};
+
 static const int key_word_token[] = {
-  ASSIG,OPTIONAL,INTEGER,SIZE,OCTET,STRING
-  ,SEQUENCE,BIT,UNIVERSAL,PRIVATE,OPTIONAL
-  ,DEFAULT,CHOICE,OF,OBJECT,STR_IDENTIFIER
-  ,BOOLEAN,ASN1_TRUE,ASN1_FALSE,APPLICATION,ANY,DEFINED
-  ,SET,BY,EXPLICIT,IMPLICIT,DEFINITIONS,TAGS
-  ,BEGIN,END,UTCTime,GeneralizedTime
-  ,GeneralString,FROM,IMPORTS,TOKEN_NULL,ENUMERATED};
+  ASSIG, OPTIONAL, INTEGER, SIZE, OCTET, STRING, SEQUENCE, BIT, UNIVERSAL,
+      PRIVATE, OPTIONAL, DEFAULT, CHOICE, OF, OBJECT, STR_IDENTIFIER,
+      BOOLEAN, ASN1_TRUE, ASN1_FALSE, APPLICATION, ANY, DEFINED, SET, BY,
+      EXPLICIT, IMPLICIT, DEFINITIONS, TAGS, BEGIN, END, UTCTime,
+      GeneralizedTime, GeneralString, FROM, IMPORTS, TOKEN_NULL,
+      ENUMERATED, NumericString, IA5String, TeletexString, PrintableString,
+      UniversalString, BMPString, UTF8String, VisibleString
+};
 
 /*************************************************************/
 /*  Function: _asn1_yylex                                    */
@@ -424,83 +493,98 @@ static const int key_word_token[] = {
 /*    Token identifier or ASCII code or 0(zero: End Of File) */
 /*************************************************************/
 static int
-_asn1_yylex()
+_asn1_yylex ()
 {
-  int c,counter=0,k,lastc;
-  char string[ASN1_MAX_NAME_SIZE+1]; /* will contain the next token */
+  int c, counter = 0, k, lastc;
+  char string[ASN1_MAX_NAME_SIZE + 1];  /* will contain the next token */
   size_t i;
 
-  while(1)
+  while (1)
     {
-    while((c=fgetc(file_asn1))==' ' || c=='\t' || c=='\n')
-      if(c=='\n') lineNumber++;
-
-    if(c==EOF){
-      strcpy(lastToken,"End Of File");
-      return 0;
-    }
-
-    if(c=='(' || c==')' || c=='[' || c==']' ||
-       c=='{' || c=='}' || c==',' || c=='.' ||
-       c=='+' || c=='|'){
-      lastToken[0]=c;lastToken[1]=0;
-      return c;
-    }
-    if(c=='-'){  /* Maybe the first '-' of a comment */
-      if((c=fgetc(file_asn1))!='-'){
-	ungetc(c,file_asn1);
-	lastToken[0]='-';lastToken[1]=0;
-	return '-';
-      }
-      else{ /* Comments */
-	lastc=0;
-	counter=0;
-	/* A comment finishes at the next double hypen or the end of line */
-	while((c=fgetc(file_asn1))!=EOF && c!='\n' &&
-	      (lastc!='-' || (lastc=='-' && c!='-')))
-	  lastc=c;
-	if(c==EOF){
-	  strcpy(lastToken,"End Of File");
-	  return 0;
-	}
-	else{
-	  if(c=='\n') lineNumber++;
-	  continue; /* next char, please! (repeat the search) */
-	}
-      }
-    }
-    string[counter++]=c;
-    /* Till the end of the token */
-    while(!((c=fgetc(file_asn1))==EOF || c==' '|| c=='\t' || c=='\n' ||
-	     c=='(' || c==')' || c=='[' || c==']' ||
-	     c=='{' || c=='}' || c==',' || c=='.'))
-      {
-	if(counter>=ASN1_MAX_NAME_SIZE){
-	  result_parse=ASN1_NAME_TOO_LONG;
-	  return 0;
-	}
-	string[counter++]=c;
-      }
-    ungetc(c,file_asn1);
-    string[counter]=0;
-    strcpy(lastToken,string);
-
-    /* Is STRING a number? */
-    for(k=0;k<counter;k++)
-      if(!isdigit(string[k])) break;
-    if(k>=counter)
-      {
-      strcpy(yylval.str,string);
-      return NUM; /* return the number */
-      }
-
-    /* Is STRING a keyword? */
-    for(i=0;i<(sizeof(key_word)/sizeof(char*));i++)
-      if(!strcmp(string,key_word[i])) return key_word_token[i];
-
-    /* STRING is an IDENTIFIER */
-    strcpy(yylval.str,string);
-    return IDENTIFIER;
+      while ((c = fgetc (file_asn1)) == ' ' || c == '\t' || c == '\n')
+        if (c == '\n')
+          line_number++;
+
+      if (c == EOF)
+        {
+          strcpy (last_token, "End Of File");
+          return 0;
+        }
+
+      if (c == '(' || c == ')' || c == '[' || c == ']' ||
+          c == '{' || c == '}' || c == ',' || c == '.' ||
+          c == '+' || c == '|')
+        {
+          last_token[0] = c;
+          last_token[1] = 0;
+          return c;
+        }
+      if (c == '-')
+        {                       /* Maybe the first '-' of a comment */
+          if ((c = fgetc (file_asn1)) != '-')
+            {
+              ungetc (c, file_asn1);
+              last_token[0] = '-';
+              last_token[1] = 0;
+              return '-';
+            }
+          else
+            {                   /* Comments */
+              lastc = 0;
+              counter = 0;
+              /* A comment finishes at the next double hypen or the end of line */
+              while ((c = fgetc (file_asn1)) != EOF && c != '\n' &&
+                     (lastc != '-' || (lastc == '-' && c != '-')))
+                lastc = c;
+              if (c == EOF)
+                {
+                  strcpy (last_token, "End Of File");
+                  return 0;
+                }
+              else
+                {
+                  if (c == '\n')
+                    line_number++;
+                  continue;     /* next char, please! (repeat the search) */
+                }
+            }
+        }
+      string[counter++] = c;
+      /* Till the end of the token */
+      while (!
+             ((c = fgetc (file_asn1)) == EOF || c == ' ' || c == '\t'
+              || c == '\n' || c == '(' || c == ')' || c == '[' || c == ']'
+              || c == '{' || c == '}' || c == ',' || c == '.'))
+        {
+          if (counter >= ASN1_MAX_NAME_SIZE)
+            {
+              result_parse = ASN1_NAME_TOO_LONG;
+              return 0;
+            }
+          string[counter++] = c;
+        }
+      ungetc (c, file_asn1);
+      string[counter] = 0;
+      strcpy (last_token, string);
+
+      /* Is STRING a number? */
+      for (k = 0; k < counter; k++)
+        if (!isdigit (string[k]))
+          break;
+      if (k >= counter)
+        {
+          strcpy (yylval.str, string);
+          return NUM;           /* return the number */
+        }
+
+      /* Is STRING a keyword? */
+      for (i = 0; i < (sizeof (key_word) / sizeof (char *)); i++)
+        if (!strcmp (string, key_word[i]))
+          return key_word_token[i];
+
+      /* STRING is an IDENTIFIER */
+      strcpy (yylval.str, string);
+      return IDENTIFIER;
     }
 }
 
@@ -510,129 +594,118 @@ _asn1_yylex()
 /*    error.                                                 */
 /*  Parameters:                                              */
 /*    error : error to describe.                             */
-/*    errorDescription: string that will contain the         */
+/*    error_desc: string that will contain the         */
 /*                      description.                         */
 /*************************************************************/
 static void
-_asn1_create_errorDescription(int error,char *errorDescription)
+_asn1_create_errorDescription (int error, char *error_desc)
 {
-  switch(error){
-  case ASN1_SUCCESS: case ASN1_FILE_NOT_FOUND:
-    if (errorDescription!=NULL) errorDescription[0]=0;
-    break;
-  case ASN1_SYNTAX_ERROR:
-    if (errorDescription!=NULL) {
-	strcpy(errorDescription,fileName);
-	strcat(errorDescription,":");
-	_asn1_ltostr(lineNumber,errorDescription+strlen(fileName)+1);
-	strcat(errorDescription,": parse error near '");
-	strcat(errorDescription,lastToken);
-	strcat(errorDescription,"'");
-    }
-    break;
-  case ASN1_NAME_TOO_LONG:
-    if (errorDescription!=NULL) {
-       strcpy(errorDescription,fileName);
-       strcat(errorDescription,":");
-       _asn1_ltostr(lineNumber,errorDescription+strlen(fileName)+1);
-       strcat(errorDescription,": name too long (more than ");
-       _asn1_ltostr(ASN1_MAX_NAME_SIZE,errorDescription+strlen(errorDescription));
-       strcat(errorDescription," characters)");
-    }
-    break;
-  case ASN1_IDENTIFIER_NOT_FOUND:
-    if (errorDescription!=NULL) {
-       strcpy(errorDescription,fileName);
-       strcat(errorDescription,":");
-       strcat(errorDescription,": identifier '");
-       strcat(errorDescription,_asn1_identifierMissing);
-       strcat(errorDescription,"' not found");
+  if (error_desc == NULL)
+    return;
+
+
+  switch (error)
+    {
+    case ASN1_SYNTAX_ERROR:
+      strcpy(error_desc, last_error);
+      break;
+    case ASN1_NAME_TOO_LONG:
+      snprintf (error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
+                "%s:%u: name too long (more than %u characters)", file_name,
+                line_number, ASN1_MAX_NAME_SIZE);
+      break;
+    case ASN1_IDENTIFIER_NOT_FOUND:
+      snprintf (error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
+                "%s:: identifier '%s' not found", file_name,
+                _asn1_identifierMissing);
+      break;
+    default:
+      error_desc[0] = 0;
+      break;
     }
-    break;
-  default:
-    if (errorDescription!=NULL) errorDescription[0]=0;
-    break;
-  }
 
 }
 
 /**
  * asn1_parser2tree:
- * @file_name: specify the path and the name of file that contains
+ * @file: specify the path and the name of file that contains
  *   ASN.1 declarations.
  * @definitions: return the pointer to the structure created from
- *   "file_name" ASN.1 declarations.
- * @errorDescription: return the error description or an empty
+ *   "file" ASN.1 declarations.
+ * @error_desc: return the error description or an empty
  * string if success.
  *
  * Function used to start the parse algorithm.  Creates the structures
- * needed to manage the definitions included in @file_name file.
+ * needed to manage the definitions included in @file file.
  *
  * Returns: %ASN1_SUCCESS if the file has a correct syntax and every
  *   identifier is known, %ASN1_ELEMENT_NOT_EMPTY if @definitions not
  *   %NULL, %ASN1_FILE_NOT_FOUND if an error occured while
- *   opening @file_name, %ASN1_SYNTAX_ERROR if the syntax is not
+ *   opening @file, %ASN1_SYNTAX_ERROR if the syntax is not
  *   correct, %ASN1_IDENTIFIER_NOT_FOUND if in the file there is an
  *   identifier that is not defined, %ASN1_NAME_TOO_LONG if in the
  *   file there is an identifier whith more than %ASN1_MAX_NAME_SIZE
  *   characters.
  **/
 int
-asn1_parser2tree(const char *file_name, asn1_node *definitions,
-		 char *errorDescription) 
+asn1_parser2tree (const char *file, asn1_node * definitions,
+                  char *error_desc)
 {
 
-  p_tree=NULL;
+  p_tree = NULL;
 
-  if(*definitions != NULL)
+  if (*definitions != NULL)
     return ASN1_ELEMENT_NOT_EMPTY;
 
-  *definitions=NULL;
+  *definitions = NULL;
 
-  fileName = file_name;
+  file_name = file;
 
   /* open the file to parse */
-  file_asn1=fopen(file_name,"r");
-
-  if(file_asn1==NULL){
-    result_parse=ASN1_FILE_NOT_FOUND;
-  }
-  else{
-    result_parse=ASN1_SUCCESS;
-
-    lineNumber=1;
-    yyparse();
-
-    fclose(file_asn1);
-
-    if(result_parse==ASN1_SUCCESS){ /* syntax OK */
-      /* set IMPLICIT or EXPLICIT property */
-      _asn1_set_default_tag(p_tree);
-      /* set CONST_SET and CONST_NOT_USED */
-      _asn1_type_set_config(p_tree);
-      /* check the identifier definitions */
-      result_parse=_asn1_check_identifier(p_tree);
-      if(result_parse==ASN1_SUCCESS){ /* all identifier defined */
-	/* Delete the list and keep the ASN1 structure */
-	_asn1_delete_list();
-	/* Convert into DER coding the value assign to INTEGER constants */
-	_asn1_change_integer_value(p_tree);
-	/* Expand the IDs of OBJECT IDENTIFIER constants */
-	_asn1_expand_object_id(p_tree);
-
-	*definitions=p_tree;
-      }
-      else /* some identifiers not defined */
-	/* Delete the list and the ASN1 structure */
-	_asn1_delete_list_and_nodes();
+  file_asn1 = fopen (file, "r");
+
+  if (file_asn1 == NULL)
+    {
+      result_parse = ASN1_FILE_NOT_FOUND;
+    }
+  else
+    {
+      result_parse = ASN1_SUCCESS;
+
+      line_number = 1;
+      yyparse ();
+
+      fclose (file_asn1);
+
+      if (result_parse == ASN1_SUCCESS)
+        {                       /* syntax OK */
+          /* set IMPLICIT or EXPLICIT property */
+          _asn1_set_default_tag (p_tree);
+          /* set CONST_SET and CONST_NOT_USED */
+          _asn1_type_set_config (p_tree);
+          /* check the identifier definitions */
+          result_parse = _asn1_check_identifier (p_tree);
+          if (result_parse == ASN1_SUCCESS)
+            {                   /* all identifier defined */
+              /* Delete the list and keep the ASN1 structure */
+              _asn1_delete_list ();
+              /* Convert into DER coding the value assign to INTEGER constants */
+              _asn1_change_integer_value (p_tree);
+              /* Expand the IDs of OBJECT IDENTIFIER constants */
+              _asn1_expand_object_id (p_tree);
+
+              *definitions = p_tree;
+            }
+          else                  /* some identifiers not defined */
+            /* Delete the list and the ASN1 structure */
+            _asn1_delete_list_and_nodes ();
+        }
+      else                      /* syntax error */
+        /* Delete the list and the ASN1 structure */
+        _asn1_delete_list_and_nodes ();
     }
-    else  /* syntax error */
-      /* Delete the list and the ASN1 structure */
-      _asn1_delete_list_and_nodes();
-  }
 
-  if (errorDescription!=NULL)
-	_asn1_create_errorDescription(result_parse,errorDescription);
+  _asn1_create_errorDescription (result_parse, error_desc);
 
   return result_parse;
 }
@@ -644,7 +717,7 @@ asn1_parser2tree(const char *file_name, asn1_node *definitions,
  * @outputFileName: specify the path and the name of file that will
  *   contain the C vector definition.
  * @vectorName: specify the name of the C vector.
- * @errorDescription : return the error description or an empty
+ * @error_desc : return the error description or an empty
  *   string if success.
  *
  * Function that generates a C structure from an ASN1 file.  Creates a
@@ -662,98 +735,110 @@ asn1_parser2tree(const char *file_name, asn1_node *definitions,
  *   file there is an identifier whith more than %ASN1_MAX_NAME_SIZE
  *   characters.
  **/
-int asn1_parser2array(const char *inputFileName,const char *outputFileName,
-		      const char *vectorName,char *errorDescription){
-  char *file_out_name=NULL;
-  char *vector_name=NULL;
-  const char *char_p,*slash_p,*dot_p;
+int
+asn1_parser2array (const char *inputFileName, const char *outputFileName,
+                   const char *vectorName, char *error_desc)
+{
+  char *file_out_name = NULL;
+  char *vector_name = NULL;
+  const char *char_p, *slash_p, *dot_p;
 
-  p_tree=NULL;
+  p_tree = NULL;
 
-  fileName = inputFileName;
+  file_name = inputFileName;
 
   /* open the file to parse */
-  file_asn1=fopen(inputFileName,"r");
-
-  if(file_asn1==NULL)
-    result_parse=ASN1_FILE_NOT_FOUND;
-  else{
-    result_parse=ASN1_SUCCESS;
-
-    lineNumber=1;
-    yyparse();
-
-    fclose(file_asn1);
-
-    if(result_parse==ASN1_SUCCESS){ /* syntax OK */
-      /* set IMPLICIT or EXPLICIT property */
-      _asn1_set_default_tag(p_tree);
-      /* set CONST_SET and CONST_NOT_USED */
-      _asn1_type_set_config(p_tree);
-      /* check the identifier definitions */
-      result_parse=_asn1_check_identifier(p_tree);
-
-      if(result_parse==ASN1_SUCCESS){ /* all identifier defined */
-
-	/* searching the last '/' and '.' in inputFileName */
-	char_p=inputFileName;
-	slash_p=inputFileName;
-	while((char_p=strchr(char_p,'/'))){
-	  char_p++;
-	  slash_p=char_p;
-	}
-
-	char_p=slash_p;
-	dot_p=inputFileName+strlen(inputFileName);
-
-	while((char_p=strchr(char_p,'.'))){
-	  dot_p=char_p;
-	  char_p++;
-	}
-
-	if(outputFileName == NULL){
-	  /* file_out_name = inputFileName + _asn1_tab.c */
-	  file_out_name=malloc(dot_p-inputFileName+1+
-				       strlen("_asn1_tab.c"));
-	  memcpy(file_out_name,inputFileName,dot_p-inputFileName);
-	  file_out_name[dot_p-inputFileName]=0;
-	  strcat(file_out_name,"_asn1_tab.c");
-	}
-	else{
-	  /* file_out_name = inputFileName */
-	  file_out_name=(char *)malloc(strlen(outputFileName)+1);
-	  strcpy(file_out_name,outputFileName);
-	}
-
-	if(vectorName == NULL){
-	  /* vector_name = file name + _asn1_tab */
-	  vector_name=malloc(dot_p-slash_p+1+
-				     strlen("_asn1_tab"));
-	  memcpy(vector_name,slash_p,dot_p-slash_p);
-	  vector_name[dot_p-slash_p]=0;
-	  strcat(vector_name,"_asn1_tab");
-	}
-	else{
-	  /* vector_name = vectorName */
-	  vector_name=(char *)malloc(strlen(vectorName)+1);
-	  strcpy(vector_name,vectorName);
-	}
-
-	/* Save structure in a file */
-	_asn1_create_static_structure(p_tree,
-				      file_out_name,vector_name);
-
-	free(file_out_name);
-	free(vector_name);
-      } /* result == OK */
-    }   /* result == OK */
-
-    /* Delete the list and the ASN1 structure */
-    _asn1_delete_list_and_nodes();
-  } /* inputFile exist */
-
-  if (errorDescription!=NULL)
-	_asn1_create_errorDescription(result_parse,errorDescription);
+  file_asn1 = fopen (inputFileName, "r");
+
+  if (file_asn1 == NULL)
+    result_parse = ASN1_FILE_NOT_FOUND;
+  else
+    {
+      result_parse = ASN1_SUCCESS;
+
+      line_number = 1;
+      yyparse ();
+
+      fclose (file_asn1);
+
+      if (result_parse == ASN1_SUCCESS)
+        {                       /* syntax OK */
+          /* set IMPLICIT or EXPLICIT property */
+          _asn1_set_default_tag (p_tree);
+          /* set CONST_SET and CONST_NOT_USED */
+          _asn1_type_set_config (p_tree);
+          /* check the identifier definitions */
+          result_parse = _asn1_check_identifier (p_tree);
+
+          if (result_parse == ASN1_SUCCESS)
+            {                   /* all identifier defined */
+
+              /* searching the last '/' and '.' in inputFileName */
+              char_p = inputFileName;
+              slash_p = inputFileName;
+              while ((char_p = strchr (char_p, '/')))
+                {
+                  char_p++;
+                  slash_p = char_p;
+                }
+
+              char_p = slash_p;
+              dot_p = inputFileName + strlen (inputFileName);
+
+              while ((char_p = strchr (char_p, '.')))
+                {
+                  dot_p = char_p;
+                  char_p++;
+                }
+
+              if (outputFileName == NULL)
+                {
+                  /* file_out_name = inputFileName + _asn1_tab.c */
+                  file_out_name = malloc (dot_p - inputFileName + 1 +
+                                          strlen ("_asn1_tab.c"));
+                  memcpy (file_out_name, inputFileName,
+                          dot_p - inputFileName);
+                  file_out_name[dot_p - inputFileName] = 0;
+                  strcat (file_out_name, "_asn1_tab.c");
+                }
+              else
+                {
+                  /* file_out_name = inputFileName */
+                  file_out_name =
+                      (char *) malloc (strlen (outputFileName) + 1);
+                  strcpy (file_out_name, outputFileName);
+                }
+
+              if (vectorName == NULL)
+                {
+                  /* vector_name = file name + _asn1_tab */
+                  vector_name = malloc (dot_p - slash_p + 1 +
+                                        strlen ("_asn1_tab"));
+                  memcpy (vector_name, slash_p, dot_p - slash_p);
+                  vector_name[dot_p - slash_p] = 0;
+                  strcat (vector_name, "_asn1_tab");
+                }
+              else
+                {
+                  /* vector_name = vectorName */
+                  vector_name = (char *) malloc (strlen (vectorName) + 1);
+                  strcpy (vector_name, vectorName);
+                }
+
+              /* Save structure in a file */
+              _asn1_create_static_structure (p_tree,
+                                             file_out_name, vector_name);
+
+              free (file_out_name);
+              free (vector_name);
+            }                   /* result == OK */
+        }                       /* result == OK */
+
+      /* Delete the list and the ASN1 structure */
+      _asn1_delete_list_and_nodes ();
+    }                           /* inputFile exist */
+
+  _asn1_create_errorDescription (result_parse, error_desc);
 
   return result_parse;
 }
@@ -766,17 +851,34 @@ int asn1_parser2array(const char *inputFileName,const char *outputFileName,
 /*  Return: int                                              */
 /*                                                           */
 /*************************************************************/
-static int _asn1_yyerror (const char *s)
+static void
+_asn1_yyerror (const char *s)
 {
   /* Sends the error description to the std_out */
 
-#if 0
-  printf("_asn1_yyerror:%s:%ld: %s (Last Token:'%s')\n",fileName,
-	 lineNumber,s,lastToken);
-#endif
+  if (strcmp (last_token, "VisibleString") == 0 ||
+      strcmp (last_token, "PrintableString") == 0 ||
+      strcmp (last_token, "UniversalString") == 0 ||
+      strcmp (last_token, "IA5String") == 0 ||
+      strcmp (last_token, "UTF8String") == 0 ||
+      strcmp (last_token, "NumericString") == 0 ||
+      strcmp (last_token, "TeletexString") == 0 ||
+      strcmp (last_token, "BMPString") == 0)
+    {
+      fprintf(stderr, 
+               "%s:%ld: Warning: %s is a built-in ASN.1 type.\n",
+               file_name, line_number, last_token);
+      return;
+    }
+
 
-  if(result_parse!=ASN1_NAME_TOO_LONG)
-    result_parse=ASN1_SYNTAX_ERROR;
+  if (result_parse != ASN1_NAME_TOO_LONG)
+    {
+      snprintf (last_error, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
+                "%s:%ld: Error: %s near '%s'", file_name,
+                line_number, s, last_token);
+      result_parse = ASN1_SYNTAX_ERROR;
+    }
 
-  return 0;
+  return;
 }
diff --git a/lib/coding.c b/lib/coding.c
index 581ef96..af5c1b7 100644
--- a/lib/coding.c
+++ b/lib/coding.c
@@ -394,7 +394,7 @@ _asn1_complete_explicit_tag (asn1_node node, unsigned char *der,
 	p = p->right;
       while (p && p != node->down->left)
 	{
-	  if (type_field (p->type) == TYPE_TAG)
+	  if (type_field (p->type) == ASN1_ETYPE_TAG)
 	    {
 	      if (p->type & CONST_EXPLICIT)
 		{
@@ -429,6 +429,29 @@ _asn1_complete_explicit_tag (asn1_node node, unsigned char *der,
   return ASN1_SUCCESS;
 }
 
+tag_and_class_st _asn1_tags[] =
+{
+  [ASN1_ETYPE_GENERALSTRING] = {ASN1_TAG_GENERALSTRING, ASN1_CLASS_UNIVERSAL},
+  [ASN1_ETYPE_NUMERICSTRING] = {ASN1_TAG_NUMERICSTRING, ASN1_CLASS_UNIVERSAL},
+  [ASN1_ETYPE_IA5STRING] =     {ASN1_TAG_IA5STRING, ASN1_CLASS_UNIVERSAL},
+  [ASN1_ETYPE_TELETEXSTRING] = {ASN1_TAG_TELETEXSTRING, ASN1_CLASS_UNIVERSAL},
+  [ASN1_ETYPE_PRINTABLESTRING] = {ASN1_TAG_PRINTABLESTRING, ASN1_CLASS_UNIVERSAL},
+  [ASN1_ETYPE_UNIVERSALSTRING] = {ASN1_TAG_UNIVERSALSTRING, ASN1_CLASS_UNIVERSAL},
+  [ASN1_ETYPE_BMPSTRING] =     {ASN1_TAG_BMPSTRING, ASN1_CLASS_UNIVERSAL},
+  [ASN1_ETYPE_UTF8STRING] =    {ASN1_TAG_UTF8STRING, ASN1_CLASS_UNIVERSAL},
+  [ASN1_ETYPE_VISIBLESTRING] = {ASN1_TAG_VISIBLESTRING, ASN1_CLASS_UNIVERSAL},
+  [ASN1_ETYPE_OCTET_STRING] = {ASN1_TAG_OCTET_STRING, ASN1_CLASS_UNIVERSAL},
+  [ASN1_ETYPE_BIT_STRING] = {ASN1_TAG_BIT_STRING, ASN1_CLASS_UNIVERSAL},
+  [ASN1_ETYPE_OBJECT_ID] =  {ASN1_TAG_OBJECT_ID, ASN1_CLASS_UNIVERSAL},
+  [ASN1_ETYPE_NULL] =       {ASN1_TAG_NULL, ASN1_CLASS_UNIVERSAL},
+  [ASN1_ETYPE_BOOLEAN] =    {ASN1_TAG_BOOLEAN, ASN1_CLASS_UNIVERSAL},
+  [ASN1_ETYPE_INTEGER] =    {ASN1_TAG_INTEGER, ASN1_CLASS_UNIVERSAL},
+  [ASN1_ETYPE_ENUMERATED] = {ASN1_TAG_ENUMERATED, ASN1_CLASS_UNIVERSAL},
+  [ASN1_ETYPE_SEQUENCE] =   {ASN1_TAG_SEQUENCE, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED},
+  [ASN1_ETYPE_SEQUENCE_OF] ={ASN1_TAG_SEQUENCE, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED},
+  [ASN1_ETYPE_SET] =        {ASN1_TAG_SET, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED},
+  [ASN1_ETYPE_SET_OF] =     {ASN1_TAG_SET, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED},
+};
 
 /******************************************************/
 /* Function : _asn1_insert_tag_der                    */
@@ -462,7 +485,7 @@ _asn1_insert_tag_der (asn1_node node, unsigned char *der, int *counter,
       p = node->down;
       while (p)
 	{
-	  if (type_field (p->type) == TYPE_TAG)
+	  if (type_field (p->type) == ASN1_ETYPE_TAG)
 	    {
 	      if (p->type & CONST_APPLICATION)
 		class = ASN1_CLASS_APPLICATION;
@@ -497,10 +520,10 @@ _asn1_insert_tag_der (asn1_node node, unsigned char *der, int *counter,
 		{		/* CONST_IMPLICIT */
 		  if (!is_tag_implicit)
 		    {
-		      if ((type_field (node->type) == TYPE_SEQUENCE) ||
-			  (type_field (node->type) == TYPE_SEQUENCE_OF) ||
-			  (type_field (node->type) == TYPE_SET) ||
-			  (type_field (node->type) == TYPE_SET_OF))
+		      if ((type_field (node->type) == ASN1_ETYPE_SEQUENCE) ||
+			  (type_field (node->type) == ASN1_ETYPE_SEQUENCE_OF) ||
+			  (type_field (node->type) == ASN1_ETYPE_SET) ||
+			  (type_field (node->type) == ASN1_ETYPE_SET_OF))
 			class |= ASN1_CLASS_STRUCTURED;
 		      class_implicit = class;
 		      tag_implicit = _asn1_strtoul (p->value, NULL, 10);
@@ -518,29 +541,10 @@ _asn1_insert_tag_der (asn1_node node, unsigned char *der, int *counter,
     }
   else
     {
-      switch (type_field (node->type))
+      unsigned type = type_field (node->type);
+      switch (type)
 	{
-	case TYPE_NULL:
-	  _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_NULL, tag_der,
-			 &tag_len);
-	  break;
-	case TYPE_BOOLEAN:
-	  _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_BOOLEAN, tag_der,
-			 &tag_len);
-	  break;
-	case TYPE_INTEGER:
-	  _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_INTEGER, tag_der,
-			 &tag_len);
-	  break;
-	case TYPE_ENUMERATED:
-	  _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_ENUMERATED, tag_der,
-			 &tag_len);
-	  break;
-	case TYPE_OBJECT_ID:
-	  _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_OBJECT_ID, tag_der,
-			 &tag_len);
-	  break;
-	case TYPE_TIME:
+	case ASN1_ETYPE_TIME:
 	  if (node->type & CONST_UTC)
 	    {
 	      _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_UTCTime, tag_der,
@@ -550,35 +554,32 @@ _asn1_insert_tag_der (asn1_node node, unsigned char *der, int *counter,
 	    _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_GENERALIZEDTime,
 			   tag_der, &tag_len);
 	  break;
-	case TYPE_OCTET_STRING:
-	  _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_OCTET_STRING, tag_der,
-			 &tag_len);
-	  break;
-	case TYPE_GENERALSTRING:
-	  _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_GENERALSTRING,
+	case ASN1_ETYPE_OBJECT_ID:
+	case ASN1_ETYPE_OCTET_STRING:
+	case ASN1_ETYPE_GENERALSTRING:
+	case ASN1_ETYPE_NUMERICSTRING:
+	case ASN1_ETYPE_IA5STRING:
+	case ASN1_ETYPE_TELETEXSTRING:
+	case ASN1_ETYPE_PRINTABLESTRING:
+	case ASN1_ETYPE_UNIVERSALSTRING:
+	case ASN1_ETYPE_BMPSTRING:
+	case ASN1_ETYPE_UTF8STRING:
+	case ASN1_ETYPE_VISIBLESTRING:
+	case ASN1_ETYPE_BIT_STRING:
+	case ASN1_ETYPE_NULL:
+	case ASN1_ETYPE_BOOLEAN:
+	case ASN1_ETYPE_INTEGER:
+	case ASN1_ETYPE_ENUMERATED:
+	case ASN1_ETYPE_SEQUENCE:
+	case ASN1_ETYPE_SEQUENCE_OF:
+	case ASN1_ETYPE_SET:
+	case ASN1_ETYPE_SET_OF:
+	  _asn1_tag_der (_asn1_tags[type].class, _asn1_tags[type].tag,
 			 tag_der, &tag_len);
 	  break;
-	case TYPE_BIT_STRING:
-	  _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_BIT_STRING, tag_der,
-			 &tag_len);
-	  break;
-	case TYPE_SEQUENCE:
-	case TYPE_SEQUENCE_OF:
-	  _asn1_tag_der (ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED,
-			 ASN1_TAG_SEQUENCE, tag_der, &tag_len);
-	  break;
-	case TYPE_SET:
-	case TYPE_SET_OF:
-	  _asn1_tag_der (ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED,
-			 ASN1_TAG_SET, tag_der, &tag_len);
-	  break;
-	case TYPE_TAG:
-	  tag_len = 0;
-	  break;
-	case TYPE_CHOICE:
-	  tag_len = 0;
-	  break;
-	case TYPE_ANY:
+	case ASN1_ETYPE_TAG:
+	case ASN1_ETYPE_CHOICE:
+	case ASN1_ETYPE_ANY:
 	  tag_len = 0;
 	  break;
 	default:
@@ -624,12 +625,12 @@ _asn1_ordering_set (unsigned char *der, int der_len, asn1_node node)
 
   counter = 0;
 
-  if (type_field (node->type) != TYPE_SET)
+  if (type_field (node->type) != ASN1_ETYPE_SET)
     return;
 
   p = node->down;
-  while ((type_field (p->type) == TYPE_TAG)
-	 || (type_field (p->type) == TYPE_SIZE))
+  while ((type_field (p->type) == ASN1_ETYPE_TAG)
+	 || (type_field (p->type) == ASN1_ETYPE_SIZE))
     p = p->right;
 
   if ((p == NULL) || (p->right == NULL))
@@ -737,12 +738,12 @@ _asn1_ordering_set_of (unsigned char *der, int der_len, asn1_node node)
 
   counter = 0;
 
-  if (type_field (node->type) != TYPE_SET_OF)
+  if (type_field (node->type) != ASN1_ETYPE_SET_OF)
     return;
 
   p = node->down;
-  while ((type_field (p->type) == TYPE_TAG)
-	 || (type_field (p->type) == TYPE_SIZE))
+  while ((type_field (p->type) == ASN1_ETYPE_TAG)
+	 || (type_field (p->type) == ASN1_ETYPE_SIZE))
     p = p->right;
   p = p->right;
 
@@ -906,14 +907,14 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
 	}
       switch (type_field (p->type))
 	{
-	case TYPE_NULL:
+	case ASN1_ETYPE_NULL:
 	  max_len--;
 	  if (max_len >= 0)
 	    der[counter] = 0;
 	  counter++;
 	  move = RIGHT;
 	  break;
-	case TYPE_BOOLEAN:
+	case ASN1_ETYPE_BOOLEAN:
 	  if ((p->type & CONST_DEFAULT) && (p->value == NULL))
 	    {
 	      counter = counter_old;
@@ -942,8 +943,8 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
 	    }
 	  move = RIGHT;
 	  break;
-	case TYPE_INTEGER:
-	case TYPE_ENUMERATED:
+	case ASN1_ETYPE_INTEGER:
+	case ASN1_ETYPE_ENUMERATED:
 	  if ((p->type & CONST_DEFAULT) && (p->value == NULL))
 	    {
 	      counter = counter_old;
@@ -971,7 +972,7 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
 	    }
 	  move = RIGHT;
 	  break;
-	case TYPE_OBJECT_ID:
+	case ASN1_ETYPE_OBJECT_ID:
 	  if ((p->type & CONST_DEFAULT) && (p->value == NULL))
 	    {
 	      counter = counter_old;
@@ -996,7 +997,7 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
 	    }
 	  move = RIGHT;
 	  break;
-	case TYPE_TIME:
+	case ASN1_ETYPE_TIME:
 	  if (p->value == NULL)
 	    {
 	      _asn1_error_description_value_not_found (p, ErrorDescription);
@@ -1012,45 +1013,17 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
 	  counter += len2;
 	  move = RIGHT;
 	  break;
-	case TYPE_OCTET_STRING:
-	  if (p->value == NULL)
-	    {
-	      _asn1_error_description_value_not_found (p, ErrorDescription);
-	      err = ASN1_VALUE_NOT_FOUND;
-	      goto error;
-	    }
-	  len2 = asn1_get_length_der (p->value, p->value_len, &len3);
-	  if (len2 < 0)
-	    {
-	      err = ASN1_DER_ERROR;
-	      goto error;
-	    }
-	  max_len -= len2 + len3;
-	  if (max_len >= 0)
-	    memcpy (der + counter, p->value, len3 + len2);
-	  counter += len3 + len2;
-	  move = RIGHT;
-	  break;
-	case TYPE_GENERALSTRING:
-	  if (p->value == NULL)
-	    {
-	      _asn1_error_description_value_not_found (p, ErrorDescription);
-	      err = ASN1_VALUE_NOT_FOUND;
-	      goto error;
-	    }
-	  len2 = asn1_get_length_der (p->value, p->value_len, &len3);
-	  if (len2 < 0)
-	    {
-	      err = ASN1_DER_ERROR;
-	      goto error;
-	    }
-	  max_len -= len2 + len3;
-	  if (max_len >= 0)
-	    memcpy (der + counter, p->value, len3 + len2);
-	  counter += len3 + len2;
-	  move = RIGHT;
-	  break;
-	case TYPE_BIT_STRING:
+	case ASN1_ETYPE_OCTET_STRING:
+	case ASN1_ETYPE_GENERALSTRING:
+	case ASN1_ETYPE_NUMERICSTRING:
+	case ASN1_ETYPE_IA5STRING:
+	case ASN1_ETYPE_TELETEXSTRING:
+	case ASN1_ETYPE_PRINTABLESTRING:
+	case ASN1_ETYPE_UNIVERSALSTRING:
+	case ASN1_ETYPE_BMPSTRING:
+	case ASN1_ETYPE_UTF8STRING:
+	case ASN1_ETYPE_VISIBLESTRING:
+	case ASN1_ETYPE_BIT_STRING:
 	  if (p->value == NULL)
 	    {
 	      _asn1_error_description_value_not_found (p, ErrorDescription);
@@ -1069,8 +1042,8 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
 	  counter += len3 + len2;
 	  move = RIGHT;
 	  break;
-	case TYPE_SEQUENCE:
-	case TYPE_SET:
+	case ASN1_ETYPE_SEQUENCE:
+	case ASN1_ETYPE_SET:
 	  if (move != UP)
 	    {
 	      _asn1_ltostr (counter, (char *) temp);
@@ -1085,7 +1058,7 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
 	      else
 		{
 		  p2 = p->down;
-		  while (p2 && (type_field (p2->type) == TYPE_TAG))
+		  while (p2 && (type_field (p2->type) == ASN1_ETYPE_TAG))
 		    p2 = p2->right;
 		  if (p2)
 		    {
@@ -1101,7 +1074,7 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
 	    {			/* move==UP */
 	      len2 = _asn1_strtol (p->value, NULL, 10);
 	      _asn1_set_value (p, NULL, 0);
-	      if ((type_field (p->type) == TYPE_SET) && (max_len >= 0))
+	      if ((type_field (p->type) == ASN1_ETYPE_SET) && (max_len >= 0))
 		_asn1_ordering_set (der + len2, max_len - len2, p);
 	      asn1_length_der (counter - len2, temp, &len3);
 	      max_len -= len3;
@@ -1114,8 +1087,8 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
 	      move = RIGHT;
 	    }
 	  break;
-	case TYPE_SEQUENCE_OF:
-	case TYPE_SET_OF:
+	case ASN1_ETYPE_SEQUENCE_OF:
+	case ASN1_ETYPE_SET_OF:
 	  if (move != UP)
 	    {
 	      _asn1_ltostr (counter, (char *) temp);
@@ -1124,8 +1097,8 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
 	      if (tlen > 0)
 		_asn1_set_value (p, temp, tlen + 1);
 	      p = p->down;
-	      while ((type_field (p->type) == TYPE_TAG)
-		     || (type_field (p->type) == TYPE_SIZE))
+	      while ((type_field (p->type) == ASN1_ETYPE_TAG)
+		     || (type_field (p->type) == ASN1_ETYPE_SIZE))
 		p = p->right;
 	      if (p->right)
 		{
@@ -1141,7 +1114,7 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
 	    {
 	      len2 = _asn1_strtol (p->value, NULL, 10);
 	      _asn1_set_value (p, NULL, 0);
-	      if ((type_field (p->type) == TYPE_SET_OF)
+	      if ((type_field (p->type) == ASN1_ETYPE_SET_OF)
 		  && (max_len - len2 > 0))
 		{
 		  _asn1_ordering_set_of (der + len2, max_len - len2, p);
@@ -1157,7 +1130,7 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
 	      move = RIGHT;
 	    }
 	  break;
-	case TYPE_ANY:
+	case ASN1_ETYPE_ANY:
 	  if (p->value == NULL)
 	    {
 	      _asn1_error_description_value_not_found (p, ErrorDescription);
diff --git a/lib/decoding.c b/lib/decoding.c
index 79766a1..5a844b8 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -387,7 +387,7 @@ _asn1_extract_tag_der (asn1_node node, const unsigned char *der, int der_len,
       p = node->down;
       while (p)
 	{
-	  if (type_field (p->type) == TYPE_TAG)
+	  if (type_field (p->type) == ASN1_ETYPE_TAG)
 	    {
 	      if (p->type & CONST_APPLICATION)
 		class2 = ASN1_CLASS_APPLICATION;
@@ -436,10 +436,10 @@ _asn1_extract_tag_der (asn1_node node, const unsigned char *der, int der_len,
 		{		/* ASN1_TAG_IMPLICIT */
 		  if (!is_tag_implicit)
 		    {
-		      if ((type_field (node->type) == TYPE_SEQUENCE) ||
-			  (type_field (node->type) == TYPE_SEQUENCE_OF) ||
-			  (type_field (node->type) == TYPE_SET) ||
-			  (type_field (node->type) == TYPE_SET_OF))
+		      if ((type_field (node->type) == ASN1_ETYPE_SEQUENCE) ||
+			  (type_field (node->type) == ASN1_ETYPE_SEQUENCE_OF) ||
+			  (type_field (node->type) == ASN1_ETYPE_SET) ||
+			  (type_field (node->type) == ASN1_ETYPE_SET_OF))
 			class2 |= ASN1_CLASS_STRUCTURED;
 		      class_implicit = class2;
 		      tag_implicit = strtoul ((char *) p->value, NULL, 10);
@@ -462,7 +462,7 @@ _asn1_extract_tag_der (asn1_node node, const unsigned char *der, int der_len,
 
       if ((class != class_implicit) || (tag != tag_implicit))
 	{
-	  if (type_field (node->type) == TYPE_OCTET_STRING)
+	  if (type_field (node->type) == ASN1_ETYPE_OCTET_STRING)
 	    {
 	      class_implicit |= ASN1_CLASS_STRUCTURED;
 	      if ((class != class_implicit) || (tag != tag_implicit))
@@ -474,7 +474,8 @@ _asn1_extract_tag_der (asn1_node node, const unsigned char *der, int der_len,
     }
   else
     {
-      if (type_field (node->type) == TYPE_TAG)
+      unsigned type = type_field (node->type);
+      if (type == ASN1_ETYPE_TAG)
 	{
 	  counter = 0;
 	  *ret_len = counter;
@@ -489,29 +490,32 @@ _asn1_extract_tag_der (asn1_node node, const unsigned char *der, int der_len,
       if (counter + len2 > der_len)
 	return ASN1_DER_ERROR;
 
-      switch (type_field (node->type))
+      switch (type)
 	{
-	case TYPE_NULL:
-	  if ((class != ASN1_CLASS_UNIVERSAL) || (tag != ASN1_TAG_NULL))
+	case ASN1_ETYPE_NULL:
+	case ASN1_ETYPE_BOOLEAN:
+	case ASN1_ETYPE_INTEGER:
+	case ASN1_ETYPE_ENUMERATED:
+	case ASN1_ETYPE_OBJECT_ID:
+	case ASN1_ETYPE_GENERALSTRING:
+	case ASN1_ETYPE_NUMERICSTRING:
+	case ASN1_ETYPE_IA5STRING:
+	case ASN1_ETYPE_TELETEXSTRING:
+	case ASN1_ETYPE_PRINTABLESTRING:
+	case ASN1_ETYPE_UNIVERSALSTRING:
+	case ASN1_ETYPE_BMPSTRING:
+	case ASN1_ETYPE_UTF8STRING:
+	case ASN1_ETYPE_VISIBLESTRING:
+	case ASN1_ETYPE_BIT_STRING:
+	case ASN1_ETYPE_SEQUENCE:
+	case ASN1_ETYPE_SEQUENCE_OF:
+	case ASN1_ETYPE_SET:
+	case ASN1_ETYPE_SET_OF:
+	  if ((class != _asn1_tags[type].class) || (tag != _asn1_tags[type].tag))
 	    return ASN1_DER_ERROR;
 	  break;
-	case TYPE_BOOLEAN:
-	  if ((class != ASN1_CLASS_UNIVERSAL) || (tag != ASN1_TAG_BOOLEAN))
-	    return ASN1_DER_ERROR;
-	  break;
-	case TYPE_INTEGER:
-	  if ((class != ASN1_CLASS_UNIVERSAL) || (tag != ASN1_TAG_INTEGER))
-	    return ASN1_DER_ERROR;
-	  break;
-	case TYPE_ENUMERATED:
-	  if ((class != ASN1_CLASS_UNIVERSAL) || (tag != ASN1_TAG_ENUMERATED))
-	    return ASN1_DER_ERROR;
-	  break;
-	case TYPE_OBJECT_ID:
-	  if ((class != ASN1_CLASS_UNIVERSAL) || (tag != ASN1_TAG_OBJECT_ID))
-	    return ASN1_DER_ERROR;
-	  break;
-	case TYPE_TIME:
+
+	case ASN1_ETYPE_TIME:
 	  if (node->type & CONST_UTC)
 	    {
 	      if ((class != ASN1_CLASS_UNIVERSAL)
@@ -525,34 +529,15 @@ _asn1_extract_tag_der (asn1_node node, const unsigned char *der, int der_len,
 		return ASN1_DER_ERROR;
 	    }
 	  break;
-	case TYPE_OCTET_STRING:
+
+	case ASN1_ETYPE_OCTET_STRING:
+	  /* does it need to be structured??? --nmav */
 	  if (((class != ASN1_CLASS_UNIVERSAL)
 	       && (class != (ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED)))
 	      || (tag != ASN1_TAG_OCTET_STRING))
 	    return ASN1_DER_ERROR;
 	  break;
-	case TYPE_GENERALSTRING:
-	  if ((class != ASN1_CLASS_UNIVERSAL)
-	      || (tag != ASN1_TAG_GENERALSTRING))
-	    return ASN1_DER_ERROR;
-	  break;
-	case TYPE_BIT_STRING:
-	  if ((class != ASN1_CLASS_UNIVERSAL) || (tag != ASN1_TAG_BIT_STRING))
-	    return ASN1_DER_ERROR;
-	  break;
-	case TYPE_SEQUENCE:
-	case TYPE_SEQUENCE_OF:
-	  if ((class != (ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED))
-	      || (tag != ASN1_TAG_SEQUENCE))
-	    return ASN1_DER_ERROR;
-	  break;
-	case TYPE_SET:
-	case TYPE_SET_OF:
-	  if ((class != (ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED))
-	      || (tag != ASN1_TAG_SET))
-	    return ASN1_DER_ERROR;
-	  break;
-	case TYPE_ANY:
+	case ASN1_ETYPE_ANY:
 	  counter -= len2;
 	  break;
 	default:
@@ -883,7 +868,7 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 		{
 		  if ((p2->type & CONST_SET) && (p2->type & CONST_NOT_USED))
 		    {
-		      if (type_field (p2->type) != TYPE_CHOICE)
+		      if (type_field (p2->type) != ASN1_ETYPE_CHOICE)
 			ris =
 			  _asn1_extract_tag_der (p2, der + counter,
 						 len - counter, &len2);
@@ -938,7 +923,7 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 		}
 	    }
 
-	  if (type_field (p->type) == TYPE_CHOICE)
+	  if (type_field (p->type) == ASN1_ETYPE_CHOICE)
 	    {
 	      while (p->down)
 		{
@@ -1021,7 +1006,7 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 	{
 	  switch (type_field (p->type))
 	    {
-	    case TYPE_NULL:
+	    case ASN1_ETYPE_NULL:
 	      if (der[counter])
 		{
 		  result = ASN1_DER_ERROR;
@@ -1030,7 +1015,7 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 	      counter++;
 	      move = RIGHT;
 	      break;
-	    case TYPE_BOOLEAN:
+	    case ASN1_ETYPE_BOOLEAN:
 	      if (der[counter++] != 1)
 		{
 		  result = ASN1_DER_ERROR;
@@ -1042,8 +1027,8 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 		_asn1_set_value (p, "T", 1);
 	      move = RIGHT;
 	      break;
-	    case TYPE_INTEGER:
-	    case TYPE_ENUMERATED:
+	    case ASN1_ETYPE_INTEGER:
+	    case ASN1_ETYPE_ENUMERATED:
 	      len2 =
 		asn1_get_length_der (der + counter, len - counter, &len3);
 	      if (len2 < 0)
@@ -1056,7 +1041,7 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 	      counter += len3 + len2;
 	      move = RIGHT;
 	      break;
-	    case TYPE_OBJECT_ID:
+	    case ASN1_ETYPE_OBJECT_ID:
 	      result =
 		_asn1_get_objectid_der (der + counter, len - counter, &len2,
 					temp, sizeof (temp));
@@ -1069,7 +1054,7 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 	      counter += len2;
 	      move = RIGHT;
 	      break;
-	    case TYPE_TIME:
+	    case ASN1_ETYPE_TIME:
 	      result =
 		_asn1_get_time_der (der + counter, len - counter, &len2, temp,
 				    sizeof (temp) - 1);
@@ -1082,7 +1067,7 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 	      counter += len2;
 	      move = RIGHT;
 	      break;
-	    case TYPE_OCTET_STRING:
+	    case ASN1_ETYPE_OCTET_STRING:
 	      len3 = len - counter;
 	      result = _asn1_get_octet_string (der + counter, p, &len3);
 	      if (result != ASN1_SUCCESS)
@@ -1091,7 +1076,16 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 	      counter += len3;
 	      move = RIGHT;
 	      break;
-	    case TYPE_GENERALSTRING:
+	    case ASN1_ETYPE_GENERALSTRING:
+            case ASN1_ETYPE_NUMERICSTRING:
+            case ASN1_ETYPE_IA5STRING:
+            case ASN1_ETYPE_TELETEXSTRING:
+            case ASN1_ETYPE_PRINTABLESTRING:
+            case ASN1_ETYPE_UNIVERSALSTRING:
+            case ASN1_ETYPE_BMPSTRING:
+            case ASN1_ETYPE_UTF8STRING:
+            case ASN1_ETYPE_VISIBLESTRING:
+	    case ASN1_ETYPE_BIT_STRING:
 	      len2 =
 		asn1_get_length_der (der + counter, len - counter, &len3);
 	      if (len2 < 0)
@@ -1104,21 +1098,8 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 	      counter += len3 + len2;
 	      move = RIGHT;
 	      break;
-	    case TYPE_BIT_STRING:
-	      len2 =
-		asn1_get_length_der (der + counter, len - counter, &len3);
-	      if (len2 < 0)
-		{
-		  result = ASN1_DER_ERROR;
-		  goto cleanup;
-		}
-
-	      _asn1_set_value (p, der + counter, len3 + len2);
-	      counter += len3 + len2;
-	      move = RIGHT;
-	      break;
-	    case TYPE_SEQUENCE:
-	    case TYPE_SET:
+	    case ASN1_ETYPE_SEQUENCE:
+	    case ASN1_ETYPE_SET:
 	      if (move == UP)
 		{
 		  len2 = _asn1_strtol (p->value, NULL, 10);
@@ -1173,7 +1154,7 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 		      p2 = p->down;
 		      while (p2)
 			{
-			  if (type_field (p2->type) != TYPE_TAG)
+			  if (type_field (p2->type) != ASN1_ETYPE_TAG)
 			    {
 			      p3 = p2->right;
 			      asn1_delete_structure (&p2);
@@ -1191,8 +1172,8 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 		    }
 		}
 	      break;
-	    case TYPE_SEQUENCE_OF:
-	    case TYPE_SET_OF:
+	    case ASN1_ETYPE_SEQUENCE_OF:
+	    case ASN1_ETYPE_SET_OF:
 	      if (move == UP)
 		{
 		  len2 = _asn1_strtol (p->value, NULL, 10);
@@ -1260,8 +1241,8 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 			  _asn1_set_value (p, "-1", 3);
 			}
 		      p2 = p->down;
-		      while ((type_field (p2->type) == TYPE_TAG)
-			     || (type_field (p2->type) == TYPE_SIZE))
+		      while ((type_field (p2->type) == ASN1_ETYPE_TAG)
+			     || (type_field (p2->type) == ASN1_ETYPE_SIZE))
 			p2 = p2->right;
 		      if (p2->right == NULL)
 			_asn1_append_sequence_set (p);
@@ -1270,7 +1251,7 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 		}
 	      move = RIGHT;
 	      break;
-	    case TYPE_ANY:
+	    case ASN1_ETYPE_ANY:
 	      if (asn1_get_tag_der
 		  (der + counter, len - counter, &class, &len2,
 		   &tag) != ASN1_SUCCESS)
@@ -1494,7 +1475,7 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
 		{
 		  if ((p2->type & CONST_SET) && (p2->type & CONST_NOT_USED))
 		    {
-		      if (type_field (p2->type) != TYPE_CHOICE)
+		      if (type_field (p2->type) != ASN1_ETYPE_CHOICE)
 			ris =
 			  _asn1_extract_tag_der (p2, der + counter,
 						 len - counter, &len2);
@@ -1549,7 +1530,7 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
 		}
 	    }
 
-	  if (type_field (p->type) == TYPE_CHOICE)
+	  if (type_field (p->type) == ASN1_ETYPE_CHOICE)
 	    {
 	      while (p->down)
 		{
@@ -1632,7 +1613,7 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
 	{
 	  switch (type_field (p->type))
 	    {
-	    case TYPE_NULL:
+	    case ASN1_ETYPE_NULL:
 	      if (der[counter])
 		{
 		  result = ASN1_DER_ERROR;
@@ -1645,7 +1626,7 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
 	      counter++;
 	      move = RIGHT;
 	      break;
-	    case TYPE_BOOLEAN:
+	    case ASN1_ETYPE_BOOLEAN:
 	      if (der[counter++] != 1)
 		{
 		  result = ASN1_DER_ERROR;
@@ -1668,8 +1649,8 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
 
 	      move = RIGHT;
 	      break;
-	    case TYPE_INTEGER:
-	    case TYPE_ENUMERATED:
+	    case ASN1_ETYPE_INTEGER:
+	    case ASN1_ETYPE_ENUMERATED:
 	      len2 =
 		asn1_get_length_der (der + counter, len - counter, &len3);
 	      if (len2 < 0)
@@ -1693,7 +1674,7 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
 	      counter += len3 + len2;
 	      move = RIGHT;
 	      break;
-	    case TYPE_OBJECT_ID:
+	    case ASN1_ETYPE_OBJECT_ID:
 	      if (state == FOUND)
 		{
 		  result =
@@ -1725,7 +1706,7 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
 	      counter += len2;
 	      move = RIGHT;
 	      break;
-	    case TYPE_TIME:
+	    case ASN1_ETYPE_TIME:
 	      if (state == FOUND)
 		{
 		  result =
@@ -1756,7 +1737,7 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
 	      counter += len2;
 	      move = RIGHT;
 	      break;
-	    case TYPE_OCTET_STRING:
+	    case ASN1_ETYPE_OCTET_STRING:
 	      len3 = len - counter;
 	      if (state == FOUND)
 		{
@@ -1773,7 +1754,16 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
 	      counter += len3;
 	      move = RIGHT;
 	      break;
-	    case TYPE_GENERALSTRING:
+	    case ASN1_ETYPE_GENERALSTRING:
+            case ASN1_ETYPE_NUMERICSTRING:
+            case ASN1_ETYPE_IA5STRING:
+            case ASN1_ETYPE_TELETEXSTRING:
+            case ASN1_ETYPE_PRINTABLESTRING:
+            case ASN1_ETYPE_UNIVERSALSTRING:
+            case ASN1_ETYPE_BMPSTRING:
+            case ASN1_ETYPE_UTF8STRING:
+            case ASN1_ETYPE_VISIBLESTRING:
+	    case ASN1_ETYPE_BIT_STRING:
 	      len2 =
 		asn1_get_length_der (der + counter, len - counter, &len3);
 	      if (len2 < 0)
@@ -1797,31 +1787,8 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
 	      counter += len3 + len2;
 	      move = RIGHT;
 	      break;
-	    case TYPE_BIT_STRING:
-	      len2 =
-		asn1_get_length_der (der + counter, len - counter, &len3);
-	      if (len2 < 0)
-		{
-		  result = ASN1_DER_ERROR;
-		  goto cleanup;
-		}
-	      if (state == FOUND)
-		{
-		  if (len3 + len2 > len - counter)
-		    {
-		      result = ASN1_DER_ERROR;
-		      goto cleanup;
-		    }
-		  _asn1_set_value (p, der + counter, len3 + len2);
-
-		  if (p == nodeFound)
-		    state = EXIT;
-		}
-	      counter += len3 + len2;
-	      move = RIGHT;
-	      break;
-	    case TYPE_SEQUENCE:
-	    case TYPE_SET:
+	    case ASN1_ETYPE_SEQUENCE:
+	    case ASN1_ETYPE_SET:
 	      if (move == UP)
 		{
 		  len2 = _asn1_strtol (p->value, NULL, 10);
@@ -1887,7 +1854,7 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
 			  p2 = p->down;
 			  while (p2)
 			    {
-			      if (type_field (p2->type) != TYPE_TAG)
+			      if (type_field (p2->type) != ASN1_ETYPE_TAG)
 				{
 				  p3 = p2->right;
 				  asn1_delete_structure (&p2);
@@ -1906,8 +1873,8 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
 		    }
 		}
 	      break;
-	    case TYPE_SEQUENCE_OF:
-	    case TYPE_SET_OF:
+	    case ASN1_ETYPE_SEQUENCE_OF:
+	    case ASN1_ETYPE_SET_OF:
 	      if (move == UP)
 		{
 		  len2 = _asn1_strtol (p->value, NULL, 10);
@@ -1964,8 +1931,8 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
 			  if (tlen > 0)
 			    _asn1_set_value (p, temp, tlen + 1);
 			  p2 = p->down;
-			  while ((type_field (p2->type) == TYPE_TAG)
-				 || (type_field (p2->type) == TYPE_SIZE))
+			  while ((type_field (p2->type) == ASN1_ETYPE_TAG)
+				 || (type_field (p2->type) == ASN1_ETYPE_SIZE))
 			    p2 = p2->right;
 			  if (p2->right == NULL)
 			    _asn1_append_sequence_set (p);
@@ -1976,7 +1943,7 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
 		}
 
 	      break;
-	    case TYPE_ANY:
+	    case ASN1_ETYPE_ANY:
 	      if (asn1_get_tag_der
 		  (der + counter, len - counter, &class, &len2,
 		   &tag) != ASN1_SUCCESS)
@@ -2289,7 +2256,7 @@ asn1_der_decoding_startEnd (asn1_node element, const void *ider, int len,
 		{
 		  if ((p2->type & CONST_SET) && (p2->type & CONST_NOT_USED))
 		    {		/* CONTROLLARE */
-		      if (type_field (p2->type) != TYPE_CHOICE)
+		      if (type_field (p2->type) != ASN1_ETYPE_CHOICE)
 			ris =
 			  _asn1_extract_tag_der (p2, der + counter,
 						 len - counter, &len2);
@@ -2319,7 +2286,7 @@ asn1_der_decoding_startEnd (asn1_node element, const void *ider, int len,
 	  if (p == node_to_find)
 	    *start = counter;
 
-	  if (type_field (p->type) == TYPE_CHOICE)
+	  if (type_field (p->type) == ASN1_ETYPE_CHOICE)
 	    {
 	      p = p->down;
               if (p == NULL)
@@ -2359,44 +2326,19 @@ asn1_der_decoding_startEnd (asn1_node element, const void *ider, int len,
 	{
 	  switch (type_field (p->type))
 	    {
-	    case TYPE_NULL:
+	    case ASN1_ETYPE_NULL:
 	      if (der[counter])
 		return ASN1_DER_ERROR;
 	      counter++;
 	      move = RIGHT;
 	      break;
-	    case TYPE_BOOLEAN:
+	    case ASN1_ETYPE_BOOLEAN:
 	      if (der[counter++] != 1)
 		return ASN1_DER_ERROR;
 	      counter++;
 	      move = RIGHT;
 	      break;
-	    case TYPE_INTEGER:
-	    case TYPE_ENUMERATED:
-	      len2 =
-		asn1_get_length_der (der + counter, len - counter, &len3);
-	      if (len2 < 0)
-		return ASN1_DER_ERROR;
-	      counter += len3 + len2;
-	      move = RIGHT;
-	      break;
-	    case TYPE_OBJECT_ID:
-	      len2 =
-		asn1_get_length_der (der + counter, len - counter, &len3);
-	      if (len2 < 0)
-		return ASN1_DER_ERROR;
-	      counter += len2 + len3;
-	      move = RIGHT;
-	      break;
-	    case TYPE_TIME:
-	      len2 =
-		asn1_get_length_der (der + counter, len - counter, &len3);
-	      if (len2 < 0)
-		return ASN1_DER_ERROR;
-	      counter += len2 + len3;
-	      move = RIGHT;
-	      break;
-	    case TYPE_OCTET_STRING:
+	    case ASN1_ETYPE_OCTET_STRING:
 	      len3 = len - counter;
 	      ris = _asn1_get_octet_string (der + counter, NULL, &len3);
 	      if (ris != ASN1_SUCCESS)
@@ -2404,15 +2346,20 @@ asn1_der_decoding_startEnd (asn1_node element, const void *ider, int len,
 	      counter += len3;
 	      move = RIGHT;
 	      break;
-	    case TYPE_GENERALSTRING:
-	      len2 =
-		asn1_get_length_der (der + counter, len - counter, &len3);
-	      if (len2 < 0)
-		return ASN1_DER_ERROR;
-	      counter += len3 + len2;
-	      move = RIGHT;
-	      break;
-	    case TYPE_BIT_STRING:
+	    case ASN1_ETYPE_TIME:
+	    case ASN1_ETYPE_OBJECT_ID:
+	    case ASN1_ETYPE_INTEGER:
+	    case ASN1_ETYPE_ENUMERATED:
+	    case ASN1_ETYPE_GENERALSTRING:
+            case ASN1_ETYPE_NUMERICSTRING:
+            case ASN1_ETYPE_IA5STRING:
+            case ASN1_ETYPE_TELETEXSTRING:
+            case ASN1_ETYPE_PRINTABLESTRING:
+            case ASN1_ETYPE_UNIVERSALSTRING:
+            case ASN1_ETYPE_BMPSTRING:
+            case ASN1_ETYPE_UTF8STRING:
+            case ASN1_ETYPE_VISIBLESTRING:
+	    case ASN1_ETYPE_BIT_STRING:
 	      len2 =
 		asn1_get_length_der (der + counter, len - counter, &len3);
 	      if (len2 < 0)
@@ -2420,8 +2367,8 @@ asn1_der_decoding_startEnd (asn1_node element, const void *ider, int len,
 	      counter += len3 + len2;
 	      move = RIGHT;
 	      break;
-	    case TYPE_SEQUENCE:
-	    case TYPE_SET:
+	    case ASN1_ETYPE_SEQUENCE:
+	    case ASN1_ETYPE_SET:
 	      if (move != UP)
 		{
 		  len3 =
@@ -2441,8 +2388,8 @@ asn1_der_decoding_startEnd (asn1_node element, const void *ider, int len,
 		  move = RIGHT;
 		}
 	      break;
-	    case TYPE_SEQUENCE_OF:
-	    case TYPE_SET_OF:
+	    case ASN1_ETYPE_SEQUENCE_OF:
+	    case ASN1_ETYPE_SET_OF:
 	      if (move != UP)
 		{
 		  len3 =
@@ -2455,8 +2402,8 @@ asn1_der_decoding_startEnd (asn1_node element, const void *ider, int len,
 		  else if (len3)
 		    {
 		      p2 = p->down;
-		      while ((type_field (p2->type) == TYPE_TAG) ||
-			     (type_field (p2->type) == TYPE_SIZE))
+		      while ((type_field (p2->type) == ASN1_ETYPE_TAG) ||
+			     (type_field (p2->type) == ASN1_ETYPE_SIZE))
 			p2 = p2->right;
 		      p = p2;
 		    }
@@ -2468,7 +2415,7 @@ asn1_der_decoding_startEnd (asn1_node element, const void *ider, int len,
 		}
 	      move = RIGHT;
 	      break;
-	    case TYPE_ANY:
+	    case ASN1_ETYPE_ANY:
 	      if (asn1_get_tag_der
 		  (der + counter, len - counter, &class, &len2,
 		   &tag) != ASN1_SUCCESS)
@@ -2587,12 +2534,12 @@ asn1_expand_any_defined_by (asn1_node definitions, asn1_node * element)
 
       switch (type_field (p->type))
 	{
-	case TYPE_ANY:
+	case ASN1_ETYPE_ANY:
 	  if ((p->type & CONST_DEFINED_BY) && (p->value))
 	    {
 	      /* search the "DEF_BY" element */
 	      p2 = p->down;
-	      while ((p2) && (type_field (p2->type) != TYPE_CONSTANT))
+	      while ((p2) && (type_field (p2->type) != ASN1_ETYPE_CONSTANT))
 		p2 = p2->right;
 
 	      if (!p2)
@@ -2617,7 +2564,7 @@ asn1_expand_any_defined_by (asn1_node definitions, asn1_node * element)
 		  p3 = p3->right;
 		}
 
-	      if ((!p3) || (type_field (p3->type) != TYPE_OBJECT_ID) ||
+	      if ((!p3) || (type_field (p3->type) != ASN1_ETYPE_OBJECT_ID) ||
 		  (p3->value == NULL))
 		{
 
@@ -2639,7 +2586,7 @@ asn1_expand_any_defined_by (asn1_node definitions, asn1_node * element)
 		      p3 = p3->right;
 		    }
 
-		  if ((!p3) || (type_field (p3->type) != TYPE_OBJECT_ID) ||
+		  if ((!p3) || (type_field (p3->type) != ASN1_ETYPE_OBJECT_ID) ||
 		      (p3->value == NULL))
 		    {
 		      retCode = ASN1_ERROR_TYPE_ANY;
@@ -2651,7 +2598,7 @@ asn1_expand_any_defined_by (asn1_node definitions, asn1_node * element)
 	      p2 = definitions->down;
 	      while (p2)
 		{
-		  if ((type_field (p2->type) == TYPE_OBJECT_ID) &&
+		  if ((type_field (p2->type) == ASN1_ETYPE_OBJECT_ID) &&
 		      (p2->type & CONST_ASSIGN))
 		    {
 		      strcpy (name, definitionsName);
@@ -2812,7 +2759,7 @@ asn1_expand_octet_string (asn1_node definitions, asn1_node * element,
   octetNode = asn1_find_node (*element, octetName);
   if (octetNode == NULL)
     return ASN1_ELEMENT_NOT_FOUND;
-  if (type_field (octetNode->type) != TYPE_OCTET_STRING)
+  if (type_field (octetNode->type) != ASN1_ETYPE_OCTET_STRING)
     return ASN1_ELEMENT_NOT_FOUND;
   if (octetNode->value == NULL)
     return ASN1_VALUE_NOT_FOUND;
@@ -2821,7 +2768,7 @@ asn1_expand_octet_string (asn1_node definitions, asn1_node * element,
   if (objectNode == NULL)
     return ASN1_ELEMENT_NOT_FOUND;
 
-  if (type_field (objectNode->type) != TYPE_OBJECT_ID)
+  if (type_field (objectNode->type) != ASN1_ETYPE_OBJECT_ID)
     return ASN1_ELEMENT_NOT_FOUND;
 
   if (objectNode->value == NULL)
@@ -2832,7 +2779,7 @@ asn1_expand_octet_string (asn1_node definitions, asn1_node * element,
   p2 = definitions->down;
   while (p2)
     {
-      if ((type_field (p2->type) == TYPE_OBJECT_ID) &&
+      if ((type_field (p2->type) == ASN1_ETYPE_OBJECT_ID) &&
 	  (p2->type & CONST_ASSIGN))
 	{
 	  strcpy (name, definitions->name);
diff --git a/lib/element.c b/lib/element.c
index 4c871a1..2c6a2fd 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -137,8 +137,8 @@ _asn1_append_sequence_set (asn1_node node)
     return ASN1_GENERIC_ERROR;
 
   p = node->down;
-  while ((type_field (p->type) == TYPE_TAG)
-	 || (type_field (p->type) == TYPE_SIZE))
+  while ((type_field (p->type) == ASN1_ETYPE_TAG)
+	 || (type_field (p->type) == ASN1_ETYPE_SIZE))
     p = p->right;
   p2 = _asn1_copy_structure3 (p);
   while (p->right)
@@ -287,12 +287,12 @@ asn1_write_value (asn1_node node_root, const char *name,
       return ASN1_SUCCESS;
     }
 
-  if ((type_field (node->type) == TYPE_SEQUENCE_OF) && (value == NULL)
+  if ((type_field (node->type) == ASN1_ETYPE_SEQUENCE_OF) && (value == NULL)
       && (len == 0))
     {
       p = node->down;
-      while ((type_field (p->type) == TYPE_TAG)
-	     || (type_field (p->type) == TYPE_SIZE))
+      while ((type_field (p->type) == ASN1_ETYPE_TAG)
+	     || (type_field (p->type) == ASN1_ETYPE_SIZE))
 	p = p->right;
 
       while (p->right)
@@ -303,13 +303,13 @@ asn1_write_value (asn1_node node_root, const char *name,
 
   switch (type_field (node->type))
     {
-    case TYPE_BOOLEAN:
+    case ASN1_ETYPE_BOOLEAN:
       if (!_asn1_strcmp (value, "TRUE"))
 	{
 	  if (node->type & CONST_DEFAULT)
 	    {
 	      p = node->down;
-	      while (type_field (p->type) != TYPE_DEFAULT)
+	      while (type_field (p->type) != ASN1_ETYPE_DEFAULT)
 		p = p->right;
 	      if (p->type & CONST_TRUE)
 		_asn1_set_value (node, NULL, 0);
@@ -324,7 +324,7 @@ asn1_write_value (asn1_node node_root, const char *name,
 	  if (node->type & CONST_DEFAULT)
 	    {
 	      p = node->down;
-	      while (type_field (p->type) != TYPE_DEFAULT)
+	      while (type_field (p->type) != ASN1_ETYPE_DEFAULT)
 		p = p->right;
 	      if (p->type & CONST_FALSE)
 		_asn1_set_value (node, NULL, 0);
@@ -337,8 +337,8 @@ asn1_write_value (asn1_node node_root, const char *name,
       else
 	return ASN1_VALUE_NOT_VALID;
       break;
-    case TYPE_INTEGER:
-    case TYPE_ENUMERATED:
+    case ASN1_ETYPE_INTEGER:
+    case ASN1_ETYPE_ENUMERATED:
       if (len == 0)
 	{
 	  if ((isdigit (value[0])) || (value[0] == '-'))
@@ -357,7 +357,7 @@ asn1_write_value (asn1_node node_root, const char *name,
 	      p = node->down;
 	      while (p)
 		{
-		  if (type_field (p->type) == TYPE_CONSTANT)
+		  if (type_field (p->type) == ASN1_ETYPE_CONSTANT)
 		    {
 		      if (!_asn1_strcmp (p->name, value))
 			{
@@ -392,7 +392,7 @@ asn1_write_value (asn1_node node_root, const char *name,
       else
 	negative = 0;
 
-      if (negative && (type_field (node->type) == TYPE_ENUMERATED))
+      if (negative && (type_field (node->type) == ASN1_ETYPE_ENUMERATED))
 	{
 	  free (value_temp);
 	  return ASN1_VALUE_NOT_VALID;
@@ -413,7 +413,7 @@ asn1_write_value (asn1_node node_root, const char *name,
       if (node->type & CONST_DEFAULT)
 	{
 	  p = node->down;
-	  while (type_field (p->type) != TYPE_DEFAULT)
+	  while (type_field (p->type) != ASN1_ETYPE_DEFAULT)
 	    p = p->right;
 	  if ((isdigit (p->value[0])) || (p->value[0] == '-'))
 	    {
@@ -437,7 +437,7 @@ asn1_write_value (asn1_node node_root, const char *name,
 	      p2 = node->down;
 	      while (p2)
 		{
-		  if (type_field (p2->type) == TYPE_CONSTANT)
+		  if (type_field (p2->type) == ASN1_ETYPE_CONSTANT)
 		    {
 		      if (!_asn1_strcmp (p2->name, p->value))
 			{
@@ -479,14 +479,14 @@ asn1_write_value (asn1_node node_root, const char *name,
 	}
       free (value_temp);
       break;
-    case TYPE_OBJECT_ID:
+    case ASN1_ETYPE_OBJECT_ID:
       for (i = 0; i < _asn1_strlen (value); i++)
 	if ((!isdigit (value[i])) && (value[i] != '.') && (value[i] != '+'))
 	  return ASN1_VALUE_NOT_VALID;
       if (node->type & CONST_DEFAULT)
 	{
 	  p = node->down;
-	  while (type_field (p->type) != TYPE_DEFAULT)
+	  while (type_field (p->type) != ASN1_ETYPE_DEFAULT)
 	    p = p->right;
 	  if (!_asn1_strcmp (value, p->value))
 	    {
@@ -496,7 +496,7 @@ asn1_write_value (asn1_node node_root, const char *name,
 	}
       _asn1_set_value (node, value, _asn1_strlen (value) + 1);
       break;
-    case TYPE_TIME:
+    case ASN1_ETYPE_TIME:
       if (node->type & CONST_UTC)
 	{
 	  if (_asn1_strlen (value) < 11)
@@ -542,17 +542,21 @@ asn1_write_value (asn1_node node_root, const char *name,
 	    _asn1_set_value (node, value, _asn1_strlen (value) + 1);
 	}
       break;
-    case TYPE_OCTET_STRING:
+    case ASN1_ETYPE_OCTET_STRING:
+    case ASN1_ETYPE_GENERALSTRING:
+    case ASN1_ETYPE_NUMERICSTRING:
+    case ASN1_ETYPE_IA5STRING:
+    case ASN1_ETYPE_TELETEXSTRING:
+    case ASN1_ETYPE_PRINTABLESTRING:
+    case ASN1_ETYPE_UNIVERSALSTRING:
+    case ASN1_ETYPE_BMPSTRING:
+    case ASN1_ETYPE_UTF8STRING:
+    case ASN1_ETYPE_VISIBLESTRING:
       if (len == 0)
 	len = _asn1_strlen (value);
       _asn1_set_value_octet (node, value, len);
       break;
-    case TYPE_GENERALSTRING:
-      if (len == 0)
-	len = _asn1_strlen (value);
-      _asn1_set_value_octet (node, value, len);
-      break;
-    case TYPE_BIT_STRING:
+    case ASN1_ETYPE_BIT_STRING:
       if (len == 0)
 	len = _asn1_strlen (value);
       asn1_length_der ((len >> 3) + 2, NULL, &len2);
@@ -564,7 +568,7 @@ asn1_write_value (asn1_node node_root, const char *name,
       _asn1_set_value_m (node, temp, len2);
       temp = NULL;
       break;
-    case TYPE_CHOICE:
+    case ASN1_ETYPE_CHOICE:
       p = node->down;
       while (p)
 	{
@@ -588,11 +592,11 @@ asn1_write_value (asn1_node node_root, const char *name,
       if (!p)
 	return ASN1_ELEMENT_NOT_FOUND;
       break;
-    case TYPE_ANY:
+    case ASN1_ETYPE_ANY:
       _asn1_set_value_octet (node, value, len);
       break;
-    case TYPE_SEQUENCE_OF:
-    case TYPE_SET_OF:
+    case ASN1_ETYPE_SEQUENCE_OF:
+    case ASN1_ETYPE_SET_OF:
       if (_asn1_strcmp (value, "NEW"))
 	return ASN1_VALUE_NOT_VALID;
       _asn1_append_sequence_set (node);
@@ -705,22 +709,22 @@ asn1_read_value (asn1_node root, const char *name, void *ivalue, int *len)
   if (node == NULL)
     return ASN1_ELEMENT_NOT_FOUND;
 
-  if ((type_field (node->type) != TYPE_NULL) &&
-      (type_field (node->type) != TYPE_CHOICE) &&
+  if ((type_field (node->type) != ASN1_ETYPE_NULL) &&
+      (type_field (node->type) != ASN1_ETYPE_CHOICE) &&
       !(node->type & CONST_DEFAULT) && !(node->type & CONST_ASSIGN) &&
       (node->value == NULL))
     return ASN1_VALUE_NOT_FOUND;
 
   switch (type_field (node->type))
     {
-    case TYPE_NULL:
+    case ASN1_ETYPE_NULL:
       PUT_STR_VALUE (value, value_size, "NULL");
       break;
-    case TYPE_BOOLEAN:
+    case ASN1_ETYPE_BOOLEAN:
       if ((node->type & CONST_DEFAULT) && (node->value == NULL))
 	{
 	  p = node->down;
-	  while (type_field (p->type) != TYPE_DEFAULT)
+	  while (type_field (p->type) != ASN1_ETYPE_DEFAULT)
 	    p = p->right;
 	  if (p->type & CONST_TRUE)
 	    {
@@ -740,12 +744,12 @@ asn1_read_value (asn1_node root, const char *name, void *ivalue, int *len)
 	  PUT_STR_VALUE (value, value_size, "FALSE");
 	}
       break;
-    case TYPE_INTEGER:
-    case TYPE_ENUMERATED:
+    case ASN1_ETYPE_INTEGER:
+    case ASN1_ETYPE_ENUMERATED:
       if ((node->type & CONST_DEFAULT) && (node->value == NULL))
 	{
 	  p = node->down;
-	  while (type_field (p->type) != TYPE_DEFAULT)
+	  while (type_field (p->type) != ASN1_ETYPE_DEFAULT)
 	    p = p->right;
 	  if ((isdigit (p->value[0])) || (p->value[0] == '-')
 	      || (p->value[0] == '+'))
@@ -759,7 +763,7 @@ asn1_read_value (asn1_node root, const char *name, void *ivalue, int *len)
 	      p2 = node->down;
 	      while (p2)
 		{
-		  if (type_field (p2->type) == TYPE_CONSTANT)
+		  if (type_field (p2->type) == ASN1_ETYPE_CONSTANT)
 		    {
 		      if (!_asn1_strcmp (p2->name, p->value))
 			{
@@ -783,14 +787,14 @@ asn1_read_value (asn1_node root, const char *name, void *ivalue, int *len)
 	    return ASN1_MEM_ERROR;
 	}
       break;
-    case TYPE_OBJECT_ID:
+    case ASN1_ETYPE_OBJECT_ID:
       if (node->type & CONST_ASSIGN)
 	{
 	  value[0] = 0;
 	  p = node->down;
 	  while (p)
 	    {
-	      if (type_field (p->type) == TYPE_CONSTANT)
+	      if (type_field (p->type) == ASN1_ETYPE_CONSTANT)
 		{
 		  ADD_STR_VALUE (value, value_size, p->value);
 		  if (p->right)
@@ -805,7 +809,7 @@ asn1_read_value (asn1_node root, const char *name, void *ivalue, int *len)
       else if ((node->type & CONST_DEFAULT) && (node->value == NULL))
 	{
 	  p = node->down;
-	  while (type_field (p->type) != TYPE_DEFAULT)
+	  while (type_field (p->type) != ASN1_ETYPE_DEFAULT)
 	    p = p->right;
 	  PUT_STR_VALUE (value, value_size, p->value);
 	}
@@ -814,34 +818,36 @@ asn1_read_value (asn1_node root, const char *name, void *ivalue, int *len)
 	  PUT_STR_VALUE (value, value_size, node->value);
 	}
       break;
-    case TYPE_TIME:
+    case ASN1_ETYPE_TIME:
       PUT_STR_VALUE (value, value_size, node->value);
       break;
-    case TYPE_OCTET_STRING:
-      len2 = -1;
-      if (asn1_get_octet_der
-	  (node->value, node->value_len, &len2, value, value_size,
-	   len) != ASN1_SUCCESS)
-	return ASN1_MEM_ERROR;
-      break;
-    case TYPE_GENERALSTRING:
+    case ASN1_ETYPE_OCTET_STRING:
+    case ASN1_ETYPE_GENERALSTRING:
+    case ASN1_ETYPE_NUMERICSTRING:
+    case ASN1_ETYPE_IA5STRING:
+    case ASN1_ETYPE_TELETEXSTRING:
+    case ASN1_ETYPE_PRINTABLESTRING:
+    case ASN1_ETYPE_UNIVERSALSTRING:
+    case ASN1_ETYPE_BMPSTRING:
+    case ASN1_ETYPE_UTF8STRING:
+    case ASN1_ETYPE_VISIBLESTRING:
       len2 = -1;
       if (asn1_get_octet_der
 	  (node->value, node->value_len, &len2, value, value_size,
 	   len) != ASN1_SUCCESS)
 	return ASN1_MEM_ERROR;
       break;
-    case TYPE_BIT_STRING:
+    case ASN1_ETYPE_BIT_STRING:
       len2 = -1;
       if (asn1_get_bit_der
 	  (node->value, node->value_len, &len2, value, value_size,
 	   len) != ASN1_SUCCESS)
 	return ASN1_MEM_ERROR;
       break;
-    case TYPE_CHOICE:
+    case ASN1_ETYPE_CHOICE:
       PUT_STR_VALUE (value, value_size, node->down->name);
       break;
-    case TYPE_ANY:
+    case ASN1_ETYPE_ANY:
       len3 = -1;
       len2 = asn1_get_length_der (node->value, node->value_len, &len3);
       if (len2 < 0)
@@ -889,7 +895,7 @@ asn1_read_tag (asn1_node root, const char *name, int *tagValue,
     {
       while (p)
 	{
-	  if (type_field (p->type) == TYPE_TAG)
+	  if (type_field (p->type) == ASN1_ETYPE_TAG)
 	    {
 	      if ((p->type & CONST_IMPLICIT) && (pTag == NULL))
 		pTag = p;
@@ -915,26 +921,34 @@ asn1_read_tag (asn1_node root, const char *name, int *tagValue,
     }
   else
     {
+      unsigned type = type_field (node->type);
       *classValue = ASN1_CLASS_UNIVERSAL;
 
-      switch (type_field (node->type))
+      switch (type)
 	{
-	case TYPE_NULL:
-	  *tagValue = ASN1_TAG_NULL;
+	case ASN1_ETYPE_NULL:
+	case ASN1_ETYPE_BOOLEAN:
+	case ASN1_ETYPE_INTEGER:
+	case ASN1_ETYPE_ENUMERATED:
+	case ASN1_ETYPE_OBJECT_ID:
+	case ASN1_ETYPE_OCTET_STRING:
+	case ASN1_ETYPE_GENERALSTRING:
+        case ASN1_ETYPE_NUMERICSTRING:
+        case ASN1_ETYPE_IA5STRING:
+        case ASN1_ETYPE_TELETEXSTRING:
+        case ASN1_ETYPE_PRINTABLESTRING:
+        case ASN1_ETYPE_UNIVERSALSTRING:
+        case ASN1_ETYPE_BMPSTRING:
+        case ASN1_ETYPE_UTF8STRING:
+        case ASN1_ETYPE_VISIBLESTRING:
+	case ASN1_ETYPE_BIT_STRING:
+	case ASN1_ETYPE_SEQUENCE:
+	case ASN1_ETYPE_SEQUENCE_OF:
+	case ASN1_ETYPE_SET:
+	case ASN1_ETYPE_SET_OF:
+	  *tagValue = _asn1_tags[type].tag;
 	  break;
-	case TYPE_BOOLEAN:
-	  *tagValue = ASN1_TAG_BOOLEAN;
-	  break;
-	case TYPE_INTEGER:
-	  *tagValue = ASN1_TAG_INTEGER;
-	  break;
-	case TYPE_ENUMERATED:
-	  *tagValue = ASN1_TAG_ENUMERATED;
-	  break;
-	case TYPE_OBJECT_ID:
-	  *tagValue = ASN1_TAG_OBJECT_ID;
-	  break;
-	case TYPE_TIME:
+	case ASN1_ETYPE_TIME:
 	  if (node->type & CONST_UTC)
 	    {
 	      *tagValue = ASN1_TAG_UTCTime;
@@ -942,26 +956,10 @@ asn1_read_tag (asn1_node root, const char *name, int *tagValue,
 	  else
 	    *tagValue = ASN1_TAG_GENERALIZEDTime;
 	  break;
-	case TYPE_OCTET_STRING:
-	  *tagValue = ASN1_TAG_OCTET_STRING;
-	  break;
-	case TYPE_GENERALSTRING:
-	  *tagValue = ASN1_TAG_GENERALSTRING;
-	  break;
-	case TYPE_BIT_STRING:
-	  *tagValue = ASN1_TAG_BIT_STRING;
-	  break;
-	case TYPE_SEQUENCE:
-	case TYPE_SEQUENCE_OF:
-	  *tagValue = ASN1_TAG_SEQUENCE;
-	  break;
-	case TYPE_SET:
-	case TYPE_SET_OF:
-	  *tagValue = ASN1_TAG_SET;
-	  break;
-	case TYPE_TAG:
-	case TYPE_CHOICE:
-	case TYPE_ANY:
+	case ASN1_ETYPE_TAG:
+	case ASN1_ETYPE_CHOICE:
+	case ASN1_ETYPE_ANY:
+	  *tagValue = -1;
 	  break;
 	default:
 	  break;
diff --git a/lib/int.h b/lib/int.h
index 0908284..7791906 100644
--- a/lib/int.h
+++ b/lib/int.h
@@ -58,6 +58,13 @@ struct asn1_node_st
   unsigned char small_value[ASN1_SMALL_VALUE_SIZE];	/* For small values */
 };
 
+typedef struct tag_and_class_st {
+  unsigned tag;
+  unsigned class;
+} tag_and_class_st;
+
+extern tag_and_class_st _asn1_tags[];
+
 #define _asn1_strlen(s) strlen((const char *) s)
 #define _asn1_strtol(n,e,b) strtol((const char *) n, e, b)
 #define _asn1_strtoul(n,e,b) strtoul((const char *) n, e, b)
@@ -78,31 +85,6 @@ struct asn1_node_st
 /****************************************/
 #define type_field(x)     (x&0xFF)
 
-/* List of constants for field type of typedef asn1_node_st  */
-#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
-
-
 /***********************************************************************/
 /* List of constants to better specify the type of typedef asn1_node_st.   */
 /***********************************************************************/
diff --git a/lib/libtasn1.h b/lib/libtasn1.h
index c80a5ca..ad3b554 100644
--- a/lib/libtasn1.h
+++ b/lib/libtasn1.h
@@ -100,6 +100,14 @@ extern "C"
 #define ASN1_TAG_ENUMERATED		0x0A
 #define ASN1_TAG_NULL			0x05
 #define ASN1_TAG_GENERALSTRING		0x1B
+#define ASN1_TAG_NUMERICSTRING		0x12
+#define ASN1_TAG_IA5STRING		0x16
+#define ASN1_TAG_TELETEXSTRING		0x14
+#define ASN1_TAG_PRINTABLESTRING	0x13
+#define ASN1_TAG_UNIVERSALSTRING	0x1C
+#define ASN1_TAG_BMPSTRING		0x1E
+#define ASN1_TAG_UTF8STRING		0x0C
+#define ASN1_TAG_VISIBLESTRING		0x1A
 
   /******************************************************/
   /* Structure definition used for the node of the tree */
@@ -126,7 +134,7 @@ extern "C"
   };
   typedef struct asn1_static_node_st asn1_static_node;
 
-/* List of constants for field type of typedef node_asn  */
+/* List of constants for field type of node_asn  */
 #define ASN1_ETYPE_CONSTANT       1
 #define ASN1_ETYPE_IDENTIFIER     2
 #define ASN1_ETYPE_INTEGER        3
@@ -149,6 +157,14 @@ extern "C"
 #define ASN1_ETYPE_NULL          20
 #define ASN1_ETYPE_ENUMERATED    21
 #define ASN1_ETYPE_GENERALSTRING 27
+#define ASN1_ETYPE_NUMERICSTRING 28
+#define ASN1_ETYPE_IA5STRING     29
+#define ASN1_ETYPE_TELETEXSTRING 30
+#define ASN1_ETYPE_PRINTABLESTRING 31
+#define ASN1_ETYPE_UNIVERSALSTRING 32
+#define ASN1_ETYPE_BMPSTRING     33
+#define ASN1_ETYPE_UTF8STRING    34
+#define ASN1_ETYPE_VISIBLESTRING 35
 
   struct asn1_data_node_st
   {
diff --git a/lib/parser_aux.c b/lib/parser_aux.c
index 96ecac6..cced582 100644
--- a/lib/parser_aux.c
+++ b/lib/parser_aux.c
@@ -48,7 +48,7 @@ list_type *firstElement = NULL;
 /* Description: creates a new NODE_ASN element and    */
 /* puts it in the list pointed by firstElement.       */
 /* Parameters:                                        */
-/*   type: type of the new element (see TYPE_         */
+/*   type: type of the new element (see ASN1_ETYPE_         */
 /*         and CONST_ constants).                     */
 /* Return: pointer to the new element.                */
 /******************************************************/
@@ -581,7 +581,7 @@ _asn1_change_integer_value (asn1_node node)
   p = node;
   while (p)
     {
-      if ((type_field (p->type) == TYPE_INTEGER) && (p->type & CONST_ASSIGN))
+      if ((type_field (p->type) == ASN1_ETYPE_INTEGER) && (p->type & CONST_ASSIGN))
 	{
 	  if (p->value)
 	    {
@@ -653,11 +653,11 @@ _asn1_expand_object_id (asn1_node node)
     {
       if (move != UP)
 	{
-	  if ((type_field (p->type) == TYPE_OBJECT_ID)
+	  if ((type_field (p->type) == ASN1_ETYPE_OBJECT_ID)
 	      && (p->type & CONST_ASSIGN))
 	    {
 	      p2 = p->down;
-	      if (p2 && (type_field (p2->type) == TYPE_CONSTANT))
+	      if (p2 && (type_field (p2->type) == ASN1_ETYPE_CONSTANT))
 		{
 		  if (p2->value && !isdigit (p2->value[0]))
 		    {
@@ -666,7 +666,7 @@ _asn1_expand_object_id (asn1_node node)
 		      _asn1_str_cat (name2, sizeof (name2),
 				     (char *) p2->value);
 		      p3 = asn1_find_node (node, name2);
-		      if (!p3 || (type_field (p3->type) != TYPE_OBJECT_ID) ||
+		      if (!p3 || (type_field (p3->type) != ASN1_ETYPE_OBJECT_ID) ||
 			  !(p3->type & CONST_ASSIGN))
 			return ASN1_ELEMENT_NOT_FOUND;
 		      _asn1_set_down (p, p2->right);
@@ -675,9 +675,9 @@ _asn1_expand_object_id (asn1_node node)
 		      p4 = p3->down;
 		      while (p4)
 			{
-			  if (type_field (p4->type) == TYPE_CONSTANT)
+			  if (type_field (p4->type) == ASN1_ETYPE_CONSTANT)
 			    {
-			      p5 = _asn1_add_single_node (TYPE_CONSTANT);
+			      p5 = _asn1_add_single_node (ASN1_ETYPE_CONSTANT);
 			      _asn1_set_name (p5, p4->name);
 			      tlen = _asn1_strlen (p4->value);
 			      if (tlen > 0)
@@ -742,24 +742,24 @@ _asn1_expand_object_id (asn1_node node)
     {
       if (move != UP)
 	{
-	  if ((type_field (p->type) == TYPE_OBJECT_ID) &&
+	  if ((type_field (p->type) == ASN1_ETYPE_OBJECT_ID) &&
 	      (p->type & CONST_DEFAULT))
 	    {
 	      p2 = p->down;
-	      if (p2 && (type_field (p2->type) == TYPE_DEFAULT))
+	      if (p2 && (type_field (p2->type) == ASN1_ETYPE_DEFAULT))
 		{
 		  _asn1_str_cpy (name2, sizeof (name2), name_root);
 		  _asn1_str_cat (name2, sizeof (name2), ".");
 		  _asn1_str_cat (name2, sizeof (name2), (char *) p2->value);
 		  p3 = asn1_find_node (node, name2);
-		  if (!p3 || (type_field (p3->type) != TYPE_OBJECT_ID) ||
+		  if (!p3 || (type_field (p3->type) != ASN1_ETYPE_OBJECT_ID) ||
 		      !(p3->type & CONST_ASSIGN))
 		    return ASN1_ELEMENT_NOT_FOUND;
 		  p4 = p3->down;
 		  name2[0] = 0;
 		  while (p4)
 		    {
-		      if (type_field (p4->type) == TYPE_CONSTANT)
+		      if (type_field (p4->type) == ASN1_ETYPE_CONSTANT)
 			{
 			  if (name2[0])
 			    _asn1_str_cat (name2, sizeof (name2), ".");
@@ -833,12 +833,12 @@ _asn1_type_set_config (asn1_node node)
     {
       if (move != UP)
 	{
-	  if (type_field (p->type) == TYPE_SET)
+	  if (type_field (p->type) == ASN1_ETYPE_SET)
 	    {
 	      p2 = p->down;
 	      while (p2)
 		{
-		  if (type_field (p2->type) != TYPE_TAG)
+		  if (type_field (p2->type) != ASN1_ETYPE_TAG)
 		    p2->type |= CONST_SET | CONST_NOT_USED;
 		  p2 = p2->right;
 		}
@@ -902,7 +902,7 @@ _asn1_check_identifier (asn1_node node)
   p = node;
   while (p)
     {
-      if (type_field (p->type) == TYPE_IDENTIFIER)
+      if (type_field (p->type) == ASN1_ETYPE_IDENTIFIER)
 	{
 	  _asn1_str_cpy (name2, sizeof (name2), node->name);
 	  _asn1_str_cat (name2, sizeof (name2), ".");
@@ -917,29 +917,29 @@ _asn1_check_identifier (asn1_node node)
 	      return ASN1_IDENTIFIER_NOT_FOUND;
 	    }
 	}
-      else if ((type_field (p->type) == TYPE_OBJECT_ID) &&
+      else if ((type_field (p->type) == ASN1_ETYPE_OBJECT_ID) &&
 	       (p->type & CONST_DEFAULT))
 	{
 	  p2 = p->down;
-	  if (p2 && (type_field (p2->type) == TYPE_DEFAULT))
+	  if (p2 && (type_field (p2->type) == ASN1_ETYPE_DEFAULT))
 	    {
 	      _asn1_str_cpy (name2, sizeof (name2), node->name);
 	      _asn1_str_cat (name2, sizeof (name2), ".");
 	      _asn1_str_cat (name2, sizeof (name2), (char *) p2->value);
 	      _asn1_strcpy (_asn1_identifierMissing, p2->value);
 	      p2 = asn1_find_node (node, name2);
-	      if (!p2 || (type_field (p2->type) != TYPE_OBJECT_ID) ||
+	      if (!p2 || (type_field (p2->type) != ASN1_ETYPE_OBJECT_ID) ||
 		  !(p2->type & CONST_ASSIGN))
 		return ASN1_IDENTIFIER_NOT_FOUND;
 	      else
 		_asn1_identifierMissing[0] = 0;
 	    }
 	}
-      else if ((type_field (p->type) == TYPE_OBJECT_ID) &&
+      else if ((type_field (p->type) == ASN1_ETYPE_OBJECT_ID) &&
 	       (p->type & CONST_ASSIGN))
 	{
 	  p2 = p->down;
-	  if (p2 && (type_field (p2->type) == TYPE_CONSTANT))
+	  if (p2 && (type_field (p2->type) == ASN1_ETYPE_CONSTANT))
 	    {
 	      if (p2->value && !isdigit (p2->value[0]))
 		{
@@ -948,7 +948,7 @@ _asn1_check_identifier (asn1_node node)
 		  _asn1_str_cat (name2, sizeof (name2), (char *) p2->value);
 		  _asn1_strcpy (_asn1_identifierMissing, p2->value);
 		  p2 = asn1_find_node (node, name2);
-		  if (!p2 || (type_field (p2->type) != TYPE_OBJECT_ID) ||
+		  if (!p2 || (type_field (p2->type) != ASN1_ETYPE_OBJECT_ID) ||
 		      !(p2->type & CONST_ASSIGN))
 		    return ASN1_IDENTIFIER_NOT_FOUND;
 		  else
@@ -1002,13 +1002,13 @@ _asn1_set_default_tag (asn1_node node)
 {
   asn1_node p;
 
-  if ((node == NULL) || (type_field (node->type) != TYPE_DEFINITIONS))
+  if ((node == NULL) || (type_field (node->type) != ASN1_ETYPE_DEFINITIONS))
     return ASN1_ELEMENT_NOT_FOUND;
 
   p = node;
   while (p)
     {
-      if ((type_field (p->type) == TYPE_TAG) &&
+      if ((type_field (p->type) == ASN1_ETYPE_TAG) &&
 	  !(p->type & CONST_EXPLICIT) && !(p->type & CONST_IMPLICIT))
 	{
 	  if (node->type & CONST_EXPLICIT)
diff --git a/lib/structure.c b/lib/structure.c
index 32be50b..34fd6f0 100644
--- a/lib/structure.c
+++ b/lib/structure.c
@@ -40,7 +40,7 @@ extern char _asn1_identifierMissing[];
 /* Function : _asn1_add_single_node                     */
 /* Description: creates a new NODE_ASN element.       */
 /* Parameters:                                        */
-/*   type: type of the new element (see TYPE_         */
+/*   type: type of the new element (see ASN1_ETYPE_         */
 /*         and CONST_ constants).                     */
 /* Return: pointer to the new element.                */
 /******************************************************/
@@ -457,18 +457,18 @@ _asn1_type_choice_config (asn1_node node)
     {
       if (move != UP)
 	{
-	  if ((type_field (p->type) == TYPE_CHOICE) && (p->type & CONST_TAG))
+	  if ((type_field (p->type) == ASN1_ETYPE_CHOICE) && (p->type & CONST_TAG))
 	    {
 	      p2 = p->down;
 	      while (p2)
 		{
-		  if (type_field (p2->type) != TYPE_TAG)
+		  if (type_field (p2->type) != ASN1_ETYPE_TAG)
 		    {
 		      p2->type |= CONST_TAG;
 		      p3 = _asn1_find_left (p2);
 		      while (p3)
 			{
-			  if (type_field (p3->type) == TYPE_TAG)
+			  if (type_field (p3->type) == ASN1_ETYPE_TAG)
 			    {
 			      p4 = _asn1_add_single_node (p3->type);
 			      tlen = _asn1_strlen (p3->value);
@@ -487,7 +487,7 @@ _asn1_type_choice_config (asn1_node node)
 	      while (p2)
 		{
 		  p3 = p2->right;
-		  if (type_field (p2->type) == TYPE_TAG)
+		  if (type_field (p2->type) == ASN1_ETYPE_TAG)
 		    asn1_delete_structure (&p2);
 		  p2 = p3;
 		}
@@ -543,7 +543,7 @@ _asn1_expand_identifier (asn1_node * node, asn1_node root)
     {
       if (move != UP)
 	{
-	  if (type_field (p->type) == TYPE_IDENTIFIER)
+	  if (type_field (p->type) == ASN1_ETYPE_IDENTIFIER)
 	    {
 	      snprintf(name2, sizeof (name2), "%s.%s", root->name, p->value);
 	      p2 = _asn1_copy_structure2 (root, name2);
@@ -715,9 +715,9 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 	{
 	  switch (type_field (p->type))
 	    {
-	    case TYPE_CONSTANT:
-	    case TYPE_TAG:
-	    case TYPE_SIZE:
+	    case ASN1_ETYPE_CONSTANT:
+	    case ASN1_ETYPE_TAG:
+	    case ASN1_ETYPE_SIZE:
 	      break;
 	    default:
 	      for (k = 0; k < indent; k++)
@@ -734,70 +734,94 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 	{
 	  switch (type_field (p->type))
 	    {
-	    case TYPE_CONSTANT:
+	    case ASN1_ETYPE_CONSTANT:
 	      if (mode == ASN1_PRINT_ALL)
 		fprintf (out, "type:CONST");
 	      break;
-	    case TYPE_TAG:
+	    case ASN1_ETYPE_TAG:
 	      if (mode == ASN1_PRINT_ALL)
 		fprintf (out, "type:TAG");
 	      break;
-	    case TYPE_SIZE:
+	    case ASN1_ETYPE_SIZE:
 	      if (mode == ASN1_PRINT_ALL)
 		fprintf (out, "type:SIZE");
 	      break;
-	    case TYPE_DEFAULT:
+	    case ASN1_ETYPE_DEFAULT:
 	      fprintf (out, "type:DEFAULT");
 	      break;
-	    case TYPE_NULL:
+	    case ASN1_ETYPE_NULL:
 	      fprintf (out, "type:NULL");
 	      break;
-	    case TYPE_IDENTIFIER:
+	    case ASN1_ETYPE_IDENTIFIER:
 	      fprintf (out, "type:IDENTIFIER");
 	      break;
-	    case TYPE_INTEGER:
+	    case ASN1_ETYPE_INTEGER:
 	      fprintf (out, "type:INTEGER");
 	      break;
-	    case TYPE_ENUMERATED:
+	    case ASN1_ETYPE_ENUMERATED:
 	      fprintf (out, "type:ENUMERATED");
 	      break;
-	    case TYPE_TIME:
+	    case ASN1_ETYPE_TIME:
 	      fprintf (out, "type:TIME");
 	      break;
-	    case TYPE_BOOLEAN:
+	    case ASN1_ETYPE_BOOLEAN:
 	      fprintf (out, "type:BOOLEAN");
 	      break;
-	    case TYPE_SEQUENCE:
+	    case ASN1_ETYPE_SEQUENCE:
 	      fprintf (out, "type:SEQUENCE");
 	      break;
-	    case TYPE_BIT_STRING:
+	    case ASN1_ETYPE_BIT_STRING:
 	      fprintf (out, "type:BIT_STR");
 	      break;
-	    case TYPE_OCTET_STRING:
+	    case ASN1_ETYPE_OCTET_STRING:
 	      fprintf (out, "type:OCT_STR");
 	      break;
-	    case TYPE_GENERALSTRING:
+	    case ASN1_ETYPE_GENERALSTRING:
 	      fprintf (out, "type:GENERALSTRING");
 	      break;
-	    case TYPE_SEQUENCE_OF:
+	    case ASN1_ETYPE_NUMERICSTRING:
+	      fprintf (out, "type:NUMERICSTRING");
+	      break;
+	    case ASN1_ETYPE_IA5STRING:
+	      fprintf (out, "type:IA5STRING");
+	      break;
+	    case ASN1_ETYPE_TELETEXSTRING:
+	      fprintf (out, "type:TELETEXSTRING");
+	      break;
+	    case ASN1_ETYPE_PRINTABLESTRING:
+	      fprintf (out, "type:PRINTABLESTRING");
+	      break;
+	    case ASN1_ETYPE_UNIVERSALSTRING:
+	      fprintf (out, "type:UNIVERSALSTRING");
+	      break;
+	    case ASN1_ETYPE_BMPSTRING:
+	      fprintf (out, "type:BMPSTRING");
+	      break;
+	    case ASN1_ETYPE_UTF8STRING:
+	      fprintf (out, "type:UTF8STRING");
+	      break;
+	    case ASN1_ETYPE_VISIBLESTRING:
+	      fprintf (out, "type:VISIBLESTRING");
+	      break;
+	    case ASN1_ETYPE_SEQUENCE_OF:
 	      fprintf (out, "type:SEQ_OF");
 	      break;
-	    case TYPE_OBJECT_ID:
+	    case ASN1_ETYPE_OBJECT_ID:
 	      fprintf (out, "type:OBJ_ID");
 	      break;
-	    case TYPE_ANY:
+	    case ASN1_ETYPE_ANY:
 	      fprintf (out, "type:ANY");
 	      break;
-	    case TYPE_SET:
+	    case ASN1_ETYPE_SET:
 	      fprintf (out, "type:SET");
 	      break;
-	    case TYPE_SET_OF:
+	    case ASN1_ETYPE_SET_OF:
 	      fprintf (out, "type:SET_OF");
 	      break;
-	    case TYPE_CHOICE:
+	    case ASN1_ETYPE_CHOICE:
 	      fprintf (out, "type:CHOICE");
 	      break;
-	    case TYPE_DEFINITIONS:
+	    case ASN1_ETYPE_DEFINITIONS:
 	      fprintf (out, "type:DEFINITIONS");
 	      break;
 	    default:
@@ -809,22 +833,22 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 	{
 	  switch (type_field (p->type))
 	    {
-	    case TYPE_CONSTANT:
+	    case ASN1_ETYPE_CONSTANT:
 	      if (mode == ASN1_PRINT_ALL)
 		if (p->value)
 		  fprintf (out, "  value:%s", p->value);
 	      break;
-	    case TYPE_TAG:
+	    case ASN1_ETYPE_TAG:
 	      if (mode == ASN1_PRINT_ALL)
 		if (p->value)
 		  fprintf (out, "  value:%s", p->value);
 	      break;
-	    case TYPE_SIZE:
+	    case ASN1_ETYPE_SIZE:
 	      if (mode == ASN1_PRINT_ALL)
 		if (p->value)
 		  fprintf (out, "  value:%s", p->value);
 	      break;
-	    case TYPE_DEFAULT:
+	    case ASN1_ETYPE_DEFAULT:
 	      if (p->value)
 		fprintf (out, "  value:%s", p->value);
 	      else if (p->type & CONST_TRUE)
@@ -832,11 +856,11 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 	      else if (p->type & CONST_FALSE)
 		fprintf (out, "  value:FALSE");
 	      break;
-	    case TYPE_IDENTIFIER:
+	    case ASN1_ETYPE_IDENTIFIER:
 	      if (p->value)
 		fprintf (out, "  value:%s", p->value);
 	      break;
-	    case TYPE_INTEGER:
+	    case ASN1_ETYPE_INTEGER:
 	      if (p->value)
 		{
 		  len2 = -1;
@@ -847,7 +871,7 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 		      fprintf (out, "%02x", (p->value)[k + len2]);
 		}
 	      break;
-	    case TYPE_ENUMERATED:
+	    case ASN1_ETYPE_ENUMERATED:
 	      if (p->value)
 		{
 		  len2 = -1;
@@ -858,11 +882,11 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 		      fprintf (out, "%02x", (p->value)[k + len2]);
 		}
 	      break;
-	    case TYPE_TIME:
+	    case ASN1_ETYPE_TIME:
 	      if (p->value)
 		fprintf (out, "  value:%s", p->value);
 	      break;
-	    case TYPE_BOOLEAN:
+	    case ASN1_ETYPE_BOOLEAN:
 	      if (p->value)
 		{
 		  if (p->value[0] == 'T')
@@ -871,7 +895,7 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 		    fprintf (out, "  value:FALSE");
 		}
 	      break;
-	    case TYPE_BIT_STRING:
+	    case ASN1_ETYPE_BIT_STRING:
 	      if (p->value)
 		{
 		  len2 = -1;
@@ -885,18 +909,16 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 		    }
 		}
 	      break;
-	    case TYPE_OCTET_STRING:
-	      if (p->value)
-		{
-		  len2 = -1;
-		  len = asn1_get_length_der (p->value, p->value_len, &len2);
-		  fprintf (out, "  value:");
-		  if (len > 0)
-		    for (k = 0; k < len; k++)
-		      fprintf (out, "%02x", (p->value)[k + len2]);
-		}
-	      break;
-	    case TYPE_GENERALSTRING:
+	    case ASN1_ETYPE_OCTET_STRING:
+	    case ASN1_ETYPE_GENERALSTRING:
+	    case ASN1_ETYPE_NUMERICSTRING:
+	    case ASN1_ETYPE_IA5STRING:
+	    case ASN1_ETYPE_TELETEXSTRING:
+	    case ASN1_ETYPE_PRINTABLESTRING:
+	    case ASN1_ETYPE_UNIVERSALSTRING:
+	    case ASN1_ETYPE_BMPSTRING:
+	    case ASN1_ETYPE_UTF8STRING:
+	    case ASN1_ETYPE_VISIBLESTRING:
 	      if (p->value)
 		{
 		  len2 = -1;
@@ -907,11 +929,11 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 		      fprintf (out, "%02x", (p->value)[k + len2]);
 		}
 	      break;
-	    case TYPE_OBJECT_ID:
+	    case ASN1_ETYPE_OBJECT_ID:
 	      if (p->value)
 		fprintf (out, "  value:%s", p->value);
 	      break;
-	    case TYPE_ANY:
+	    case ASN1_ETYPE_ANY:
 	      if (p->value)
 		{
 		  len3 = -1;
@@ -922,13 +944,13 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 		      fprintf (out, "%02x", (p->value)[k + len3]);
 		}
 	      break;
-	    case TYPE_SET:
-	    case TYPE_SET_OF:
-	    case TYPE_CHOICE:
-	    case TYPE_DEFINITIONS:
-	    case TYPE_SEQUENCE_OF:
-	    case TYPE_SEQUENCE:
-	    case TYPE_NULL:
+	    case ASN1_ETYPE_SET:
+	    case ASN1_ETYPE_SET_OF:
+	    case ASN1_ETYPE_CHOICE:
+	    case ASN1_ETYPE_DEFINITIONS:
+	    case ASN1_ETYPE_SEQUENCE_OF:
+	    case ASN1_ETYPE_SEQUENCE:
+	    case ASN1_ETYPE_NULL:
 	      break;
 	    default:
 	      break;
@@ -991,9 +1013,9 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 	{
 	  switch (type_field (p->type))
 	    {
-	    case TYPE_CONSTANT:
-	    case TYPE_TAG:
-	    case TYPE_SIZE:
+	    case ASN1_ETYPE_CONSTANT:
+	    case ASN1_ETYPE_TAG:
+	    case ASN1_ETYPE_SIZE:
 	      break;
 	    default:
 	      fprintf (out, "\n");
@@ -1105,7 +1127,7 @@ asn1_find_structure_from_oid (asn1_node definitions, const char *oidValue)
   p = definitions->down;
   while (p)
     {
-      if ((type_field (p->type) == TYPE_OBJECT_ID) &&
+      if ((type_field (p->type) == ASN1_ETYPE_OBJECT_ID) &&
 	  (p->type & CONST_ASSIGN))
 	{
 	  strcpy (name, definitionsName);
diff --git a/tests/Test_parser.c b/tests/Test_parser.c
index 4adb0bf..4ba1636 100644
--- a/tests/Test_parser.c
+++ b/tests/Test_parser.c
@@ -47,7 +47,7 @@ test_type test_array[] = {
   /* Test DEFINITIONS syntax */
   {5,
    "TEST_PARSER2 { } DEFINITIONS IMPLICIT TAGS ::= BEGIN int1 ::= INTEGER END",
-   ASN1_SYNTAX_ERROR, _FILE_ ":6: parse error near 'TEST_PARSER'"},
+   ASN1_SYNTAX_ERROR, _FILE_ ":6: Error: syntax error, unexpected IDENTIFIER, expecting $end near 'TEST_PARSER'"},
   {6, "TEST_PARSER { }", ASN1_SUCCESS, ""},
 
   /* Test ASN1_MAX_NAME_SIZE (128) */
@@ -79,13 +79,13 @@ test_type test_array[] = {
   {14, "int1 [1] IMPLICIT INTEGER,", ASN1_SUCCESS, ""},
   {12, "Integer ::= [1] EXPLICIT INTEGER {v1(-1), v2(1)}", ASN1_SUCCESS, ""},
   {12, "Integer ::= INTEGER {v1(0), v2}",
-   ASN1_SYNTAX_ERROR, _FILE_ ":12: parse error near '}'"},
+   ASN1_SYNTAX_ERROR, _FILE_ ":12: Error: syntax error, unexpected '}', expecting '(' near '}'"},
   {12, "Integer ::= INTEGER {v1(0), 1}",
-   ASN1_SYNTAX_ERROR, _FILE_ ":12: parse error near '1'"},
+   ASN1_SYNTAX_ERROR, _FILE_ ":12: Error: syntax error, unexpected NUM, expecting IDENTIFIER or '(' near '1'"},
   {12, "const1 INTEGER ::= -1", ASN1_SUCCESS, ""},
   {12, "const1 INTEGER ::= 1", ASN1_SUCCESS, ""},
   {12, "const1 INTEGER ::= v1",
-   ASN1_SYNTAX_ERROR, _FILE_ ":12: parse error near 'v1'"},
+   ASN1_SYNTAX_ERROR, _FILE_ ":12: Error: syntax error, unexpected IDENTIFIER, expecting NUM or '+' or '-' near 'v1'"},
   {16, " generic generalstring",
    ASN1_IDENTIFIER_NOT_FOUND,
    _FILE_ ":: identifier 'generalstring' not found"},
@@ -96,7 +96,7 @@ test_type test_array[] = {
   {20, "   oid1    OBJECT IDENTIFIER DEFAULT 1",
    ASN1_IDENTIFIER_NOT_FOUND, _FILE_ ":: identifier '1' not found"},
   {20, "   oid1    OBJECT IDENTIFIER DEFAULT",
-   ASN1_SYNTAX_ERROR, _FILE_ ":21: parse error near '}'"},
+   ASN1_SYNTAX_ERROR, _FILE_ ":21: Error: syntax error, unexpected '}' near '}'"},
   {20, "   oid1    OBJECT IDENTIFIER DEFAULT Oid-type1",
    ASN1_SUCCESS, ""},
 
@@ -208,6 +208,7 @@ main (int argc, char *argv[])
 		  asn1_strerror (test->errorNumber), test->errorDescription);
 	  printf ("  Error detected: %s - %s\n\n", asn1_strerror (result),
 		  errorDescription);
+          exit(1);
 	}
 
       test++;


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Thu Nov 22 13:39:43 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Tbbgd-0003ld-Lp
	for mharc-libtasn1-commit@gnu.org; Thu, 22 Nov 2012 13:39:43 -0500
Received: from eggs.gnu.org ([208.118.235.92]:36563)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TbbgX-0003lE-28
	for libtasn1-commit@gnu.org; Thu, 22 Nov 2012 13:39:41 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TbbgQ-0005Kg-TN
	for libtasn1-commit@gnu.org; Thu, 22 Nov 2012 13:39:37 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:35638)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TbbgQ-0005KZ-Q6
	for libtasn1-commit@gnu.org; Thu, 22 Nov 2012 13:39:30 -0500
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TbbgQ-0002tl-DJ
	for libtasn1-commit@gnu.org; Thu, 22 Nov 2012 18:39:30 +0000
Date: Thu, 22 Nov 2012 18:39:30 +0000
Message-Id: <E1TbbgQ-0002tl-DJ@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_0-14-geba04f5
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 3b545f01f74778112769ef1a1225324d6428423a
X-Git-Newrev: eba04f5f91b62c33a800ed8cf3325a4d82e12dd5
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 22 Nov 2012 18:39:41 -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=eba04f5f91b62c33a800ed8cf3325a4d82e12dd5

The branch, master has been updated
       via  eba04f5f91b62c33a800ed8cf3325a4d82e12dd5 (commit)
      from  3b545f01f74778112769ef1a1225324d6428423a (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 eba04f5f91b62c33a800ed8cf3325a4d82e12dd5
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Thu Nov 22 19:38:38 2012 +0100

    small simplifications

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

Summary of changes:
 lib/coding.c    |   61 +++++++++++++++++---------------------------------
 lib/decoding.c  |    3 +-
 lib/element.c   |   21 +----------------
 lib/int.h       |   24 ++++++++++++++++++++
 lib/structure.c |   66 ++++--------------------------------------------------
 5 files changed, 53 insertions(+), 122 deletions(-)

diff --git a/lib/coding.c b/lib/coding.c
index af5c1b7..ba59257 100644
--- a/lib/coding.c
+++ b/lib/coding.c
@@ -431,26 +431,26 @@ _asn1_complete_explicit_tag (asn1_node node, unsigned char *der,
 
 tag_and_class_st _asn1_tags[] =
 {
-  [ASN1_ETYPE_GENERALSTRING] = {ASN1_TAG_GENERALSTRING, ASN1_CLASS_UNIVERSAL},
-  [ASN1_ETYPE_NUMERICSTRING] = {ASN1_TAG_NUMERICSTRING, ASN1_CLASS_UNIVERSAL},
-  [ASN1_ETYPE_IA5STRING] =     {ASN1_TAG_IA5STRING, ASN1_CLASS_UNIVERSAL},
-  [ASN1_ETYPE_TELETEXSTRING] = {ASN1_TAG_TELETEXSTRING, ASN1_CLASS_UNIVERSAL},
-  [ASN1_ETYPE_PRINTABLESTRING] = {ASN1_TAG_PRINTABLESTRING, ASN1_CLASS_UNIVERSAL},
-  [ASN1_ETYPE_UNIVERSALSTRING] = {ASN1_TAG_UNIVERSALSTRING, ASN1_CLASS_UNIVERSAL},
-  [ASN1_ETYPE_BMPSTRING] =     {ASN1_TAG_BMPSTRING, ASN1_CLASS_UNIVERSAL},
-  [ASN1_ETYPE_UTF8STRING] =    {ASN1_TAG_UTF8STRING, ASN1_CLASS_UNIVERSAL},
-  [ASN1_ETYPE_VISIBLESTRING] = {ASN1_TAG_VISIBLESTRING, ASN1_CLASS_UNIVERSAL},
-  [ASN1_ETYPE_OCTET_STRING] = {ASN1_TAG_OCTET_STRING, ASN1_CLASS_UNIVERSAL},
-  [ASN1_ETYPE_BIT_STRING] = {ASN1_TAG_BIT_STRING, ASN1_CLASS_UNIVERSAL},
-  [ASN1_ETYPE_OBJECT_ID] =  {ASN1_TAG_OBJECT_ID, ASN1_CLASS_UNIVERSAL},
-  [ASN1_ETYPE_NULL] =       {ASN1_TAG_NULL, ASN1_CLASS_UNIVERSAL},
-  [ASN1_ETYPE_BOOLEAN] =    {ASN1_TAG_BOOLEAN, ASN1_CLASS_UNIVERSAL},
-  [ASN1_ETYPE_INTEGER] =    {ASN1_TAG_INTEGER, ASN1_CLASS_UNIVERSAL},
-  [ASN1_ETYPE_ENUMERATED] = {ASN1_TAG_ENUMERATED, ASN1_CLASS_UNIVERSAL},
-  [ASN1_ETYPE_SEQUENCE] =   {ASN1_TAG_SEQUENCE, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED},
-  [ASN1_ETYPE_SEQUENCE_OF] ={ASN1_TAG_SEQUENCE, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED},
-  [ASN1_ETYPE_SET] =        {ASN1_TAG_SET, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED},
-  [ASN1_ETYPE_SET_OF] =     {ASN1_TAG_SET, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED},
+  [ASN1_ETYPE_GENERALSTRING] = {ASN1_TAG_GENERALSTRING, ASN1_CLASS_UNIVERSAL, "type:GENERALSTRING"},
+  [ASN1_ETYPE_NUMERICSTRING] = {ASN1_TAG_NUMERICSTRING, ASN1_CLASS_UNIVERSAL, "type:NUMERIC_STR"},
+  [ASN1_ETYPE_IA5STRING] =     {ASN1_TAG_IA5STRING, ASN1_CLASS_UNIVERSAL, "type:IA5_STR"},
+  [ASN1_ETYPE_TELETEXSTRING] = {ASN1_TAG_TELETEXSTRING, ASN1_CLASS_UNIVERSAL, "type:TELETEX_STR"},
+  [ASN1_ETYPE_PRINTABLESTRING] = {ASN1_TAG_PRINTABLESTRING, ASN1_CLASS_UNIVERSAL, "type:PRINTABLE_STR"},
+  [ASN1_ETYPE_UNIVERSALSTRING] = {ASN1_TAG_UNIVERSALSTRING, ASN1_CLASS_UNIVERSAL, "type:UNIVERSAL_STR"},
+  [ASN1_ETYPE_BMPSTRING] =     {ASN1_TAG_BMPSTRING, ASN1_CLASS_UNIVERSAL, "type:BMP_STR"},
+  [ASN1_ETYPE_UTF8STRING] =    {ASN1_TAG_UTF8STRING, ASN1_CLASS_UNIVERSAL, "type:UTF8_STR"},
+  [ASN1_ETYPE_VISIBLESTRING] = {ASN1_TAG_VISIBLESTRING, ASN1_CLASS_UNIVERSAL, "type:VISIBLE_STR"},
+  [ASN1_ETYPE_OCTET_STRING] = {ASN1_TAG_OCTET_STRING, ASN1_CLASS_UNIVERSAL, "type:OCT_STR"},
+  [ASN1_ETYPE_BIT_STRING] = {ASN1_TAG_BIT_STRING, ASN1_CLASS_UNIVERSAL, "type:BIT_STR"},
+  [ASN1_ETYPE_OBJECT_ID] =  {ASN1_TAG_OBJECT_ID, ASN1_CLASS_UNIVERSAL, "type:OBJ_STR"},
+  [ASN1_ETYPE_NULL] =       {ASN1_TAG_NULL, ASN1_CLASS_UNIVERSAL, "type:NULL"},
+  [ASN1_ETYPE_BOOLEAN] =    {ASN1_TAG_BOOLEAN, ASN1_CLASS_UNIVERSAL, "type:BOOLEAN"},
+  [ASN1_ETYPE_INTEGER] =    {ASN1_TAG_INTEGER, ASN1_CLASS_UNIVERSAL, "type:INTEGER"},
+  [ASN1_ETYPE_ENUMERATED] = {ASN1_TAG_ENUMERATED, ASN1_CLASS_UNIVERSAL, "type:ENUMERATED"},
+  [ASN1_ETYPE_SEQUENCE] =   {ASN1_TAG_SEQUENCE, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED, "type:SEQUENCE"},
+  [ASN1_ETYPE_SEQUENCE_OF] ={ASN1_TAG_SEQUENCE, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED, "type:SEQ_OF"},
+  [ASN1_ETYPE_SET] =        {ASN1_TAG_SET, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED, "type:SET"},
+  [ASN1_ETYPE_SET_OF] =     {ASN1_TAG_SET, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED, "type:SET_OF"},
 };
 
 /******************************************************/
@@ -554,26 +554,7 @@ _asn1_insert_tag_der (asn1_node node, unsigned char *der, int *counter,
 	    _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_GENERALIZEDTime,
 			   tag_der, &tag_len);
 	  break;
-	case ASN1_ETYPE_OBJECT_ID:
-	case ASN1_ETYPE_OCTET_STRING:
-	case ASN1_ETYPE_GENERALSTRING:
-	case ASN1_ETYPE_NUMERICSTRING:
-	case ASN1_ETYPE_IA5STRING:
-	case ASN1_ETYPE_TELETEXSTRING:
-	case ASN1_ETYPE_PRINTABLESTRING:
-	case ASN1_ETYPE_UNIVERSALSTRING:
-	case ASN1_ETYPE_BMPSTRING:
-	case ASN1_ETYPE_UTF8STRING:
-	case ASN1_ETYPE_VISIBLESTRING:
-	case ASN1_ETYPE_BIT_STRING:
-	case ASN1_ETYPE_NULL:
-	case ASN1_ETYPE_BOOLEAN:
-	case ASN1_ETYPE_INTEGER:
-	case ASN1_ETYPE_ENUMERATED:
-	case ASN1_ETYPE_SEQUENCE:
-	case ASN1_ETYPE_SEQUENCE_OF:
-	case ASN1_ETYPE_SET:
-	case ASN1_ETYPE_SET_OF:
+        CASE_TAGGED_TYPES:
 	  _asn1_tag_der (_asn1_tags[type].class, _asn1_tags[type].tag,
 			 tag_der, &tag_len);
 	  break;
diff --git a/lib/decoding.c b/lib/decoding.c
index 5a844b8..eb4ca0e 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -531,7 +531,8 @@ _asn1_extract_tag_der (asn1_node node, const unsigned char *der, int der_len,
 	  break;
 
 	case ASN1_ETYPE_OCTET_STRING:
-	  /* does it need to be structured??? --nmav */
+	  /* OCTET STRING is handled differently to allow
+	   * BER encodings (structured class). */
 	  if (((class != ASN1_CLASS_UNIVERSAL)
 	       && (class != (ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED)))
 	      || (tag != ASN1_TAG_OCTET_STRING))
diff --git a/lib/element.c b/lib/element.c
index 2c6a2fd..f1d002e 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -926,26 +926,7 @@ asn1_read_tag (asn1_node root, const char *name, int *tagValue,
 
       switch (type)
 	{
-	case ASN1_ETYPE_NULL:
-	case ASN1_ETYPE_BOOLEAN:
-	case ASN1_ETYPE_INTEGER:
-	case ASN1_ETYPE_ENUMERATED:
-	case ASN1_ETYPE_OBJECT_ID:
-	case ASN1_ETYPE_OCTET_STRING:
-	case ASN1_ETYPE_GENERALSTRING:
-        case ASN1_ETYPE_NUMERICSTRING:
-        case ASN1_ETYPE_IA5STRING:
-        case ASN1_ETYPE_TELETEXSTRING:
-        case ASN1_ETYPE_PRINTABLESTRING:
-        case ASN1_ETYPE_UNIVERSALSTRING:
-        case ASN1_ETYPE_BMPSTRING:
-        case ASN1_ETYPE_UTF8STRING:
-        case ASN1_ETYPE_VISIBLESTRING:
-	case ASN1_ETYPE_BIT_STRING:
-	case ASN1_ETYPE_SEQUENCE:
-	case ASN1_ETYPE_SEQUENCE_OF:
-	case ASN1_ETYPE_SET:
-	case ASN1_ETYPE_SET_OF:
+	CASE_TAGGED_TYPES:
 	  *tagValue = _asn1_tags[type].tag;
 	  break;
 	case ASN1_ETYPE_TIME:
diff --git a/lib/int.h b/lib/int.h
index 7791906..7dedd88 100644
--- a/lib/int.h
+++ b/lib/int.h
@@ -61,8 +61,32 @@ struct asn1_node_st
 typedef struct tag_and_class_st {
   unsigned tag;
   unsigned class;
+  const char* desc;
 } tag_and_class_st;
 
+/* the types that are handled in _asn1_tags */
+#define CASE_TAGGED_TYPES \
+	case ASN1_ETYPE_NULL: \
+	case ASN1_ETYPE_BOOLEAN: \
+	case ASN1_ETYPE_INTEGER: \
+	case ASN1_ETYPE_ENUMERATED: \
+	case ASN1_ETYPE_OBJECT_ID: \
+	case ASN1_ETYPE_OCTET_STRING: \
+	case ASN1_ETYPE_GENERALSTRING: \
+        case ASN1_ETYPE_NUMERICSTRING: \
+        case ASN1_ETYPE_IA5STRING: \
+        case ASN1_ETYPE_TELETEXSTRING: \
+        case ASN1_ETYPE_PRINTABLESTRING: \
+        case ASN1_ETYPE_UNIVERSALSTRING: \
+        case ASN1_ETYPE_BMPSTRING: \
+        case ASN1_ETYPE_UTF8STRING: \
+        case ASN1_ETYPE_VISIBLESTRING: \
+	case ASN1_ETYPE_BIT_STRING: \
+	case ASN1_ETYPE_SEQUENCE: \
+	case ASN1_ETYPE_SEQUENCE_OF: \
+	case ASN1_ETYPE_SET: \
+	case ASN1_ETYPE_SET_OF
+
 extern tag_and_class_st _asn1_tags[];
 
 #define _asn1_strlen(s) strlen((const char *) s)
diff --git a/lib/structure.c b/lib/structure.c
index 34fd6f0..eee15a3 100644
--- a/lib/structure.c
+++ b/lib/structure.c
@@ -732,7 +732,8 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 
       if (mode != ASN1_PRINT_NAME)
 	{
-	  switch (type_field (p->type))
+	  unsigned type = type_field (p->type);
+	  switch (type)
 	    {
 	    case ASN1_ETYPE_CONSTANT:
 	      if (mode == ASN1_PRINT_ALL)
@@ -749,81 +750,24 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 	    case ASN1_ETYPE_DEFAULT:
 	      fprintf (out, "type:DEFAULT");
 	      break;
-	    case ASN1_ETYPE_NULL:
-	      fprintf (out, "type:NULL");
-	      break;
 	    case ASN1_ETYPE_IDENTIFIER:
 	      fprintf (out, "type:IDENTIFIER");
 	      break;
-	    case ASN1_ETYPE_INTEGER:
-	      fprintf (out, "type:INTEGER");
-	      break;
-	    case ASN1_ETYPE_ENUMERATED:
-	      fprintf (out, "type:ENUMERATED");
-	      break;
 	    case ASN1_ETYPE_TIME:
 	      fprintf (out, "type:TIME");
 	      break;
-	    case ASN1_ETYPE_BOOLEAN:
-	      fprintf (out, "type:BOOLEAN");
-	      break;
-	    case ASN1_ETYPE_SEQUENCE:
-	      fprintf (out, "type:SEQUENCE");
-	      break;
-	    case ASN1_ETYPE_BIT_STRING:
-	      fprintf (out, "type:BIT_STR");
-	      break;
-	    case ASN1_ETYPE_OCTET_STRING:
-	      fprintf (out, "type:OCT_STR");
-	      break;
-	    case ASN1_ETYPE_GENERALSTRING:
-	      fprintf (out, "type:GENERALSTRING");
-	      break;
-	    case ASN1_ETYPE_NUMERICSTRING:
-	      fprintf (out, "type:NUMERICSTRING");
-	      break;
-	    case ASN1_ETYPE_IA5STRING:
-	      fprintf (out, "type:IA5STRING");
-	      break;
-	    case ASN1_ETYPE_TELETEXSTRING:
-	      fprintf (out, "type:TELETEXSTRING");
-	      break;
-	    case ASN1_ETYPE_PRINTABLESTRING:
-	      fprintf (out, "type:PRINTABLESTRING");
-	      break;
-	    case ASN1_ETYPE_UNIVERSALSTRING:
-	      fprintf (out, "type:UNIVERSALSTRING");
-	      break;
-	    case ASN1_ETYPE_BMPSTRING:
-	      fprintf (out, "type:BMPSTRING");
-	      break;
-	    case ASN1_ETYPE_UTF8STRING:
-	      fprintf (out, "type:UTF8STRING");
-	      break;
-	    case ASN1_ETYPE_VISIBLESTRING:
-	      fprintf (out, "type:VISIBLESTRING");
-	      break;
-	    case ASN1_ETYPE_SEQUENCE_OF:
-	      fprintf (out, "type:SEQ_OF");
-	      break;
-	    case ASN1_ETYPE_OBJECT_ID:
-	      fprintf (out, "type:OBJ_ID");
-	      break;
 	    case ASN1_ETYPE_ANY:
 	      fprintf (out, "type:ANY");
 	      break;
-	    case ASN1_ETYPE_SET:
-	      fprintf (out, "type:SET");
-	      break;
-	    case ASN1_ETYPE_SET_OF:
-	      fprintf (out, "type:SET_OF");
-	      break;
 	    case ASN1_ETYPE_CHOICE:
 	      fprintf (out, "type:CHOICE");
 	      break;
 	    case ASN1_ETYPE_DEFINITIONS:
 	      fprintf (out, "type:DEFINITIONS");
 	      break;
+            CASE_TAGGED_TYPES:
+	      fprintf (out, "%s", _asn1_tags[type].desc);
+	      break;
 	    default:
 	      break;
 	    }


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Thu Nov 22 13:43:09 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Tbbjw-0005TQ-Vx
	for mharc-libtasn1-commit@gnu.org; Thu, 22 Nov 2012 13:43:08 -0500
Received: from eggs.gnu.org ([208.118.235.92]:38883)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Tbbjq-0005Sz-2V
	for libtasn1-commit@gnu.org; Thu, 22 Nov 2012 13:43:07 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Tbbjk-0006cA-9f
	for libtasn1-commit@gnu.org; Thu, 22 Nov 2012 13:43:02 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:36641)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Tbbjk-0006c6-6N
	for libtasn1-commit@gnu.org; Thu, 22 Nov 2012 13:42:56 -0500
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Tbbjj-00036A-SA
	for libtasn1-commit@gnu.org; Thu, 22 Nov 2012 18:42:56 +0000
Date: Thu, 22 Nov 2012 18:42:55 +0000
Message-Id: <E1Tbbjj-00036A-SA@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_0-15-gf9e6e03
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: eba04f5f91b62c33a800ed8cf3325a4d82e12dd5
X-Git-Newrev: f9e6e03a14d7409cda2df5f231bc3e0a9a254d42
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 22 Nov 2012 18:43:07 -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=f9e6e03a14d7409cda2df5f231bc3e0a9a254d42

The branch, master has been updated
       via  f9e6e03a14d7409cda2df5f231bc3e0a9a254d42 (commit)
      from  eba04f5f91b62c33a800ed8cf3325a4d82e12dd5 (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 f9e6e03a14d7409cda2df5f231bc3e0a9a254d42
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Thu Nov 22 19:42:47 2012 +0100

    better name

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

Summary of changes:
 lib/coding.c    |    2 +-
 lib/element.c   |    2 +-
 lib/int.h       |    2 +-
 lib/structure.c |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/coding.c b/lib/coding.c
index ba59257..5d98fe4 100644
--- a/lib/coding.c
+++ b/lib/coding.c
@@ -554,7 +554,7 @@ _asn1_insert_tag_der (asn1_node node, unsigned char *der, int *counter,
 	    _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_GENERALIZEDTime,
 			   tag_der, &tag_len);
 	  break;
-        CASE_TAGGED_TYPES:
+        CASE_HANDLED_ETYPES:
 	  _asn1_tag_der (_asn1_tags[type].class, _asn1_tags[type].tag,
 			 tag_der, &tag_len);
 	  break;
diff --git a/lib/element.c b/lib/element.c
index f1d002e..f85fb2f 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -926,7 +926,7 @@ asn1_read_tag (asn1_node root, const char *name, int *tagValue,
 
       switch (type)
 	{
-	CASE_TAGGED_TYPES:
+	CASE_HANDLED_ETYPES:
 	  *tagValue = _asn1_tags[type].tag;
 	  break;
 	case ASN1_ETYPE_TIME:
diff --git a/lib/int.h b/lib/int.h
index 7dedd88..0761025 100644
--- a/lib/int.h
+++ b/lib/int.h
@@ -65,7 +65,7 @@ typedef struct tag_and_class_st {
 } tag_and_class_st;
 
 /* the types that are handled in _asn1_tags */
-#define CASE_TAGGED_TYPES \
+#define CASE_HANDLED_ETYPES \
 	case ASN1_ETYPE_NULL: \
 	case ASN1_ETYPE_BOOLEAN: \
 	case ASN1_ETYPE_INTEGER: \
diff --git a/lib/structure.c b/lib/structure.c
index eee15a3..9136799 100644
--- a/lib/structure.c
+++ b/lib/structure.c
@@ -765,7 +765,7 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 	    case ASN1_ETYPE_DEFINITIONS:
 	      fprintf (out, "type:DEFINITIONS");
 	      break;
-            CASE_TAGGED_TYPES:
+            CASE_HANDLED_ETYPES:
 	      fprintf (out, "%s", _asn1_tags[type].desc);
 	      break;
 	    default:


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Thu Nov 22 13:45:51 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TbbmZ-0005rG-DR
	for mharc-libtasn1-commit@gnu.org; Thu, 22 Nov 2012 13:45:51 -0500
Received: from eggs.gnu.org ([208.118.235.92]:37389)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TbbmS-0005qj-Id
	for libtasn1-commit@gnu.org; Thu, 22 Nov 2012 13:45:50 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TbbmR-0007pZ-3n
	for libtasn1-commit@gnu.org; Thu, 22 Nov 2012 13:45:44 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:36763)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TbbmQ-0007pM-Mr
	for libtasn1-commit@gnu.org; Thu, 22 Nov 2012 13:45:42 -0500
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TbbmQ-0003Od-70
	for libtasn1-commit@gnu.org; Thu, 22 Nov 2012 18:45:42 +0000
Date: Thu, 22 Nov 2012 18:45:42 +0000
Message-Id: <E1TbbmQ-0003Od-70@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_0-17-g28a038f
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: f9e6e03a14d7409cda2df5f231bc3e0a9a254d42
X-Git-Newrev: 28a038f45620bf885f791e1e2d0505714fe2222f
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 22 Nov 2012 18:45:50 -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=28a038f45620bf885f791e1e2d0505714fe2222f

The branch, master has been updated
       via  28a038f45620bf885f791e1e2d0505714fe2222f (commit)
       via  24078b55e3565acd9bfd7f7a61829182076daca1 (commit)
      from  f9e6e03a14d7409cda2df5f231bc3e0a9a254d42 (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 28a038f45620bf885f791e1e2d0505714fe2222f
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Thu Nov 22 19:44:16 2012 +0100

    use const for the data

commit 24078b55e3565acd9bfd7f7a61829182076daca1
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Thu Nov 22 19:43:10 2012 +0100

    updated

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

Summary of changes:
 NEWS         |    2 +-
 lib/coding.c |    2 +-
 lib/int.h    |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 9997ea1..be519ba 100644
--- a/NEWS
+++ b/NEWS
@@ -5,7 +5,7 @@ GNU Libtasn1 NEWS                                     -*- outline -*-
   ASN1_ARRAY_TYPE -> asn1_static_node (was asn1_static_node_t)
 - Added new types: VisibleString, NumericString, IA5String, TeletexString,
   PrintableString, UniversalString, BMPString, UTF8String. When re-defined
-  a warning is being instead of failing.
+  a warning is being print instead of failing.
 - Parser outputs more detailed syntax error message.
 
 * Noteworthy changes in release 3.0 (2012-10-28) [stable]
diff --git a/lib/coding.c b/lib/coding.c
index 5d98fe4..0802f73 100644
--- a/lib/coding.c
+++ b/lib/coding.c
@@ -429,7 +429,7 @@ _asn1_complete_explicit_tag (asn1_node node, unsigned char *der,
   return ASN1_SUCCESS;
 }
 
-tag_and_class_st _asn1_tags[] =
+const tag_and_class_st _asn1_tags[] =
 {
   [ASN1_ETYPE_GENERALSTRING] = {ASN1_TAG_GENERALSTRING, ASN1_CLASS_UNIVERSAL, "type:GENERALSTRING"},
   [ASN1_ETYPE_NUMERICSTRING] = {ASN1_TAG_NUMERICSTRING, ASN1_CLASS_UNIVERSAL, "type:NUMERIC_STR"},
diff --git a/lib/int.h b/lib/int.h
index 0761025..70fa896 100644
--- a/lib/int.h
+++ b/lib/int.h
@@ -87,7 +87,7 @@ typedef struct tag_and_class_st {
 	case ASN1_ETYPE_SET: \
 	case ASN1_ETYPE_SET_OF
 
-extern tag_and_class_st _asn1_tags[];
+extern const tag_and_class_st _asn1_tags[];
 
 #define _asn1_strlen(s) strlen((const char *) s)
 #define _asn1_strtol(n,e,b) strtol((const char *) n, e, b)


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Fri Nov 23 03:44:35 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TbosF-0003LG-Bw
	for mharc-libtasn1-commit@gnu.org; Fri, 23 Nov 2012 03:44:35 -0500
Received: from eggs.gnu.org ([208.118.235.92]:51385)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Tbos5-0003IA-Sc
	for libtasn1-commit@gnu.org; Fri, 23 Nov 2012 03:44:33 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Tborw-0001nE-2G
	for libtasn1-commit@gnu.org; Fri, 23 Nov 2012 03:44:25 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:33855)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Tborv-0001n7-T8
	for libtasn1-commit@gnu.org; Fri, 23 Nov 2012 03:44:15 -0500
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Tborv-0003c7-5m
	for libtasn1-commit@gnu.org; Fri, 23 Nov 2012 08:44:15 +0000
Date: Fri, 23 Nov 2012 08:44:15 +0000
Message-Id: <E1Tborv-0003c7-5m@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_0-22-gce0dbb2
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 28a038f45620bf885f791e1e2d0505714fe2222f
X-Git-Newrev: ce0dbb2d2e8c5c18532afce2833af334440ae00c
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 23 Nov 2012 08:44:33 -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=ce0dbb2d2e8c5c18532afce2833af334440ae00c

The branch, master has been updated
       via  ce0dbb2d2e8c5c18532afce2833af334440ae00c (commit)
       via  f689984f35225f6e93ff2614df65a03de1cad8c4 (commit)
       via  ec008afd281367757fe2f05c844cddfc8cabd7f8 (commit)
       via  33cfcbd32ef49429e2b3fdf945c83f8d7b9295dd (commit)
       via  20c7ff8c5740700faf3f853c7122d54d0a2b1759 (commit)
      from  28a038f45620bf885f791e1e2d0505714fe2222f (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 ce0dbb2d2e8c5c18532afce2833af334440ae00c
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Fri Nov 23 09:44:05 2012 +0100

    updated generated structures

commit f689984f35225f6e93ff2614df65a03de1cad8c4
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Fri Nov 23 09:43:35 2012 +0100

    better error printing

commit ec008afd281367757fe2f05c844cddfc8cabd7f8
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Fri Nov 23 09:39:49 2012 +0100

    init strings

commit 33cfcbd32ef49429e2b3fdf945c83f8d7b9295dd
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Fri Nov 23 09:34:50 2012 +0100

    store duplicate (with built-in values) in structure to be compatible with old version.

commit 20c7ff8c5740700faf3f853c7122d54d0a2b1759
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Fri Nov 23 01:09:32 2012 +0100

    documented new types

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

Summary of changes:
 doc/libtasn1.texi          |    8 +
 lib/ASN1.c                 |  544 ++++++++++++++++++++++----------------------
 lib/ASN1.y                 |   10 +-
 src/asn1Parser.c           |    2 +-
 tests/Test_tree_asn1_tab.c |   16 +-
 5 files changed, 300 insertions(+), 280 deletions(-)

diff --git a/doc/libtasn1.texi b/doc/libtasn1.texi
index 799f71f..9ed4d4a 100644
--- a/doc/libtasn1.texi
+++ b/doc/libtasn1.texi
@@ -173,6 +173,14 @@ Here is the list of types that the parser can manage:
 @item @code{UTCTime};
 @item @code{GeneralizedTime};
 @item @code{GeneralString};
+@item @code{NumericString};
+@item @code{IA5String};
+@item @code{TeletexString};
+@item @code{PrintableString};
+@item @code{UniversalString};
+@item @code{BMPString};
+@item @code{UTF8String};
+@item @code{VisibleString};
 @item @code{SEQUENCE};
 @item @code{SEQUENCE OF};
 @item @code{SET};
diff --git a/lib/ASN1.c b/lib/ASN1.c
index 67d2f04..075c81c 100644
--- a/lib/ASN1.c
+++ b/lib/ASN1.c
@@ -119,7 +119,8 @@ static unsigned int line_number;	/* line number describing the
 					   parser position inside the
 					   file */
 static char last_error[ASN1_MAX_ERROR_DESCRIPTION_SIZE] = "";
-static char last_token[ASN1_MAX_NAME_SIZE+1];	/* last token find in the file
+static char last_error_token[ASN1_MAX_NAME_SIZE+1] = ""; /* used when expected errors occur */
+static char last_token[ASN1_MAX_NAME_SIZE+1] = ""; /* last token find in the file
 					   to parse before the 'parse
 					   error' */
 extern char _asn1_identifierMissing[];
@@ -131,7 +132,7 @@ static int _asn1_yylex(void);
 
 
 /* Line 268 of yacc.c  */
-#line 135 "ASN1.c"
+#line 136 "ASN1.c"
 
 /* Enabling traces.  */
 #ifndef YYDEBUG
@@ -262,7 +263,7 @@ typedef union YYSTYPE
 {
 
 /* Line 293 of yacc.c  */
-#line 61 "ASN1.y"
+#line 62 "ASN1.y"
 
   unsigned int constant;
   char str[ASN1_MAX_NAME_SIZE+1];
@@ -271,7 +272,7 @@ typedef union YYSTYPE
 
 
 /* Line 293 of yacc.c  */
-#line 275 "ASN1.c"
+#line 276 "ASN1.c"
 } YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -283,7 +284,7 @@ typedef union YYSTYPE
 
 
 /* Line 343 of yacc.c  */
-#line 287 "ASN1.c"
+#line 288 "ASN1.c"
 
 #ifdef short
 # undef short
@@ -502,7 +503,7 @@ union yyalloc
 /* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  5
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   217
+#define YYLAST   219
 
 /* YYNTOKENS -- Number of terminals.  */
 #define YYNTOKENS  60
@@ -511,7 +512,7 @@ union yyalloc
 /* YYNRULES -- Number of rules.  */
 #define YYNRULES  125
 /* YYNRULES -- Number of states.  */
-#define YYNSTATES  216
+#define YYNSTATES  217
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 #define YYUNDEFTOK  2
@@ -572,8 +573,8 @@ static const yytype_uint16 yyprhs[] =
      243,   245,   247,   249,   251,   253,   255,   257,   259,   261,
      263,   265,   267,   269,   271,   273,   275,   278,   280,   283,
      286,   289,   291,   295,   300,   304,   309,   314,   318,   323,
-     328,   330,   335,   339,   342,   350,   357,   362,   364,   366,
-     368,   371,   376,   380,   382,   384
+     328,   330,   335,   339,   343,   351,   358,   363,   365,   367,
+     369,   372,   377,   381,   383,   385
 };
 
 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
@@ -613,29 +614,29 @@ static const yytype_int8 yyrhs[] =
       57,   100,    58,    -1,    28,    18,    96,    -1,    28,    80,
       18,    96,    -1,    17,    57,   100,    58,    -1,    25,    -1,
       25,    26,    27,     5,    -1,     5,     3,    97,    -1,     1,
-      97,    -1,     5,    19,    20,     3,    57,    70,    58,    -1,
-       5,     5,     3,    57,    70,    58,    -1,     5,     7,     3,
-      64,    -1,   105,    -1,   106,    -1,   107,    -1,   108,   107,
-      -1,     5,    57,    70,    58,    -1,     5,    57,    58,    -1,
-       5,    -1,    29,    -1,    30,    -1
+       3,    97,    -1,     5,    19,    20,     3,    57,    70,    58,
+      -1,     5,     5,     3,    57,    70,    58,    -1,     5,     7,
+       3,    64,    -1,   105,    -1,   106,    -1,   107,    -1,   108,
+     107,    -1,     5,    57,    70,    58,    -1,     5,    57,    58,
+      -1,     5,    -1,    29,    -1,    30,    -1
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const yytype_uint16 yyrline[] =
 {
-       0,   133,   133,   146,   147,   150,   154,   155,   158,   159,
-     162,   163,   166,   168,   173,   174,   178,   180,   185,   186,
-     190,   191,   192,   195,   197,   201,   202,   203,   206,   208,
-     209,   213,   214,   218,   219,   221,   222,   229,   232,   233,
-     236,   238,   244,   245,   248,   249,   253,   254,   258,   259,
-     263,   264,   268,   269,   273,   274,   278,   279,   283,   284,
-     288,   289,   293,   294,   298,   303,   304,   308,   309,   310,
-     315,   321,   324,   326,   329,   330,   331,   332,   333,   334,
-     335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
-     345,   346,   347,   348,   349,   352,   353,   358,   359,   362,
-     365,   368,   369,   373,   375,   377,   382,   384,   386,   391,
-     395,   396,   401,   403,   406,   410,   415,   421,   422,   425,
-     426,   430,   433,   435,   459,   460
+       0,   134,   134,   147,   148,   151,   155,   156,   159,   160,
+     163,   164,   167,   169,   174,   175,   179,   181,   186,   187,
+     191,   192,   193,   196,   198,   202,   203,   204,   207,   209,
+     210,   214,   215,   219,   220,   222,   223,   230,   233,   234,
+     237,   239,   245,   246,   249,   250,   254,   255,   259,   260,
+     264,   265,   269,   270,   274,   275,   279,   280,   284,   285,
+     289,   290,   294,   295,   299,   304,   305,   309,   310,   311,
+     316,   322,   325,   327,   330,   331,   332,   333,   334,   335,
+     336,   337,   338,   339,   340,   341,   342,   343,   344,   345,
+     346,   347,   348,   349,   350,   353,   354,   359,   360,   363,
+     366,   369,   370,   374,   376,   378,   383,   385,   387,   392,
+     396,   397,   402,   404,   407,   411,   416,   422,   423,   426,
+     427,   431,   434,   436,   460,   461
 };
 #endif
 
@@ -716,7 +717,7 @@ static const yytype_uint8 yyr2[] =
        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
        1,     1,     1,     1,     1,     1,     2,     1,     2,     2,
        2,     1,     3,     4,     3,     4,     4,     3,     4,     4,
-       1,     4,     3,     2,     7,     6,     4,     1,     1,     1,
+       1,     4,     3,     3,     7,     6,     4,     1,     1,     1,
        2,     4,     3,     1,     1,     1
 };
 
@@ -728,76 +729,76 @@ static const yytype_uint8 yydefact[] =
        0,   123,     0,     0,     0,     1,     0,     8,     9,   122,
       16,    18,     0,   124,   125,     0,     0,   121,    19,     0,
        0,     0,    17,     0,     0,     0,   117,   118,   119,     0,
-      72,    33,     0,     0,     0,     0,     0,    37,    94,   110,
-       0,    38,    39,    44,    46,    48,    50,    52,    54,    56,
-      58,    60,     0,     0,    25,     0,    74,    76,    77,    80,
-      81,    82,    83,    84,    85,    86,    87,    88,    78,    79,
-      75,    90,    95,   113,    89,    93,    91,    92,     0,     0,
-       0,     0,     2,   120,     0,     0,    42,    73,     0,    62,
-       0,     0,     0,    67,     0,    71,     0,     0,     0,     0,
-      45,    47,    49,    51,    53,    55,    57,    59,    61,     0,
-       0,    20,    21,    22,     0,    26,    27,    96,     0,   112,
-       0,     0,     0,     0,     0,     0,     0,    14,     0,    63,
-     104,     0,   101,     0,     0,     0,    68,     0,     0,   107,
-       0,     0,     0,    65,     0,    23,     0,     3,     9,     0,
-       0,     6,     7,    31,     0,     0,     0,     3,   116,     0,
-       0,    43,     0,     0,     0,    34,    97,   100,     0,   103,
-     105,     0,   109,   111,   106,   108,     0,     0,    70,    24,
-       4,     5,     0,    35,     0,     0,     0,    40,     0,     0,
-      12,    15,    99,     0,    98,   102,    69,     0,    66,     0,
-      32,   115,     0,     0,    13,    11,    29,    30,    10,    28,
-      64,     0,   114,     0,    36,    41
+       0,     0,     0,     0,     0,     2,   120,    72,    33,     0,
+       0,     0,     0,     0,    37,    94,   110,     0,    38,    39,
+      44,    46,    48,    50,    52,    54,    56,    58,    60,     0,
+       0,    25,     0,    74,    76,    77,    80,    81,    82,    83,
+      84,    85,    86,    87,    88,    78,    79,    75,    90,    95,
+     113,    89,    93,    91,    92,   112,     0,     0,     0,     0,
+       0,    42,    73,     0,    62,     0,     0,     0,    67,     0,
+      71,     0,     0,     0,     0,    45,    47,    49,    51,    53,
+      55,    57,    59,    61,     0,     0,    20,    21,    22,     0,
+      26,    27,    96,     0,     0,     3,     0,     0,     6,     7,
+     116,     0,     0,     0,     0,     0,    14,     0,    63,   104,
+       0,   101,     0,     0,     0,    68,     0,     0,   107,     0,
+       0,     0,    65,     0,    23,     0,     3,     9,    31,     0,
+       0,     0,     4,     5,     0,     0,    43,     0,     0,     0,
+      34,    97,   100,     0,   103,   105,     0,   109,   111,   106,
+     108,     0,     0,    70,    24,     0,    35,     0,   115,     0,
+      40,     0,     0,    12,    15,    99,     0,    98,   102,    69,
+       0,    66,     0,    32,   114,     0,    13,    11,    29,    30,
+      10,    28,    64,     0,     0,    36,    41
 };
 
 /* YYDEFGOTO[NTERM-NUM].  */
 static const yytype_int16 yydefgoto[] =
 {
-      -1,     2,   151,   152,   153,    10,   209,   127,   128,    11,
-      12,   114,    54,    55,   194,   155,    56,    57,    58,    86,
-      87,    59,    60,    61,    62,    63,    64,    65,    66,    67,
-      68,   143,   144,    69,    70,    71,    72,    73,   167,   132,
-     133,    74,    75,    76,    77,    26,    27,    28,    29,     3,
+      -1,     2,   128,   129,   130,    10,   211,   136,   137,    11,
+      12,   119,    61,    62,   197,   160,    63,    64,    65,    91,
+      92,    66,    67,    68,    69,    70,    71,    72,    73,    74,
+      75,   152,   153,    76,    77,    78,    79,    80,   172,   141,
+     142,    81,    82,    83,    84,    26,    27,    28,    29,     3,
       15
 };
 
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    STATE-NUM.  */
-#define YYPACT_NINF -118
+#define YYPACT_NINF -121
 static const yytype_int16 yypact[] =
 {
-       9,   -25,    35,    61,     2,  -118,    12,  -118,    49,  -118,
-    -118,  -118,     6,  -118,  -118,    70,   100,  -118,  -118,    54,
-      58,   112,  -118,    45,    84,    44,  -118,  -118,  -118,    32,
-      31,    90,   144,    22,   145,    92,   137,  -118,  -118,   133,
-      26,  -118,  -118,    31,    31,    31,    31,    31,    31,    31,
-      31,    31,   104,   103,   111,   139,   114,  -118,  -118,  -118,
-    -118,  -118,  -118,  -118,  -118,  -118,  -118,  -118,  -118,  -118,
-    -118,  -118,  -118,  -118,  -118,  -118,  -118,  -118,    84,   159,
-     163,   149,  -118,  -118,   117,   162,  -118,  -118,    21,    31,
-     139,   166,   154,     5,   166,  -118,   158,   139,   166,   168,
-    -118,  -118,  -118,  -118,  -118,  -118,  -118,  -118,  -118,   183,
-     134,  -118,  -118,  -118,   187,  -118,  -118,  -118,    64,  -118,
-     135,    25,   190,   138,   142,   146,    25,  -118,     1,  -118,
-    -118,    84,  -118,    41,   139,   183,  -118,    53,   191,  -118,
-      77,   139,   147,  -118,    78,  -118,   140,   141,  -118,   195,
-     197,  -118,  -118,  -118,   143,    34,   148,  -118,  -118,   150,
-     -21,  -118,    25,   151,    21,  -118,    42,  -118,   166,  -118,
-    -118,    81,  -118,  -118,  -118,  -118,   200,   183,  -118,  -118,
-    -118,  -118,   152,  -118,    25,    20,   148,  -118,   153,   156,
-    -118,  -118,  -118,    48,  -118,  -118,  -118,   157,  -118,   138,
-    -118,  -118,    23,   138,  -118,  -118,  -118,  -118,  -118,  -118,
-    -118,   161,  -118,   164,  -118,  -118
+      10,   -16,    49,    20,     1,  -121,    28,  -121,     9,  -121,
+    -121,  -121,     4,  -121,  -121,    44,    69,  -121,  -121,    91,
+      55,   100,  -121,   112,   144,    99,  -121,  -121,  -121,    29,
+      84,    84,   148,   150,   136,  -121,  -121,     5,   101,   147,
+      21,   149,   104,   145,  -121,  -121,   137,    35,  -121,  -121,
+       5,     5,     5,     5,     5,     5,     5,     5,     5,   109,
+      32,    37,   143,   118,  -121,  -121,  -121,  -121,  -121,  -121,
+    -121,  -121,  -121,  -121,  -121,  -121,  -121,  -121,  -121,  -121,
+    -121,  -121,  -121,  -121,  -121,  -121,   113,    48,   169,   122,
+     166,  -121,  -121,    23,     5,   143,   170,   158,    24,   170,
+    -121,   162,   143,   170,   172,  -121,  -121,  -121,  -121,  -121,
+    -121,  -121,  -121,  -121,   187,   139,  -121,  -121,  -121,   189,
+    -121,  -121,  -121,    50,   138,  -121,   191,   192,  -121,  -121,
+    -121,   140,   141,   146,   151,    48,  -121,   -20,  -121,  -121,
+      84,  -121,    26,   143,   187,  -121,    58,   194,  -121,    77,
+     143,   152,  -121,    78,  -121,   153,   142,  -121,  -121,   154,
+      85,     6,  -121,  -121,   138,   -15,  -121,    48,   155,    23,
+    -121,    34,  -121,   170,  -121,  -121,    81,  -121,  -121,  -121,
+    -121,   196,   187,  -121,  -121,   156,  -121,    48,  -121,    22,
+    -121,   157,   159,  -121,  -121,  -121,    65,  -121,  -121,  -121,
+     160,  -121,   141,  -121,  -121,   141,  -121,  -121,  -121,  -121,
+    -121,  -121,  -121,   165,   167,  -121,  -121
 };
 
 /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int16 yypgoto[] =
 {
-    -118,  -118,  -118,  -118,  -117,  -115,  -118,    46,  -118,   -12,
-     -71,  -118,  -118,  -118,  -118,  -118,  -118,  -118,  -118,   120,
-     -28,  -118,  -118,  -118,  -118,  -118,  -118,  -118,  -118,  -118,
-    -118,    29,    79,  -118,  -118,  -118,   -54,   -76,  -118,    47,
-      39,  -118,  -118,  -118,  -118,  -118,  -118,   188,  -118,  -118,
-    -118
+    -121,  -121,  -121,  -121,  -119,  -120,  -121,    36,  -121,   -12,
+     -93,  -121,  -121,  -121,  -121,  -121,  -121,  -121,  -121,   114,
+     -33,  -121,  -121,  -121,  -121,  -121,  -121,  -121,  -121,  -121,
+    -121,    27,    62,  -121,  -121,  -121,   -60,   -30,  -121,    45,
+      41,  -121,  -121,  -121,  -121,  -121,  -121,   181,  -121,  -121,
+    -121
 };
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
@@ -806,60 +807,60 @@ static const yytype_int16 yypgoto[] =
 #define YYTABLE_NINF -9
 static const yytype_int16 yytable[] =
 {
-      18,   117,   119,   154,   158,    92,     7,     8,   160,   163,
-       7,     8,    99,    84,     1,   100,   101,   102,   103,   104,
-     105,   106,   107,   108,     7,     8,   125,     7,     8,   157,
-      84,   187,     4,    24,    84,     5,   130,    25,   188,    84,
-      90,    13,    14,   139,    97,   189,    24,    78,   192,    79,
-      25,    80,   157,   205,   164,   166,    85,    21,   193,   165,
-       9,   129,   135,    81,    17,   136,    82,   200,   147,   148,
-     206,   207,   126,    85,   149,   150,   208,    85,   201,    91,
-     170,   212,    85,    98,   211,   185,   183,   175,   213,    30,
-     184,    31,     6,    32,   168,    33,    34,   149,   150,   169,
-      16,    35,    19,    36,    20,    37,   168,   110,    38,    39,
-      22,   172,    40,   149,   150,   202,   111,   112,   113,    41,
-      42,    43,    44,    45,    46,    47,    48,    49,    50,    51,
-     168,   177,    52,   137,   177,   174,   178,   140,    53,   196,
-     115,   116,     7,   148,    30,    23,    31,    88,    32,    94,
-      33,    34,     7,     8,    89,    93,    35,    95,    36,    96,
-      37,   109,   120,    38,    39,   118,   121,    40,   123,   122,
-      84,   131,   134,    18,    41,    42,    43,    44,    45,    46,
-      47,    48,    49,    50,    51,   138,   141,    52,   142,   145,
-      18,   146,   156,   159,   161,   179,   173,   162,   176,   180,
-      -8,   181,   182,   190,   197,   124,   198,   186,   204,   210,
-     191,   199,   203,   214,   171,   195,   215,    83
+      18,    85,   122,   159,   158,     7,     8,    97,     7,     8,
+       7,     8,   165,    89,   104,     1,   168,   105,   106,   107,
+     108,   109,   110,   111,   112,   113,     7,     8,   134,    89,
+      24,   161,    89,   169,    25,   139,   115,   190,   170,    95,
+     195,     4,   148,    89,   191,   116,   117,   118,   192,     5,
+     196,     6,   125,   102,   156,   157,    90,    13,    14,     9,
+      16,   138,    17,    35,   188,   145,   120,   121,   203,   125,
+     207,   189,    90,    20,   135,    90,    19,   210,    96,   173,
+     204,   144,   213,   175,   174,   214,    90,   208,   209,    37,
+     180,    38,   103,    39,    21,    40,    41,   126,   127,   126,
+     127,    42,    31,    43,    32,    44,    33,    22,    45,    46,
+     171,   173,    47,    24,   126,   127,   177,    25,    34,    48,
+      49,    50,    51,    52,    53,    54,    55,    56,    57,    58,
+     173,   182,    59,    23,   182,   179,   183,   186,    60,   199,
+     146,   187,     7,     8,   149,     7,   157,    30,    37,    18,
+      38,    86,    39,    87,    40,    41,    88,    94,    93,    98,
+      42,    99,    43,   101,    44,   100,   114,    45,    46,   123,
+     124,    47,   131,   132,    89,   140,   143,    18,    48,    49,
+      50,    51,    52,    53,    54,    55,    56,    57,    58,   147,
+     150,    59,   151,   155,   154,   162,   163,   164,   166,   178,
+     200,    -8,   167,   181,   133,   194,   176,   193,   184,   201,
+      36,   206,   212,   185,     0,   202,   205,   215,   198,   216
 };
 
 #define yypact_value_is_default(yystate) \
-  ((yystate) == (-118))
+  ((yystate) == (-121))
 
 #define yytable_value_is_error(yytable_value) \
   YYID (0)
 
-static const yytype_uint8 yycheck[] =
+static const yytype_int16 yycheck[] =
 {
-      12,    55,    78,   118,   121,    33,     4,     5,   123,   126,
-       4,     5,    40,     8,     5,    43,    44,    45,    46,    47,
-      48,    49,    50,    51,     4,     5,     5,     4,     5,     4,
-       8,    52,    57,     1,     8,     0,    90,     5,    59,     8,
-      18,    29,    30,    97,    18,   162,     1,     3,     6,     5,
-       5,     7,     4,     5,    53,   131,    51,     3,    16,    58,
-      58,    89,    57,    19,    58,    93,    34,   184,     4,     5,
-      22,    23,    51,    51,    49,    50,   193,    51,    58,    57,
-     134,    58,    51,    57,   199,   156,    52,   141,   203,     5,
-      56,     7,    31,     9,    53,    11,    12,    49,    50,    58,
-      51,    17,    32,    19,     4,    21,    53,     4,    24,    25,
-      52,    58,    28,    49,    50,   186,    13,    14,    15,    35,
+      12,    31,    62,   123,   123,     4,     5,    40,     4,     5,
+       4,     5,   132,     8,    47,     5,   135,    50,    51,    52,
+      53,    54,    55,    56,    57,    58,     4,     5,     5,     8,
+       1,   124,     8,    53,     5,    95,     4,    52,    58,    18,
+       6,    57,   102,     8,    59,    13,    14,    15,   167,     0,
+      16,    31,     4,    18,     4,     5,    51,    29,    30,    58,
+      51,    94,    58,    34,    58,    98,    29,    30,   187,     4,
+       5,   164,    51,     4,    51,    51,    32,   196,    57,    53,
+      58,    57,   202,   143,    58,   205,    51,    22,    23,     5,
+     150,     7,    57,     9,     3,    11,    12,    49,    50,    49,
+      50,    17,     3,    19,     5,    21,     7,    52,    24,    25,
+     140,    53,    28,     1,    49,    50,    58,     5,    19,    35,
       36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
-      53,    53,    48,    94,    53,    58,    58,    98,    54,    58,
-      29,    30,     4,     5,     5,    33,     7,    57,     9,    57,
-      11,    12,     4,     5,    10,    10,    17,    20,    19,    26,
-      21,    57,     3,    24,    25,    51,     3,    28,    51,    20,
-       8,     5,    18,   185,    35,    36,    37,    38,    39,    40,
-      41,    42,    43,    44,    45,    27,    18,    48,     5,    55,
-     202,     4,    57,     3,    52,    55,     5,    51,    51,     4,
-      59,     4,    59,    52,     4,    85,   177,    57,    52,    52,
-     164,    59,    59,    52,   135,   168,    52,    29
+      53,    53,    48,    33,    53,    58,    58,    52,    54,    58,
+      99,    56,     4,     5,   103,     4,     5,     3,     5,   161,
+       7,     3,     9,     3,    11,    12,    20,    10,    57,    10,
+      17,    57,    19,    26,    21,    20,    57,    24,    25,    51,
+      57,    28,     3,    51,     8,     5,    18,   189,    35,    36,
+      37,    38,    39,    40,    41,    42,    43,    44,    45,    27,
+      18,    48,     5,     4,    55,     4,     4,    57,    52,     5,
+       4,    59,    51,    51,    90,   169,   144,    52,    55,   182,
+      29,    52,    52,    59,    -1,    59,    59,    52,   173,    52
 };
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -869,25 +870,25 @@ static const yytype_uint8 yystos[] =
        0,     5,    61,   109,    57,     0,    31,     4,     5,    58,
       65,    69,    70,    29,    30,   110,    51,    58,    69,    32,
        4,     3,    52,    33,     1,     5,   105,   106,   107,   108,
-       5,     7,     9,    11,    12,    17,    19,    21,    24,    25,
-      28,    35,    36,    37,    38,    39,    40,    41,    42,    43,
-      44,    45,    48,    54,    72,    73,    76,    77,    78,    81,
-      82,    83,    84,    85,    86,    87,    88,    89,    90,    93,
-      94,    95,    96,    97,   101,   102,   103,   104,     3,     5,
-       7,    19,    34,   107,     8,    51,    79,    80,    57,    10,
-      18,    57,    80,    10,    57,    20,    26,    18,    57,    80,
-      80,    80,    80,    80,    80,    80,    80,    80,    80,    57,
-       4,    13,    14,    15,    71,    29,    30,    96,    51,    97,
-       3,     3,    20,    51,    79,     5,    51,    67,    68,    80,
-      96,     5,    99,   100,    18,    57,    80,   100,    27,    96,
-     100,    18,     5,    91,    92,    55,     4,     4,     5,    49,
-      50,    62,    63,    64,    65,    75,    57,     4,    64,     3,
-      65,    52,    51,    64,    53,    58,    97,    98,    53,    58,
-      96,    92,    58,     5,    58,    96,    51,    53,    58,    55,
-       4,     4,    59,    52,    56,    70,    57,    52,    59,    64,
-      52,    67,     6,    16,    74,    99,    58,     4,    91,    59,
-      64,    58,    70,    59,    52,     5,    22,    23,    64,    66,
-      52,    65,    58,    65,    52,    52
+       3,     3,     5,     7,    19,    34,   107,     5,     7,     9,
+      11,    12,    17,    19,    21,    24,    25,    28,    35,    36,
+      37,    38,    39,    40,    41,    42,    43,    44,    45,    48,
+      54,    72,    73,    76,    77,    78,    81,    82,    83,    84,
+      85,    86,    87,    88,    89,    90,    93,    94,    95,    96,
+      97,   101,   102,   103,   104,    97,     3,     3,    20,     8,
+      51,    79,    80,    57,    10,    18,    57,    80,    10,    57,
+      20,    26,    18,    57,    80,    80,    80,    80,    80,    80,
+      80,    80,    80,    80,    57,     4,    13,    14,    15,    71,
+      29,    30,    96,    51,    57,     4,    49,    50,    62,    63,
+      64,     3,    51,    79,     5,    51,    67,    68,    80,    96,
+       5,    99,   100,    18,    57,    80,   100,    27,    96,   100,
+      18,     5,    91,    92,    55,     4,     4,     5,    64,    65,
+      75,    70,     4,     4,    57,    65,    52,    51,    64,    53,
+      58,    97,    98,    53,    58,    96,    92,    58,     5,    58,
+      96,    51,    53,    58,    55,    59,    52,    56,    58,    70,
+      52,    59,    64,    52,    67,     6,    16,    74,    99,    58,
+       4,    91,    59,    64,    58,    59,    52,     5,    22,    23,
+      64,    66,    52,    65,    65,    52,    52
 };
 
 #define yyerrok		(yyerrstatus = 0)
@@ -1724,7 +1725,7 @@ yyreduce:
         case 2:
 
 /* Line 1806 of yacc.c  */
-#line 136 "ASN1.y"
+#line 137 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_DEFINITIONS|(yyvsp[(3) - (8)].constant));
                     _asn1_set_name((yyval.node),_asn1_get_name((yyvsp[(1) - (8)].node)));
                     _asn1_set_name((yyvsp[(1) - (8)].node),"");
@@ -1738,21 +1739,21 @@ yyreduce:
   case 3:
 
 /* Line 1806 of yacc.c  */
-#line 146 "ASN1.y"
+#line 147 "ASN1.y"
     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
     break;
 
   case 4:
 
 /* Line 1806 of yacc.c  */
-#line 147 "ASN1.y"
+#line 148 "ASN1.y"
     {strcpy((yyval.str),(yyvsp[(2) - (2)].str));}
     break;
 
   case 5:
 
 /* Line 1806 of yacc.c  */
-#line 150 "ASN1.y"
+#line 151 "ASN1.y"
     {strcpy((yyval.str),"-");
                        strcat((yyval.str),(yyvsp[(2) - (2)].str));}
     break;
@@ -1760,49 +1761,49 @@ yyreduce:
   case 6:
 
 /* Line 1806 of yacc.c  */
-#line 154 "ASN1.y"
+#line 155 "ASN1.y"
     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
     break;
 
   case 7:
 
 /* Line 1806 of yacc.c  */
-#line 155 "ASN1.y"
+#line 156 "ASN1.y"
     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
     break;
 
   case 8:
 
 /* Line 1806 of yacc.c  */
-#line 158 "ASN1.y"
+#line 159 "ASN1.y"
     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
     break;
 
   case 9:
 
 /* Line 1806 of yacc.c  */
-#line 159 "ASN1.y"
+#line 160 "ASN1.y"
     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
     break;
 
   case 10:
 
 /* Line 1806 of yacc.c  */
-#line 162 "ASN1.y"
+#line 163 "ASN1.y"
     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
     break;
 
   case 11:
 
 /* Line 1806 of yacc.c  */
-#line 163 "ASN1.y"
+#line 164 "ASN1.y"
     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
     break;
 
   case 12:
 
 /* Line 1806 of yacc.c  */
-#line 166 "ASN1.y"
+#line 167 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT);
                                        _asn1_set_value((yyval.node),(yyvsp[(2) - (3)].str),strlen((yyvsp[(2) - (3)].str))+1);}
     break;
@@ -1810,7 +1811,7 @@ yyreduce:
   case 13:
 
 /* Line 1806 of yacc.c  */
-#line 168 "ASN1.y"
+#line 169 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT);
 	                               _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str));
                                        _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);}
@@ -1819,14 +1820,14 @@ yyreduce:
   case 14:
 
 /* Line 1806 of yacc.c  */
-#line 173 "ASN1.y"
+#line 174 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 15:
 
 /* Line 1806 of yacc.c  */
-#line 174 "ASN1.y"
+#line 175 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (3)].node);
                                             _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (3)].node)),(yyvsp[(3) - (3)].node));}
     break;
@@ -1834,7 +1835,7 @@ yyreduce:
   case 16:
 
 /* Line 1806 of yacc.c  */
-#line 178 "ASN1.y"
+#line 179 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT);
                                    _asn1_set_value((yyval.node),(yyvsp[(1) - (1)].str),strlen((yyvsp[(1) - (1)].str))+1);}
     break;
@@ -1842,7 +1843,7 @@ yyreduce:
   case 17:
 
 /* Line 1806 of yacc.c  */
-#line 180 "ASN1.y"
+#line 181 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT);
 	                            _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str));
                                     _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);}
@@ -1851,14 +1852,14 @@ yyreduce:
   case 18:
 
 /* Line 1806 of yacc.c  */
-#line 185 "ASN1.y"
+#line 186 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 19:
 
 /* Line 1806 of yacc.c  */
-#line 186 "ASN1.y"
+#line 187 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (2)].node);
                                                     _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (2)].node)),(yyvsp[(2) - (2)].node));}
     break;
@@ -1866,28 +1867,28 @@ yyreduce:
   case 20:
 
 /* Line 1806 of yacc.c  */
-#line 190 "ASN1.y"
+#line 191 "ASN1.y"
     {(yyval.constant)=CONST_UNIVERSAL;}
     break;
 
   case 21:
 
 /* Line 1806 of yacc.c  */
-#line 191 "ASN1.y"
+#line 192 "ASN1.y"
     {(yyval.constant)=CONST_PRIVATE;}
     break;
 
   case 22:
 
 /* Line 1806 of yacc.c  */
-#line 192 "ASN1.y"
+#line 193 "ASN1.y"
     {(yyval.constant)=CONST_APPLICATION;}
     break;
 
   case 23:
 
 /* Line 1806 of yacc.c  */
-#line 195 "ASN1.y"
+#line 196 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TAG);
                             _asn1_set_value((yyval.node),(yyvsp[(2) - (3)].str),strlen((yyvsp[(2) - (3)].str))+1);}
     break;
@@ -1895,7 +1896,7 @@ yyreduce:
   case 24:
 
 /* Line 1806 of yacc.c  */
-#line 197 "ASN1.y"
+#line 198 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TAG | (yyvsp[(2) - (4)].constant));
                                 _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);}
     break;
@@ -1903,28 +1904,28 @@ yyreduce:
   case 25:
 
 /* Line 1806 of yacc.c  */
-#line 201 "ASN1.y"
+#line 202 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 26:
 
 /* Line 1806 of yacc.c  */
-#line 202 "ASN1.y"
+#line 203 "ASN1.y"
     {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_EXPLICIT);}
     break;
 
   case 27:
 
 /* Line 1806 of yacc.c  */
-#line 203 "ASN1.y"
+#line 204 "ASN1.y"
     {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_IMPLICIT);}
     break;
 
   case 28:
 
 /* Line 1806 of yacc.c  */
-#line 206 "ASN1.y"
+#line 207 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_DEFAULT);
                                        _asn1_set_value((yyval.node),(yyvsp[(2) - (2)].str),strlen((yyvsp[(2) - (2)].str))+1);}
     break;
@@ -1932,28 +1933,28 @@ yyreduce:
   case 29:
 
 /* Line 1806 of yacc.c  */
-#line 208 "ASN1.y"
+#line 209 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_DEFAULT|CONST_TRUE);}
     break;
 
   case 30:
 
 /* Line 1806 of yacc.c  */
-#line 209 "ASN1.y"
+#line 210 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_DEFAULT|CONST_FALSE);}
     break;
 
   case 33:
 
 /* Line 1806 of yacc.c  */
-#line 218 "ASN1.y"
+#line 219 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER);}
     break;
 
   case 34:
 
 /* Line 1806 of yacc.c  */
-#line 219 "ASN1.y"
+#line 220 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER|CONST_LIST);
 	                                 _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
     break;
@@ -1961,14 +1962,14 @@ yyreduce:
   case 35:
 
 /* Line 1806 of yacc.c  */
-#line 221 "ASN1.y"
+#line 222 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER);}
     break;
 
   case 36:
 
 /* Line 1806 of yacc.c  */
-#line 223 "ASN1.y"
+#line 224 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER|CONST_MIN_MAX);
                                          _asn1_set_down((yyval.node),_asn1_add_static_node(ASN1_ETYPE_SIZE));
                                          _asn1_set_value(_asn1_get_down((yyval.node)),(yyvsp[(6) - (7)].str),strlen((yyvsp[(6) - (7)].str))+1);
@@ -1978,28 +1979,28 @@ yyreduce:
   case 37:
 
 /* Line 1806 of yacc.c  */
-#line 229 "ASN1.y"
+#line 230 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BOOLEAN);}
     break;
 
   case 38:
 
 /* Line 1806 of yacc.c  */
-#line 232 "ASN1.y"
+#line 233 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TIME|CONST_UTC);}
     break;
 
   case 39:
 
 /* Line 1806 of yacc.c  */
-#line 233 "ASN1.y"
+#line 234 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TIME|CONST_GENERALIZED);}
     break;
 
   case 40:
 
 /* Line 1806 of yacc.c  */
-#line 236 "ASN1.y"
+#line 237 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SIZE|CONST_1_PARAM);
 	                              _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);}
     break;
@@ -2007,7 +2008,7 @@ yyreduce:
   case 41:
 
 /* Line 1806 of yacc.c  */
-#line 239 "ASN1.y"
+#line 240 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SIZE|CONST_MIN_MAX);
 	                              _asn1_set_value((yyval.node),(yyvsp[(3) - (7)].str),strlen((yyvsp[(3) - (7)].str))+1);
                                       _asn1_set_name((yyval.node),(yyvsp[(6) - (7)].str));}
@@ -2016,28 +2017,28 @@ yyreduce:
   case 42:
 
 /* Line 1806 of yacc.c  */
-#line 244 "ASN1.y"
+#line 245 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 43:
 
 /* Line 1806 of yacc.c  */
-#line 245 "ASN1.y"
+#line 246 "ASN1.y"
     {(yyval.node)=(yyvsp[(2) - (3)].node);}
     break;
 
   case 44:
 
 /* Line 1806 of yacc.c  */
-#line 248 "ASN1.y"
+#line 249 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_GENERALSTRING);}
     break;
 
   case 45:
 
 /* Line 1806 of yacc.c  */
-#line 249 "ASN1.y"
+#line 250 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_GENERALSTRING|CONST_SIZE);
 					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
@@ -2045,14 +2046,14 @@ yyreduce:
   case 46:
 
 /* Line 1806 of yacc.c  */
-#line 253 "ASN1.y"
+#line 254 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_NUMERICSTRING|CONST_UNIVERSAL);}
     break;
 
   case 47:
 
 /* Line 1806 of yacc.c  */
-#line 254 "ASN1.y"
+#line 255 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_NUMERICSTRING|CONST_SIZE);
 					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
@@ -2060,14 +2061,14 @@ yyreduce:
   case 48:
 
 /* Line 1806 of yacc.c  */
-#line 258 "ASN1.y"
+#line 259 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IA5STRING);}
     break;
 
   case 49:
 
 /* Line 1806 of yacc.c  */
-#line 259 "ASN1.y"
+#line 260 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IA5STRING|CONST_SIZE);
 					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
@@ -2075,14 +2076,14 @@ yyreduce:
   case 50:
 
 /* Line 1806 of yacc.c  */
-#line 263 "ASN1.y"
+#line 264 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TELETEXSTRING);}
     break;
 
   case 51:
 
 /* Line 1806 of yacc.c  */
-#line 264 "ASN1.y"
+#line 265 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TELETEXSTRING|CONST_SIZE);
 					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
@@ -2090,14 +2091,14 @@ yyreduce:
   case 52:
 
 /* Line 1806 of yacc.c  */
-#line 268 "ASN1.y"
+#line 269 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_PRINTABLESTRING);}
     break;
 
   case 53:
 
 /* Line 1806 of yacc.c  */
-#line 269 "ASN1.y"
+#line 270 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_PRINTABLESTRING|CONST_SIZE);
 					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
@@ -2105,14 +2106,14 @@ yyreduce:
   case 54:
 
 /* Line 1806 of yacc.c  */
-#line 273 "ASN1.y"
+#line 274 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UNIVERSALSTRING);}
     break;
 
   case 55:
 
 /* Line 1806 of yacc.c  */
-#line 274 "ASN1.y"
+#line 275 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UNIVERSALSTRING|CONST_SIZE);
 					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
@@ -2120,14 +2121,14 @@ yyreduce:
   case 56:
 
 /* Line 1806 of yacc.c  */
-#line 278 "ASN1.y"
+#line 279 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BMPSTRING);}
     break;
 
   case 57:
 
 /* Line 1806 of yacc.c  */
-#line 279 "ASN1.y"
+#line 280 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BMPSTRING|CONST_SIZE);
 					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
@@ -2135,14 +2136,14 @@ yyreduce:
   case 58:
 
 /* Line 1806 of yacc.c  */
-#line 283 "ASN1.y"
+#line 284 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UTF8STRING);}
     break;
 
   case 59:
 
 /* Line 1806 of yacc.c  */
-#line 284 "ASN1.y"
+#line 285 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UTF8STRING|CONST_SIZE);
 					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
@@ -2150,14 +2151,14 @@ yyreduce:
   case 60:
 
 /* Line 1806 of yacc.c  */
-#line 288 "ASN1.y"
+#line 289 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_VISIBLESTRING);}
     break;
 
   case 61:
 
 /* Line 1806 of yacc.c  */
-#line 289 "ASN1.y"
+#line 290 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_VISIBLESTRING|CONST_SIZE);
 					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
@@ -2165,14 +2166,14 @@ yyreduce:
   case 62:
 
 /* Line 1806 of yacc.c  */
-#line 293 "ASN1.y"
+#line 294 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OCTET_STRING);}
     break;
 
   case 63:
 
 /* Line 1806 of yacc.c  */
-#line 294 "ASN1.y"
+#line 295 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OCTET_STRING|CONST_SIZE);
                                            _asn1_set_down((yyval.node),(yyvsp[(3) - (3)].node));}
     break;
@@ -2180,7 +2181,7 @@ yyreduce:
   case 64:
 
 /* Line 1806 of yacc.c  */
-#line 298 "ASN1.y"
+#line 299 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT);
 	                           _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str));
                                     _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);}
@@ -2189,14 +2190,14 @@ yyreduce:
   case 65:
 
 /* Line 1806 of yacc.c  */
-#line 303 "ASN1.y"
+#line 304 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 66:
 
 /* Line 1806 of yacc.c  */
-#line 304 "ASN1.y"
+#line 305 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (3)].node);
                                                        _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (3)].node)),(yyvsp[(3) - (3)].node));}
     break;
@@ -2204,21 +2205,21 @@ yyreduce:
   case 67:
 
 /* Line 1806 of yacc.c  */
-#line 308 "ASN1.y"
+#line 309 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BIT_STRING);}
     break;
 
   case 68:
 
 /* Line 1806 of yacc.c  */
-#line 309 "ASN1.y"
+#line 310 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BIT_STRING|CONST_SIZE);}
     break;
 
   case 69:
 
 /* Line 1806 of yacc.c  */
-#line 311 "ASN1.y"
+#line 312 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BIT_STRING|CONST_LIST);
                                 _asn1_set_down((yyval.node),(yyvsp[(4) - (5)].node));}
     break;
@@ -2226,7 +2227,7 @@ yyreduce:
   case 70:
 
 /* Line 1806 of yacc.c  */
-#line 316 "ASN1.y"
+#line 317 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_ENUMERATED|CONST_LIST);
                                 _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
     break;
@@ -2234,14 +2235,14 @@ yyreduce:
   case 71:
 
 /* Line 1806 of yacc.c  */
-#line 321 "ASN1.y"
+#line 322 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID);}
     break;
 
   case 72:
 
 /* Line 1806 of yacc.c  */
-#line 324 "ASN1.y"
+#line 325 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IDENTIFIER);
                                        _asn1_set_value((yyval.node),(yyvsp[(1) - (1)].str),strlen((yyvsp[(1) - (1)].str))+1);}
     break;
@@ -2249,7 +2250,7 @@ yyreduce:
   case 73:
 
 /* Line 1806 of yacc.c  */
-#line 326 "ASN1.y"
+#line 327 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IDENTIFIER|CONST_SIZE);
                                        _asn1_set_value((yyval.node),(yyvsp[(1) - (2)].str),strlen((yyvsp[(1) - (2)].str))+1);
                                        _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
@@ -2258,154 +2259,154 @@ yyreduce:
   case 74:
 
 /* Line 1806 of yacc.c  */
-#line 329 "ASN1.y"
+#line 330 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 75:
 
 /* Line 1806 of yacc.c  */
-#line 330 "ASN1.y"
+#line 331 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 76:
 
 /* Line 1806 of yacc.c  */
-#line 331 "ASN1.y"
+#line 332 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 78:
 
 /* Line 1806 of yacc.c  */
-#line 333 "ASN1.y"
+#line 334 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 79:
 
 /* Line 1806 of yacc.c  */
-#line 334 "ASN1.y"
+#line 335 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 80:
 
 /* Line 1806 of yacc.c  */
-#line 335 "ASN1.y"
+#line 336 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 81:
 
 /* Line 1806 of yacc.c  */
-#line 336 "ASN1.y"
+#line 337 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 82:
 
 /* Line 1806 of yacc.c  */
-#line 337 "ASN1.y"
+#line 338 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 83:
 
 /* Line 1806 of yacc.c  */
-#line 338 "ASN1.y"
+#line 339 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 84:
 
 /* Line 1806 of yacc.c  */
-#line 339 "ASN1.y"
+#line 340 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 85:
 
 /* Line 1806 of yacc.c  */
-#line 340 "ASN1.y"
+#line 341 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 86:
 
 /* Line 1806 of yacc.c  */
-#line 341 "ASN1.y"
+#line 342 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 87:
 
 /* Line 1806 of yacc.c  */
-#line 342 "ASN1.y"
+#line 343 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 88:
 
 /* Line 1806 of yacc.c  */
-#line 343 "ASN1.y"
+#line 344 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 89:
 
 /* Line 1806 of yacc.c  */
-#line 344 "ASN1.y"
+#line 345 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 90:
 
 /* Line 1806 of yacc.c  */
-#line 345 "ASN1.y"
+#line 346 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 91:
 
 /* Line 1806 of yacc.c  */
-#line 346 "ASN1.y"
+#line 347 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 92:
 
 /* Line 1806 of yacc.c  */
-#line 347 "ASN1.y"
+#line 348 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 93:
 
 /* Line 1806 of yacc.c  */
-#line 348 "ASN1.y"
+#line 349 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 94:
 
 /* Line 1806 of yacc.c  */
-#line 349 "ASN1.y"
+#line 350 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_NULL);}
     break;
 
   case 95:
 
 /* Line 1806 of yacc.c  */
-#line 352 "ASN1.y"
+#line 353 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 96:
 
 /* Line 1806 of yacc.c  */
-#line 353 "ASN1.y"
+#line 354 "ASN1.y"
     {(yyval.node)=_asn1_mod_type((yyvsp[(2) - (2)].node),CONST_TAG);
                                                _asn1_set_right((yyvsp[(1) - (2)].node),_asn1_get_down((yyval.node)));
                                                _asn1_set_down((yyval.node),(yyvsp[(1) - (2)].node));}
@@ -2414,14 +2415,14 @@ yyreduce:
   case 97:
 
 /* Line 1806 of yacc.c  */
-#line 358 "ASN1.y"
+#line 359 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 98:
 
 /* Line 1806 of yacc.c  */
-#line 359 "ASN1.y"
+#line 360 "ASN1.y"
     {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_DEFAULT);
                                                        _asn1_set_right((yyvsp[(2) - (2)].node),_asn1_get_down((yyval.node)));
 						       _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
@@ -2430,28 +2431,28 @@ yyreduce:
   case 99:
 
 /* Line 1806 of yacc.c  */
-#line 362 "ASN1.y"
+#line 363 "ASN1.y"
     {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_OPTION);}
     break;
 
   case 100:
 
 /* Line 1806 of yacc.c  */
-#line 365 "ASN1.y"
+#line 366 "ASN1.y"
     {(yyval.node)=_asn1_set_name((yyvsp[(2) - (2)].node),(yyvsp[(1) - (2)].str));}
     break;
 
   case 101:
 
 /* Line 1806 of yacc.c  */
-#line 368 "ASN1.y"
+#line 369 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 102:
 
 /* Line 1806 of yacc.c  */
-#line 369 "ASN1.y"
+#line 370 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (3)].node);
                                                 _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (3)].node)),(yyvsp[(3) - (3)].node));}
     break;
@@ -2459,7 +2460,7 @@ yyreduce:
   case 103:
 
 /* Line 1806 of yacc.c  */
-#line 373 "ASN1.y"
+#line 374 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SEQUENCE);
                                               _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
     break;
@@ -2467,7 +2468,7 @@ yyreduce:
   case 104:
 
 /* Line 1806 of yacc.c  */
-#line 375 "ASN1.y"
+#line 376 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SEQUENCE_OF);
                                               _asn1_set_down((yyval.node),(yyvsp[(3) - (3)].node));}
     break;
@@ -2475,7 +2476,7 @@ yyreduce:
   case 105:
 
 /* Line 1806 of yacc.c  */
-#line 377 "ASN1.y"
+#line 378 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SEQUENCE_OF|CONST_SIZE);
                                             _asn1_set_right((yyvsp[(2) - (4)].node),(yyvsp[(4) - (4)].node));
                                             _asn1_set_down((yyval.node),(yyvsp[(2) - (4)].node));}
@@ -2484,7 +2485,7 @@ yyreduce:
   case 106:
 
 /* Line 1806 of yacc.c  */
-#line 382 "ASN1.y"
+#line 383 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SET);
                                      _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
     break;
@@ -2492,7 +2493,7 @@ yyreduce:
   case 107:
 
 /* Line 1806 of yacc.c  */
-#line 384 "ASN1.y"
+#line 385 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SET_OF);
                                      _asn1_set_down((yyval.node),(yyvsp[(3) - (3)].node));}
     break;
@@ -2500,7 +2501,7 @@ yyreduce:
   case 108:
 
 /* Line 1806 of yacc.c  */
-#line 386 "ASN1.y"
+#line 387 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SET_OF|CONST_SIZE);
                                        _asn1_set_right((yyvsp[(2) - (4)].node),(yyvsp[(4) - (4)].node));
                                        _asn1_set_down((yyval.node),(yyvsp[(2) - (4)].node));}
@@ -2509,7 +2510,7 @@ yyreduce:
   case 109:
 
 /* Line 1806 of yacc.c  */
-#line 391 "ASN1.y"
+#line 392 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CHOICE);
                                              _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
     break;
@@ -2517,14 +2518,14 @@ yyreduce:
   case 110:
 
 /* Line 1806 of yacc.c  */
-#line 395 "ASN1.y"
+#line 396 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_ANY);}
     break;
 
   case 111:
 
 /* Line 1806 of yacc.c  */
-#line 396 "ASN1.y"
+#line 397 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_ANY|CONST_DEFINED_BY);
                                         _asn1_set_down((yyval.node),_asn1_add_static_node(ASN1_ETYPE_CONSTANT));
 	                                _asn1_set_name(_asn1_get_down((yyval.node)),(yyvsp[(4) - (4)].str));}
@@ -2533,21 +2534,21 @@ yyreduce:
   case 112:
 
 /* Line 1806 of yacc.c  */
-#line 401 "ASN1.y"
+#line 402 "ASN1.y"
     {(yyval.node)=_asn1_set_name((yyvsp[(3) - (3)].node),(yyvsp[(1) - (3)].str));}
     break;
 
   case 113:
 
 /* Line 1806 of yacc.c  */
-#line 403 "ASN1.y"
-    {(yyval.node)=_asn1_set_name((yyvsp[(2) - (2)].node), "");}
+#line 404 "ASN1.y"
+    {(yyval.node)=_asn1_set_name((yyvsp[(3) - (3)].node), last_error_token);}
     break;
 
   case 114:
 
 /* Line 1806 of yacc.c  */
-#line 407 "ASN1.y"
+#line 408 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID|CONST_ASSIGN);
                          _asn1_set_name((yyval.node),(yyvsp[(1) - (7)].str));
                          _asn1_set_down((yyval.node),(yyvsp[(6) - (7)].node));}
@@ -2556,7 +2557,7 @@ yyreduce:
   case 115:
 
 /* Line 1806 of yacc.c  */
-#line 411 "ASN1.y"
+#line 412 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID|CONST_ASSIGN|CONST_1_PARAM);
                          _asn1_set_name((yyval.node),(yyvsp[(1) - (6)].str));
                          _asn1_set_value((yyval.node),(yyvsp[(2) - (6)].str),strlen((yyvsp[(2) - (6)].str))+1);
@@ -2566,7 +2567,7 @@ yyreduce:
   case 116:
 
 /* Line 1806 of yacc.c  */
-#line 416 "ASN1.y"
+#line 417 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER|CONST_ASSIGN);
                          _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str));
                          _asn1_set_value((yyval.node),(yyvsp[(4) - (4)].str),strlen((yyvsp[(4) - (4)].str))+1);}
@@ -2575,28 +2576,28 @@ yyreduce:
   case 117:
 
 /* Line 1806 of yacc.c  */
-#line 421 "ASN1.y"
+#line 422 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 118:
 
 /* Line 1806 of yacc.c  */
-#line 422 "ASN1.y"
+#line 423 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 119:
 
 /* Line 1806 of yacc.c  */
-#line 425 "ASN1.y"
+#line 426 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (1)].node);}
     break;
 
   case 120:
 
 /* Line 1806 of yacc.c  */
-#line 426 "ASN1.y"
+#line 427 "ASN1.y"
     {(yyval.node)=(yyvsp[(1) - (2)].node);
                                                           _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (2)].node)),(yyvsp[(2) - (2)].node));}
     break;
@@ -2604,7 +2605,7 @@ yyreduce:
   case 121:
 
 /* Line 1806 of yacc.c  */
-#line 430 "ASN1.y"
+#line 431 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID);
                                                           _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));
                                                           _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str));}
@@ -2613,7 +2614,7 @@ yyreduce:
   case 122:
 
 /* Line 1806 of yacc.c  */
-#line 433 "ASN1.y"
+#line 434 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID);
                                                           _asn1_set_name((yyval.node),(yyvsp[(1) - (3)].str));}
     break;
@@ -2621,7 +2622,7 @@ yyreduce:
   case 123:
 
 /* Line 1806 of yacc.c  */
-#line 435 "ASN1.y"
+#line 436 "ASN1.y"
     {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID);
                                                           _asn1_set_name((yyval.node),(yyvsp[(1) - (1)].str));}
     break;
@@ -2629,21 +2630,21 @@ yyreduce:
   case 124:
 
 /* Line 1806 of yacc.c  */
-#line 459 "ASN1.y"
+#line 460 "ASN1.y"
     {(yyval.constant)=CONST_EXPLICIT;}
     break;
 
   case 125:
 
 /* Line 1806 of yacc.c  */
-#line 460 "ASN1.y"
+#line 461 "ASN1.y"
     {(yyval.constant)=CONST_IMPLICIT;}
     break;
 
 
 
 /* Line 1806 of yacc.c  */
-#line 2647 "ASN1.c"
+#line 2648 "ASN1.c"
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
@@ -2874,7 +2875,7 @@ yyreturn:
 
 
 /* Line 2067 of yacc.c  */
-#line 464 "ASN1.y"
+#line 465 "ASN1.y"
 
 
 
@@ -3020,6 +3021,9 @@ _asn1_create_errorDescription (int error, char *error_desc)
 
   switch (error)
     {
+    case ASN1_FILE_NOT_FOUND:
+      snprintf(error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE, "%s file was not found", file_name);
+      break;
     case ASN1_SYNTAX_ERROR:
       strcpy(error_desc, last_error);
       break;
@@ -3279,6 +3283,8 @@ _asn1_yyerror (const char *s)
       strcmp (last_token, "TeletexString") == 0 ||
       strcmp (last_token, "BMPString") == 0)
     {
+      snprintf (last_error_token, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
+                "%s", last_token);
       fprintf(stderr, 
                "%s:%ld: Warning: %s is a built-in ASN.1 type.\n",
                file_name, line_number, last_token);
diff --git a/lib/ASN1.y b/lib/ASN1.y
index c5bca99..d975632 100644
--- a/lib/ASN1.y
+++ b/lib/ASN1.y
@@ -42,7 +42,8 @@ static unsigned int line_number;	/* line number describing the
 					   parser position inside the
 					   file */
 static char last_error[ASN1_MAX_ERROR_DESCRIPTION_SIZE] = "";
-static char last_token[ASN1_MAX_NAME_SIZE+1];	/* last token find in the file
+static char last_error_token[ASN1_MAX_NAME_SIZE+1] = ""; /* used when expected errors occur */
+static char last_token[ASN1_MAX_NAME_SIZE+1] = ""; /* last token find in the file
 					   to parse before the 'parse
 					   error' */
 extern char _asn1_identifierMissing[];
@@ -400,7 +401,7 @@ any_def :  ANY                         {$$=_asn1_add_static_node(ASN1_ETYPE_ANY)
 
 type_def : IDENTIFIER "::=" type_assig_right_tag  {$$=_asn1_set_name($3,$1);}
               /* below should match: BMPString ::= [UNIVERSAL 30] IMPLICIT OCTET STRING etc*/
-              | error type_assig_right_tag {$$=_asn1_set_name($2, "");}
+              | error "::=" type_assig_right_tag {$$=_asn1_set_name($3, last_error_token);}
 ;
 
 constant_def :  IDENTIFIER OBJECT STR_IDENTIFIER "::=" '{'obj_constant_list'}'
@@ -606,6 +607,9 @@ _asn1_create_errorDescription (int error, char *error_desc)
 
   switch (error)
     {
+    case ASN1_FILE_NOT_FOUND:
+      snprintf(error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE, "%s file was not found", file_name);
+      break;
     case ASN1_SYNTAX_ERROR:
       strcpy(error_desc, last_error);
       break;
@@ -865,6 +869,8 @@ _asn1_yyerror (const char *s)
       strcmp (last_token, "TeletexString") == 0 ||
       strcmp (last_token, "BMPString") == 0)
     {
+      snprintf (last_error_token, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
+                "%s", last_token);
       fprintf(stderr, 
                "%s:%ld: Warning: %s is a built-in ASN.1 type.\n",
                file_name, line_number, last_token);
diff --git a/src/asn1Parser.c b/src/asn1Parser.c
index f19a9ef..64bf16b 100644
--- a/src/asn1Parser.c
+++ b/src/asn1Parser.c
@@ -174,7 +174,7 @@ main (int argc, char *argv[])
       fputs ("Done.\n", stderr);
       break;
     case ASN1_FILE_NOT_FOUND:
-      fprintf (stderr, "asn1Parser: FILE %s NOT FOUND\n",
+      fprintf (stderr, "asn1Parser: file %s was not found\n",
                inputFileName);
       break;
     case ASN1_SYNTAX_ERROR:
diff --git a/tests/Test_tree_asn1_tab.c b/tests/Test_tree_asn1_tab.c
index 3d406d1..7869f85 100644
--- a/tests/Test_tree_asn1_tab.c
+++ b/tests/Test_tree_asn1_tab.c
@@ -87,10 +87,10 @@ const asn1_static_node Test_tree_asn1_tab[] = {
   { NULL, 2056, "2"},
   { "int2", 1610620931, NULL },
   { NULL, 4104, "3"},
-  { "str1", 1610620930, "PrintableString"},
+  { "str1", 1610620959, NULL },
   { NULL, 4104, "1"},
-  { "str2", 1073741826, "UniversalString"},
-  { "str3", 536879106, "UniversalString"},
+  { "str2", 1073741856, NULL },
+  { "str3", 536879136, NULL },
   { NULL, 2056, "2"},
   { "Sequence1", 1610612741, NULL },
   { "int1", 1610915843, NULL },
@@ -155,11 +155,11 @@ const asn1_static_node Test_tree_asn1_tab[] = {
   { "GeneralString2", 1610620955, NULL },
   { NULL, 2056, "2"},
   { "X520LocalityName", 1610612754, NULL },
-  { "teletexString", 1073741826, "TeletexString"},
-  { "printableString", 1073741826, "PrintableString"},
-  { "universalString", 1073741826, "UniversalString"},
-  { "utf8String", 1073741826, "UTF8String"},
-  { "bmpString", 2, "BMPString"},
+  { "teletexString", 1073741854, NULL },
+  { "printableString", 1073741855, NULL },
+  { "universalString", 1073741856, NULL },
+  { "utf8String", 1073741858, NULL },
+  { "bmpString", 33, NULL },
   { "id-Test", 805306380, NULL },
   { NULL, 1073741825, "1"},
   { NULL, 1073741825, "2"},


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Fri Nov 23 15:26:28 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TbzpU-0004ni-A3
	for mharc-libtasn1-commit@gnu.org; Fri, 23 Nov 2012 15:26:28 -0500
Received: from eggs.gnu.org ([208.118.235.92]:39450)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TbzpP-0004nX-Vq
	for libtasn1-commit@gnu.org; Fri, 23 Nov 2012 15:26:27 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TbzpL-0007HQ-7x
	for libtasn1-commit@gnu.org; Fri, 23 Nov 2012 15:26:23 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:60890)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TbzpL-0007HM-38
	for libtasn1-commit@gnu.org; Fri, 23 Nov 2012 15:26:19 -0500
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TbzoZ-0000TT-05
	for libtasn1-commit@gnu.org; Fri, 23 Nov 2012 20:25:39 +0000
Date: Fri, 23 Nov 2012 20:25:31 +0000
Message-Id: <E1TbzoZ-0000TT-05@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_0-26-g1d02266
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: ce0dbb2d2e8c5c18532afce2833af334440ae00c
X-Git-Newrev: 1d02266a174c939e9ca1460641c8eaa9dc2a7843
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 23 Nov 2012 20:26:27 -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=1d02266a174c939e9ca1460641c8eaa9dc2a7843

The branch, master has been updated
       via  1d02266a174c939e9ca1460641c8eaa9dc2a7843 (commit)
       via  d23e8f3918d401fbaa25a1342b5db368f9f3adef (commit)
       via  f4e6030e0ee82a3d10ad9c0f55fad972d1c3a2c5 (commit)
       via  1153d7fa1ba99b6320cfc152395508692480440d (commit)
      from  ce0dbb2d2e8c5c18532afce2833af334440ae00c (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 1d02266a174c939e9ca1460641c8eaa9dc2a7843
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Fri Nov 23 21:00:50 2012 +0100

    simplified and renamed asn1_encode_string_der() and asn1_decode_string_der()

commit d23e8f3918d401fbaa25a1342b5db368f9f3adef
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Fri Nov 23 20:29:02 2012 +0100

    renamed types

commit f4e6030e0ee82a3d10ad9c0f55fad972d1c3a2c5
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Fri Nov 23 20:24:35 2012 +0100

    Added asn1_decode_string_der() and asn1_encode_string_der().

commit 1153d7fa1ba99b6320cfc152395508692480440d
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Fri Nov 23 09:47:24 2012 +0100

    zeroize last_error_token on unknown errors.

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

Summary of changes:
 .gitignore           |    4 +
 NEWS                 |    1 +
 configure.ac         |    1 +
 lib/ASN1.c           |   38 ++++++------
 lib/ASN1.y           |   38 ++++++------
 lib/coding.c         |  167 ++++++++++++++++++++++++++++++++++++++------------
 lib/decoding.c       |  125 ++++++++++++++++++++++++++-----------
 lib/element.c        |   38 ++++++------
 lib/int.h            |   21 ++++---
 lib/libtasn1.h       |   81 ++++++++++++++-----------
 lib/libtasn1.map     |    2 +
 lib/parser_aux.c     |    6 +-
 lib/parser_aux.h     |    2 +-
 lib/structure.c      |   16 +++---
 tests/Makefile.am    |    7 +-
 tests/Test_strings.c |   98 +++++++++++++++++++++++++++++
 16 files changed, 454 insertions(+), 191 deletions(-)
 create mode 100644 tests/Test_strings.c

diff --git a/.gitignore b/.gitignore
index e6f9fc5..2b5f79c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
+tags
+*~
 *.gcda
 *.gcno
 *.gcov
@@ -188,6 +190,8 @@ tests/Makefile
 tests/Makefile.in
 tests/Test_encoding
 tests/Test_encoding.o
+tests/Test_strings.o
+tests/Test_strings
 tests/Test_errors
 tests/Test_errors.o
 tests/Test_indefinite
diff --git a/NEWS b/NEWS
index be519ba..a29e187 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ GNU Libtasn1 NEWS                                     -*- outline -*-
   PrintableString, UniversalString, BMPString, UTF8String. When re-defined
   a warning is being print instead of failing.
 - Parser outputs more detailed syntax error message.
+- Added asn1_decode_simple_der() and asn1_encode_simple_der().
 
 * Noteworthy changes in release 3.0 (2012-10-28) [stable]
 - Added tool in tests/ to benchmark X.509 structure decoding.
diff --git a/configure.ac b/configure.ac
index 0acd74a..839fc6b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,6 +78,7 @@ if test "$gl_gcc_warnings" = yes; then
   nw="$nw -Wundef"                  #
   nw="$nw -Wunreachable-code"       # Too many false positives
   nw="$nw -Wunused-macros"          # Breaks on bison generated ASN1.c
+  nw="$nw -Wswitch-default"         # Breaks on bison generated ASN1.c
   nw="$nw -Wunsafe-loop-optimizations"
   nw="$nw -Wstrict-overflow"
   nw="$nw -Wsuggest-attribute=pure" # Is it worth using pure attributes?
diff --git a/lib/ASN1.c b/lib/ASN1.c
index 075c81c..928d28d 100644
--- a/lib/ASN1.c
+++ b/lib/ASN1.c
@@ -2047,14 +2047,14 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 254 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_NUMERICSTRING|CONST_UNIVERSAL);}
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_NUMERIC_STRING|CONST_UNIVERSAL);}
     break;
 
   case 47:
 
 /* Line 1806 of yacc.c  */
 #line 255 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_NUMERICSTRING|CONST_SIZE);
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_NUMERIC_STRING|CONST_SIZE);
 					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
@@ -2062,14 +2062,14 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 259 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IA5STRING);}
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IA5_STRING);}
     break;
 
   case 49:
 
 /* Line 1806 of yacc.c  */
 #line 260 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IA5STRING|CONST_SIZE);
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IA5_STRING|CONST_SIZE);
 					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
@@ -2077,14 +2077,14 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 264 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TELETEXSTRING);}
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TELETEX_STRING);}
     break;
 
   case 51:
 
 /* Line 1806 of yacc.c  */
 #line 265 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TELETEXSTRING|CONST_SIZE);
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TELETEX_STRING|CONST_SIZE);
 					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
@@ -2092,14 +2092,14 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 269 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_PRINTABLESTRING);}
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_PRINTABLE_STRING);}
     break;
 
   case 53:
 
 /* Line 1806 of yacc.c  */
 #line 270 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_PRINTABLESTRING|CONST_SIZE);
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_PRINTABLE_STRING|CONST_SIZE);
 					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
@@ -2107,14 +2107,14 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 274 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UNIVERSALSTRING);}
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UNIVERSAL_STRING);}
     break;
 
   case 55:
 
 /* Line 1806 of yacc.c  */
 #line 275 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UNIVERSALSTRING|CONST_SIZE);
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UNIVERSAL_STRING|CONST_SIZE);
 					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
@@ -2122,14 +2122,14 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 279 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BMPSTRING);}
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BMP_STRING);}
     break;
 
   case 57:
 
 /* Line 1806 of yacc.c  */
 #line 280 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BMPSTRING|CONST_SIZE);
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BMP_STRING|CONST_SIZE);
 					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
@@ -2137,14 +2137,14 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 284 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UTF8STRING);}
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UTF8_STRING);}
     break;
 
   case 59:
 
 /* Line 1806 of yacc.c  */
 #line 285 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UTF8STRING|CONST_SIZE);
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UTF8_STRING|CONST_SIZE);
 					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
@@ -2152,14 +2152,14 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 289 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_VISIBLESTRING);}
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_VISIBLE_STRING);}
     break;
 
   case 61:
 
 /* Line 1806 of yacc.c  */
 #line 290 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_VISIBLESTRING|CONST_SIZE);
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_VISIBLE_STRING|CONST_SIZE);
 					  _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
@@ -3286,16 +3286,16 @@ _asn1_yyerror (const char *s)
       snprintf (last_error_token, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
                 "%s", last_token);
       fprintf(stderr, 
-               "%s:%ld: Warning: %s is a built-in ASN.1 type.\n",
+               "%s:%u: Warning: %s is a built-in ASN.1 type.\n",
                file_name, line_number, last_token);
       return;
     }
-
+  last_error_token[0] = 0;
 
   if (result_parse != ASN1_NAME_TOO_LONG)
     {
       snprintf (last_error, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
-                "%s:%ld: Error: %s near '%s'", file_name,
+                "%s:%u: Error: %s near '%s'", file_name,
                 line_number, s, last_token);
       result_parse = ASN1_SYNTAX_ERROR;
     }
diff --git a/lib/ASN1.y b/lib/ASN1.y
index d975632..dafe15a 100644
--- a/lib/ASN1.y
+++ b/lib/ASN1.y
@@ -251,43 +251,43 @@ generalstring_def: GeneralString {$$=_asn1_add_static_node(ASN1_ETYPE_GENERALSTR
 					  _asn1_set_down($$,$2);}
 ;
 
-numericstring_def: NumericString {$$=_asn1_add_static_node(ASN1_ETYPE_NUMERICSTRING|CONST_UNIVERSAL);}
-                | NumericString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_NUMERICSTRING|CONST_SIZE);
+numericstring_def: NumericString {$$=_asn1_add_static_node(ASN1_ETYPE_NUMERIC_STRING|CONST_UNIVERSAL);}
+                | NumericString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_NUMERIC_STRING|CONST_SIZE);
 					  _asn1_set_down($$,$2);}
 ;
 
-ia5string_def: IA5String {$$=_asn1_add_static_node(ASN1_ETYPE_IA5STRING);}
-                | IA5String size_def {$$=_asn1_add_static_node(ASN1_ETYPE_IA5STRING|CONST_SIZE);
+ia5string_def: IA5String {$$=_asn1_add_static_node(ASN1_ETYPE_IA5_STRING);}
+                | IA5String size_def {$$=_asn1_add_static_node(ASN1_ETYPE_IA5_STRING|CONST_SIZE);
 					  _asn1_set_down($$,$2);}
 ;
 
-teletexstring_def: TeletexString {$$=_asn1_add_static_node(ASN1_ETYPE_TELETEXSTRING);}
-                | TeletexString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_TELETEXSTRING|CONST_SIZE);
+teletexstring_def: TeletexString {$$=_asn1_add_static_node(ASN1_ETYPE_TELETEX_STRING);}
+                | TeletexString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_TELETEX_STRING|CONST_SIZE);
 					  _asn1_set_down($$,$2);}
 ;
 
-printablestring_def: PrintableString {$$=_asn1_add_static_node(ASN1_ETYPE_PRINTABLESTRING);}
-                | PrintableString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_PRINTABLESTRING|CONST_SIZE);
+printablestring_def: PrintableString {$$=_asn1_add_static_node(ASN1_ETYPE_PRINTABLE_STRING);}
+                | PrintableString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_PRINTABLE_STRING|CONST_SIZE);
 					  _asn1_set_down($$,$2);}
 ;
 
-universalstring_def: UniversalString {$$=_asn1_add_static_node(ASN1_ETYPE_UNIVERSALSTRING);}
-                | UniversalString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_UNIVERSALSTRING|CONST_SIZE);
+universalstring_def: UniversalString {$$=_asn1_add_static_node(ASN1_ETYPE_UNIVERSAL_STRING);}
+                | UniversalString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_UNIVERSAL_STRING|CONST_SIZE);
 					  _asn1_set_down($$,$2);}
 ;
 
-bmpstring_def: BMPString {$$=_asn1_add_static_node(ASN1_ETYPE_BMPSTRING);}
-                | BMPString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_BMPSTRING|CONST_SIZE);
+bmpstring_def: BMPString {$$=_asn1_add_static_node(ASN1_ETYPE_BMP_STRING);}
+                | BMPString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_BMP_STRING|CONST_SIZE);
 					  _asn1_set_down($$,$2);}
 ;
 
-utf8string_def: UTF8String {$$=_asn1_add_static_node(ASN1_ETYPE_UTF8STRING);}
-                | UTF8String size_def {$$=_asn1_add_static_node(ASN1_ETYPE_UTF8STRING|CONST_SIZE);
+utf8string_def: UTF8String {$$=_asn1_add_static_node(ASN1_ETYPE_UTF8_STRING);}
+                | UTF8String size_def {$$=_asn1_add_static_node(ASN1_ETYPE_UTF8_STRING|CONST_SIZE);
 					  _asn1_set_down($$,$2);}
 ;
 
-visiblestring_def: VisibleString {$$=_asn1_add_static_node(ASN1_ETYPE_VISIBLESTRING);}
-                | VisibleString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_VISIBLESTRING|CONST_SIZE);
+visiblestring_def: VisibleString {$$=_asn1_add_static_node(ASN1_ETYPE_VISIBLE_STRING);}
+                | VisibleString size_def {$$=_asn1_add_static_node(ASN1_ETYPE_VISIBLE_STRING|CONST_SIZE);
 					  _asn1_set_down($$,$2);}
 ;
 
@@ -872,16 +872,16 @@ _asn1_yyerror (const char *s)
       snprintf (last_error_token, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
                 "%s", last_token);
       fprintf(stderr, 
-               "%s:%ld: Warning: %s is a built-in ASN.1 type.\n",
+               "%s:%u: Warning: %s is a built-in ASN.1 type.\n",
                file_name, line_number, last_token);
       return;
     }
-
+  last_error_token[0] = 0;
 
   if (result_parse != ASN1_NAME_TOO_LONG)
     {
       snprintf (last_error, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
-                "%s:%ld: Error: %s near '%s'", file_name,
+                "%s:%u: Error: %s near '%s'", file_name,
                 line_number, s, last_token);
       result_parse = ASN1_SYNTAX_ERROR;
     }
diff --git a/lib/coding.c b/lib/coding.c
index 0802f73..aa777f3 100644
--- a/lib/coding.c
+++ b/lib/coding.c
@@ -61,24 +61,30 @@ _asn1_error_description_value_not_found (asn1_node node,
 /**
  * asn1_length_der:
  * @len: value to convert.
- * @ans: string returned.
- * @ans_len: number of meaningful bytes of ANS (ans[0]..ans[ans_len-1]).
+ * @der: the encoding (may be %NULL).
+ * @der_len: number of meaningful bytes of ANS (der[0]..der[der_len-1]).
  *
- * Creates the DER coding for the LEN parameter (only the length).
- * The @ans buffer is pre-allocated and must have room for the output.
+ * Creates the DER encoding of the provided length value.
+ * The @der buffer must have enough room for the output. The maximum
+ * length this function will encode is %ASN1_MAX_LENGTH_SIZE.
+ * 
+ * To know the size of the DER encoding use a %NULL value for @der.
  **/
 void
-asn1_length_der (unsigned long int len, unsigned char *ans, int *ans_len)
+asn1_length_der (unsigned long int len, unsigned char *der, int *der_len)
 {
   int k;
-  unsigned char temp[SIZEOF_UNSIGNED_LONG_INT];
+  unsigned char temp[ASN1_MAX_LENGTH_SIZE];
+#if SIZEOF_UNSIGNED_LONG_INT > 8
+  len &= 0xFFFFFFFFFFFFFFFF;
+#endif
 
   if (len < 128)
     {
       /* short form */
-      if (ans != NULL)
-	ans[0] = (unsigned char) len;
-      *ans_len = 1;
+      if (der != NULL)
+	der[0] = (unsigned char) len;
+      *der_len = 1;
     }
   else
     {
@@ -89,12 +95,12 @@ asn1_length_der (unsigned long int len, unsigned char *ans, int *ans_len)
 	  temp[k++] = len & 0xFF;
 	  len = len >> 8;
 	}
-      *ans_len = k + 1;
-      if (ans != NULL)
+      *der_len = k + 1;
+      if (der != NULL)
 	{
-	  ans[0] = ((unsigned char) k & 0x7F) + 128;
+	  der[0] = ((unsigned char) k & 0x7F) + 128;
 	  while (k--)
-	    ans[*ans_len - 1 - k] = temp[k];
+	    der[*der_len - 1 - k] = temp[k];
 	}
     }
 }
@@ -103,6 +109,7 @@ asn1_length_der (unsigned long int len, unsigned char *ans, int *ans_len)
 /* Function : _asn1_tag_der                           */
 /* Description: creates the DER coding for the CLASS  */
 /* and TAG parameters.                                */
+/* It is limited by the ASN1_MAX_TAG_SIZE variable    */
 /* Parameters:                                        */
 /*   class: value to convert.                         */
 /*   tag_value: value to convert.                     */
@@ -116,7 +123,7 @@ _asn1_tag_der (unsigned char class, unsigned int tag_value,
 	       unsigned char *ans, int *ans_len)
 {
   int k;
-  unsigned char temp[SIZEOF_UNSIGNED_INT];
+  unsigned char temp[ASN1_MAX_TAG_SIZE];
 
   if (tag_value < 31)
     {
@@ -129,10 +136,13 @@ _asn1_tag_der (unsigned char class, unsigned int tag_value,
       /* Long form */
       ans[0] = (class & 0xE0) + 31;
       k = 0;
-      while (tag_value)
+      while (tag_value != 0)
 	{
 	  temp[k++] = tag_value & 0x7F;
-	  tag_value = tag_value >> 7;
+	  tag_value >>= 7;
+	  
+	  if (k > ASN1_MAX_TAG_SIZE-1)
+	    break; /* will not encode larger tags */
 	}
       *ans_len = k + 1;
       while (k--)
@@ -143,12 +153,20 @@ _asn1_tag_der (unsigned char class, unsigned int tag_value,
 
 /**
  * asn1_octet_der:
- * @str: OCTET string.
- * @str_len: STR length (str[0]..str[str_len-1]).
- * @der: string returned.
- * @der_len: number of meaningful bytes of DER (der[0]..der[ans_len-1]).
+ * @str: the input data.
+ * @str_len: STR length (str[0]..str[*str_len-1]).
+ * @der: encoded string returned.
+ * @der_len: number of meaningful bytes of DER (der[0]..der[der_len-1]).
  *
- * Creates the DER coding for an OCTET type (length included).
+ * Creates a length-value DER encoding for the input data.
+ * The DER encoding of the input data will be placed in the @der variable.
+ *
+ * Note that the OCTET STRING tag is not included in the output.
+ *
+ * This function does not return any value because it is expected
+ * that @der_len will contain enough bytes to store the string
+ * plus the DER encoding. The DER encoding size can be obtained using
+ * asn1_length_der().
  **/
 void
 asn1_octet_der (const unsigned char *str, int str_len,
@@ -158,11 +176,70 @@ asn1_octet_der (const unsigned char *str, int str_len,
 
   if (der == NULL || str_len < 0)
     return;
+
   asn1_length_der (str_len, der, &len_len);
   memcpy (der + len_len, str, str_len);
   *der_len = str_len + len_len;
 }
 
+
+/**
+ * asn1_encode_simple_der:
+ * @etype: The type of the string to be encoded (ASN1_ETYPE_)
+ * @str: the string data.
+ * @str_len: the string length
+ * @tl: the encoded tag and length
+ * @tl_len: the bytes of the @tl field
+ *
+ * Creates the DER encoding for various simple ASN.1 types like strings etc.
+ * It stores the tag and length in @tl, which should have space for at least 
+ * %ASN1_MAX_TL_SIZE bytes. Initially @tl_len should contain the size of @tl.
+ *
+ * The complete DER encoding should consist of the value in @tl appended
+ * with the provided @str.
+ *
+ * Returns: %ASN1_SUCCESS if successful or an error value. 
+ **/
+int
+asn1_encode_simple_der (unsigned int etype, const unsigned char *str, unsigned int str_len,
+                        unsigned char *tl, unsigned int *tl_len)
+{
+  int tag_len, len_len;
+  unsigned tlen;
+  unsigned char der_tag[ASN1_MAX_TAG_SIZE];
+  unsigned char der_length[ASN1_MAX_LENGTH_SIZE];
+  unsigned char* p;
+
+  if (str == NULL)
+    return ASN1_VALUE_NOT_VALID;
+
+  if (ETYPE_OK(etype) == 0)
+    return ASN1_VALUE_NOT_VALID;
+    
+
+  _asn1_tag_der (ETYPE_CLASS(etype), ETYPE_TAG(etype),
+	         der_tag, &tag_len);
+
+  asn1_length_der(str_len, der_length, &len_len);
+
+  if (tag_len <= 0 || len_len <= 0)
+    return ASN1_VALUE_NOT_VALID;
+  
+  tlen = tag_len + len_len;
+
+  if (*tl_len < tlen)
+    return ASN1_MEM_ERROR;
+
+  p = tl;
+  memcpy(p, der_tag, tag_len);
+  p+=tag_len;
+  memcpy(p, der_length, len_len);
+  
+  *tl_len = tlen;
+
+  return ASN1_SUCCESS;
+}
+
 /******************************************************/
 /* Function : _asn1_time_der                          */
 /* Description: creates the DER coding for a TIME     */
@@ -333,8 +410,16 @@ static const unsigned char bit_mask[] =
  * @der_len: number of meaningful bytes of DER
  *   (der[0]..der[ans_len-1]).
  *
- * Creates the DER coding for a BIT STRING type (length and pad
- * included).
+ * Creates a length-value DER encoding for the input data
+ * as it would have been for a BIT STRING.
+ * The DER encoded data will be copied in @der.
+ *
+ * Note that the BIT STRING tag is not included in the output.
+ *
+ * This function does not return any value because it is expected
+ * that @der_len will contain enough bytes to store the string
+ * plus the DER encoding. The DER encoding size can be obtained using
+ * asn1_length_der().
  **/
 void
 asn1_bit_der (const unsigned char *str, int bit_len,
@@ -344,6 +429,7 @@ asn1_bit_der (const unsigned char *str, int bit_len,
 
   if (der == NULL)
     return;
+
   len_byte = bit_len >> 3;
   len_pad = 8 - (bit_len & 7);
   if (len_pad == 8)
@@ -432,15 +518,15 @@ _asn1_complete_explicit_tag (asn1_node node, unsigned char *der,
 const tag_and_class_st _asn1_tags[] =
 {
   [ASN1_ETYPE_GENERALSTRING] = {ASN1_TAG_GENERALSTRING, ASN1_CLASS_UNIVERSAL, "type:GENERALSTRING"},
-  [ASN1_ETYPE_NUMERICSTRING] = {ASN1_TAG_NUMERICSTRING, ASN1_CLASS_UNIVERSAL, "type:NUMERIC_STR"},
-  [ASN1_ETYPE_IA5STRING] =     {ASN1_TAG_IA5STRING, ASN1_CLASS_UNIVERSAL, "type:IA5_STR"},
-  [ASN1_ETYPE_TELETEXSTRING] = {ASN1_TAG_TELETEXSTRING, ASN1_CLASS_UNIVERSAL, "type:TELETEX_STR"},
-  [ASN1_ETYPE_PRINTABLESTRING] = {ASN1_TAG_PRINTABLESTRING, ASN1_CLASS_UNIVERSAL, "type:PRINTABLE_STR"},
-  [ASN1_ETYPE_UNIVERSALSTRING] = {ASN1_TAG_UNIVERSALSTRING, ASN1_CLASS_UNIVERSAL, "type:UNIVERSAL_STR"},
-  [ASN1_ETYPE_BMPSTRING] =     {ASN1_TAG_BMPSTRING, ASN1_CLASS_UNIVERSAL, "type:BMP_STR"},
-  [ASN1_ETYPE_UTF8STRING] =    {ASN1_TAG_UTF8STRING, ASN1_CLASS_UNIVERSAL, "type:UTF8_STR"},
-  [ASN1_ETYPE_VISIBLESTRING] = {ASN1_TAG_VISIBLESTRING, ASN1_CLASS_UNIVERSAL, "type:VISIBLE_STR"},
-  [ASN1_ETYPE_OCTET_STRING] = {ASN1_TAG_OCTET_STRING, ASN1_CLASS_UNIVERSAL, "type:OCT_STR"},
+  [ASN1_ETYPE_NUMERIC_STRING] = {ASN1_TAG_NUMERIC_STRING, ASN1_CLASS_UNIVERSAL, "type:NUMERIC_STR"},
+  [ASN1_ETYPE_IA5_STRING] =     {ASN1_TAG_IA5_STRING, ASN1_CLASS_UNIVERSAL, "type:IA5_STR"},
+  [ASN1_ETYPE_TELETEX_STRING] = {ASN1_TAG_TELETEX_STRING, ASN1_CLASS_UNIVERSAL, "type:TELETEX_STR"},
+  [ASN1_ETYPE_PRINTABLE_STRING] = {ASN1_TAG_PRINTABLE_STRING, ASN1_CLASS_UNIVERSAL, "type:PRINTABLE_STR"},
+  [ASN1_ETYPE_UNIVERSAL_STRING] = {ASN1_TAG_UNIVERSAL_STRING, ASN1_CLASS_UNIVERSAL, "type:UNIVERSAL_STR"},
+  [ASN1_ETYPE_BMP_STRING] =       {ASN1_TAG_BMP_STRING, ASN1_CLASS_UNIVERSAL, "type:BMP_STR"},
+  [ASN1_ETYPE_UTF8_STRING] =      {ASN1_TAG_UTF8_STRING, ASN1_CLASS_UNIVERSAL, "type:UTF8_STR"},
+  [ASN1_ETYPE_VISIBLE_STRING] =   {ASN1_TAG_VISIBLE_STRING, ASN1_CLASS_UNIVERSAL, "type:VISIBLE_STR"},
+  [ASN1_ETYPE_OCTET_STRING] =    {ASN1_TAG_OCTET_STRING, ASN1_CLASS_UNIVERSAL, "type:OCT_STR"},
   [ASN1_ETYPE_BIT_STRING] = {ASN1_TAG_BIT_STRING, ASN1_CLASS_UNIVERSAL, "type:BIT_STR"},
   [ASN1_ETYPE_OBJECT_ID] =  {ASN1_TAG_OBJECT_ID, ASN1_CLASS_UNIVERSAL, "type:OBJ_STR"},
   [ASN1_ETYPE_NULL] =       {ASN1_TAG_NULL, ASN1_CLASS_UNIVERSAL, "type:NULL"},
@@ -452,6 +538,7 @@ const tag_and_class_st _asn1_tags[] =
   [ASN1_ETYPE_SET] =        {ASN1_TAG_SET, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED, "type:SET"},
   [ASN1_ETYPE_SET_OF] =     {ASN1_TAG_SET, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED, "type:SET_OF"},
 };
+unsigned int _asn1_tags_size = sizeof(_asn1_tags)/sizeof(_asn1_tags[0]);
 
 /******************************************************/
 /* Function : _asn1_insert_tag_der                    */
@@ -996,14 +1083,14 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
 	  break;
 	case ASN1_ETYPE_OCTET_STRING:
 	case ASN1_ETYPE_GENERALSTRING:
-	case ASN1_ETYPE_NUMERICSTRING:
-	case ASN1_ETYPE_IA5STRING:
-	case ASN1_ETYPE_TELETEXSTRING:
-	case ASN1_ETYPE_PRINTABLESTRING:
-	case ASN1_ETYPE_UNIVERSALSTRING:
-	case ASN1_ETYPE_BMPSTRING:
-	case ASN1_ETYPE_UTF8STRING:
-	case ASN1_ETYPE_VISIBLESTRING:
+	case ASN1_ETYPE_NUMERIC_STRING:
+	case ASN1_ETYPE_IA5_STRING:
+	case ASN1_ETYPE_TELETEX_STRING:
+	case ASN1_ETYPE_PRINTABLE_STRING:
+	case ASN1_ETYPE_UNIVERSAL_STRING:
+	case ASN1_ETYPE_BMP_STRING:
+	case ASN1_ETYPE_UTF8_STRING:
+	case ASN1_ETYPE_VISIBLE_STRING:
 	case ASN1_ETYPE_BIT_STRING:
 	  if (p->value == NULL)
 	    {
diff --git a/lib/decoding.c b/lib/decoding.c
index eb4ca0e..5df1f36 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -498,14 +498,14 @@ _asn1_extract_tag_der (asn1_node node, const unsigned char *der, int der_len,
 	case ASN1_ETYPE_ENUMERATED:
 	case ASN1_ETYPE_OBJECT_ID:
 	case ASN1_ETYPE_GENERALSTRING:
-	case ASN1_ETYPE_NUMERICSTRING:
-	case ASN1_ETYPE_IA5STRING:
-	case ASN1_ETYPE_TELETEXSTRING:
-	case ASN1_ETYPE_PRINTABLESTRING:
-	case ASN1_ETYPE_UNIVERSALSTRING:
-	case ASN1_ETYPE_BMPSTRING:
-	case ASN1_ETYPE_UTF8STRING:
-	case ASN1_ETYPE_VISIBLESTRING:
+	case ASN1_ETYPE_NUMERIC_STRING:
+	case ASN1_ETYPE_IA5_STRING:
+	case ASN1_ETYPE_TELETEX_STRING:
+	case ASN1_ETYPE_PRINTABLE_STRING:
+	case ASN1_ETYPE_UNIVERSAL_STRING:
+	case ASN1_ETYPE_BMP_STRING:
+	case ASN1_ETYPE_UTF8_STRING:
+	case ASN1_ETYPE_VISIBLE_STRING:
 	case ASN1_ETYPE_BIT_STRING:
 	case ASN1_ETYPE_SEQUENCE:
 	case ASN1_ETYPE_SEQUENCE_OF:
@@ -1078,14 +1078,14 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 	      move = RIGHT;
 	      break;
 	    case ASN1_ETYPE_GENERALSTRING:
-            case ASN1_ETYPE_NUMERICSTRING:
-            case ASN1_ETYPE_IA5STRING:
-            case ASN1_ETYPE_TELETEXSTRING:
-            case ASN1_ETYPE_PRINTABLESTRING:
-            case ASN1_ETYPE_UNIVERSALSTRING:
-            case ASN1_ETYPE_BMPSTRING:
-            case ASN1_ETYPE_UTF8STRING:
-            case ASN1_ETYPE_VISIBLESTRING:
+            case ASN1_ETYPE_NUMERIC_STRING:
+            case ASN1_ETYPE_IA5_STRING:
+            case ASN1_ETYPE_TELETEX_STRING:
+            case ASN1_ETYPE_PRINTABLE_STRING:
+            case ASN1_ETYPE_UNIVERSAL_STRING:
+            case ASN1_ETYPE_BMP_STRING:
+            case ASN1_ETYPE_UTF8_STRING:
+            case ASN1_ETYPE_VISIBLE_STRING:
 	    case ASN1_ETYPE_BIT_STRING:
 	      len2 =
 		asn1_get_length_der (der + counter, len - counter, &len3);
@@ -1277,7 +1277,7 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 	      if (len4 != -1)
 		{
 		  len2 += len4;
-		  _asn1_set_value_octet (p, der + counter, len2 + len3);
+		  _asn1_set_value_lv (p, der + counter, len2 + len3);
 		  counter += len2 + len3;
 		}
 	      else
@@ -1294,7 +1294,7 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 		  if (result != ASN1_SUCCESS)
 		    goto cleanup;
 
-		  _asn1_set_value_octet (p, der + counter, len2);
+		  _asn1_set_value_lv (p, der + counter, len2);
 		  counter += len2;
 
 		  /* Check if a couple of 0x00 are present due to an EXPLICIT TAG with
@@ -1756,14 +1756,14 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
 	      move = RIGHT;
 	      break;
 	    case ASN1_ETYPE_GENERALSTRING:
-            case ASN1_ETYPE_NUMERICSTRING:
-            case ASN1_ETYPE_IA5STRING:
-            case ASN1_ETYPE_TELETEXSTRING:
-            case ASN1_ETYPE_PRINTABLESTRING:
-            case ASN1_ETYPE_UNIVERSALSTRING:
-            case ASN1_ETYPE_BMPSTRING:
-            case ASN1_ETYPE_UTF8STRING:
-            case ASN1_ETYPE_VISIBLESTRING:
+            case ASN1_ETYPE_NUMERIC_STRING:
+            case ASN1_ETYPE_IA5_STRING:
+            case ASN1_ETYPE_TELETEX_STRING:
+            case ASN1_ETYPE_PRINTABLE_STRING:
+            case ASN1_ETYPE_UNIVERSAL_STRING:
+            case ASN1_ETYPE_BMP_STRING:
+            case ASN1_ETYPE_UTF8_STRING:
+            case ASN1_ETYPE_VISIBLE_STRING:
 	    case ASN1_ETYPE_BIT_STRING:
 	      len2 =
 		asn1_get_length_der (der + counter, len - counter, &len3);
@@ -1973,7 +1973,7 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
 		  len2 += len4;
 		  if (state == FOUND)
 		    {
-		      _asn1_set_value_octet (p, der + counter, len2 + len3);
+		      _asn1_set_value_lv (p, der + counter, len2 + len3);
 
 		      if (p == nodeFound)
 			state = EXIT;
@@ -1996,7 +1996,7 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
 
 		  if (state == FOUND)
 		    {
-		      _asn1_set_value_octet (p, der + counter, len2);
+		      _asn1_set_value_lv (p, der + counter, len2);
 
 		      if (p == nodeFound)
 			state = EXIT;
@@ -2352,14 +2352,14 @@ asn1_der_decoding_startEnd (asn1_node element, const void *ider, int len,
 	    case ASN1_ETYPE_INTEGER:
 	    case ASN1_ETYPE_ENUMERATED:
 	    case ASN1_ETYPE_GENERALSTRING:
-            case ASN1_ETYPE_NUMERICSTRING:
-            case ASN1_ETYPE_IA5STRING:
-            case ASN1_ETYPE_TELETEXSTRING:
-            case ASN1_ETYPE_PRINTABLESTRING:
-            case ASN1_ETYPE_UNIVERSALSTRING:
-            case ASN1_ETYPE_BMPSTRING:
-            case ASN1_ETYPE_UTF8STRING:
-            case ASN1_ETYPE_VISIBLESTRING:
+            case ASN1_ETYPE_NUMERIC_STRING:
+            case ASN1_ETYPE_IA5_STRING:
+            case ASN1_ETYPE_TELETEX_STRING:
+            case ASN1_ETYPE_PRINTABLE_STRING:
+            case ASN1_ETYPE_UNIVERSAL_STRING:
+            case ASN1_ETYPE_BMP_STRING:
+            case ASN1_ETYPE_UTF8_STRING:
+            case ASN1_ETYPE_VISIBLE_STRING:
 	    case ASN1_ETYPE_BIT_STRING:
 	      len2 =
 		asn1_get_length_der (der + counter, len - counter, &len3);
@@ -2866,3 +2866,56 @@ asn1_expand_octet_string (asn1_node definitions, asn1_node * element,
 
   return retCode;
 }
+
+/**
+ * asn1_decode_simple_der:
+ * @etype: The type of the string to be encoded (ASN1_ETYPE_)
+ * @der: the encoded string
+ * @der_len: the bytes of the encoded string
+ * @str: a pointer to the data
+ * @str_len: the length of the data
+ *
+ * Decodes a simple DER encoded type (e.g. a string, which is not constructed).
+ * The output is a pointer inside the @der.
+ *
+ * Returns: %ASN1_SUCCESS if successful or an error value. 
+ **/
+int
+asn1_decode_simple_der (unsigned int etype, const unsigned char *der, unsigned int der_len,
+                        const unsigned char **str, unsigned int *str_len)
+{
+  int tag_len, len_len;
+  const unsigned char* p;
+  unsigned char class;
+  unsigned long tag;
+  long ret;
+
+  if (der == NULL || der_len == 0)
+    return ASN1_VALUE_NOT_VALID;
+
+  if (ETYPE_OK(etype) == 0)
+    return ASN1_VALUE_NOT_VALID;
+
+  p = der;
+  ret = asn1_get_tag_der (p, der_len, &class, &tag_len, &tag);
+  if (ret != ASN1_SUCCESS)
+    return ret;
+  
+  if (class != ETYPE_CLASS(etype) || tag != ETYPE_TAG(etype))
+    return ASN1_DER_ERROR;
+
+  p += tag_len;
+  der_len -= tag_len;
+  
+  ret = asn1_get_length_der (p, der_len, &len_len);
+  if (ret < 0) 
+    return ASN1_DER_ERROR;
+
+  p += len_len;
+  der_len -= len_len;
+  
+  *str_len = ret;
+  *str = p;
+
+  return ASN1_SUCCESS;
+}
diff --git a/lib/element.c b/lib/element.c
index f85fb2f..d5df2e5 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -408,7 +408,7 @@ asn1_write_value (asn1_node node_root, const char *name,
 	  (!negative && (value_temp[k] & 0x80)))
 	k--;
 
-      _asn1_set_value_octet (node, value_temp + k, len - k);
+      _asn1_set_value_lv (node, value_temp + k, len - k);
 
       if (node->type & CONST_DEFAULT)
 	{
@@ -544,17 +544,17 @@ asn1_write_value (asn1_node node_root, const char *name,
       break;
     case ASN1_ETYPE_OCTET_STRING:
     case ASN1_ETYPE_GENERALSTRING:
-    case ASN1_ETYPE_NUMERICSTRING:
-    case ASN1_ETYPE_IA5STRING:
-    case ASN1_ETYPE_TELETEXSTRING:
-    case ASN1_ETYPE_PRINTABLESTRING:
-    case ASN1_ETYPE_UNIVERSALSTRING:
-    case ASN1_ETYPE_BMPSTRING:
-    case ASN1_ETYPE_UTF8STRING:
-    case ASN1_ETYPE_VISIBLESTRING:
+    case ASN1_ETYPE_NUMERIC_STRING:
+    case ASN1_ETYPE_IA5_STRING:
+    case ASN1_ETYPE_TELETEX_STRING:
+    case ASN1_ETYPE_PRINTABLE_STRING:
+    case ASN1_ETYPE_UNIVERSAL_STRING:
+    case ASN1_ETYPE_BMP_STRING:
+    case ASN1_ETYPE_UTF8_STRING:
+    case ASN1_ETYPE_VISIBLE_STRING:
       if (len == 0)
 	len = _asn1_strlen (value);
-      _asn1_set_value_octet (node, value, len);
+      _asn1_set_value_lv (node, value, len);
       break;
     case ASN1_ETYPE_BIT_STRING:
       if (len == 0)
@@ -593,7 +593,7 @@ asn1_write_value (asn1_node node_root, const char *name,
 	return ASN1_ELEMENT_NOT_FOUND;
       break;
     case ASN1_ETYPE_ANY:
-      _asn1_set_value_octet (node, value, len);
+      _asn1_set_value_lv (node, value, len);
       break;
     case ASN1_ETYPE_SEQUENCE_OF:
     case ASN1_ETYPE_SET_OF:
@@ -823,14 +823,14 @@ asn1_read_value (asn1_node root, const char *name, void *ivalue, int *len)
       break;
     case ASN1_ETYPE_OCTET_STRING:
     case ASN1_ETYPE_GENERALSTRING:
-    case ASN1_ETYPE_NUMERICSTRING:
-    case ASN1_ETYPE_IA5STRING:
-    case ASN1_ETYPE_TELETEXSTRING:
-    case ASN1_ETYPE_PRINTABLESTRING:
-    case ASN1_ETYPE_UNIVERSALSTRING:
-    case ASN1_ETYPE_BMPSTRING:
-    case ASN1_ETYPE_UTF8STRING:
-    case ASN1_ETYPE_VISIBLESTRING:
+    case ASN1_ETYPE_NUMERIC_STRING:
+    case ASN1_ETYPE_IA5_STRING:
+    case ASN1_ETYPE_TELETEX_STRING:
+    case ASN1_ETYPE_PRINTABLE_STRING:
+    case ASN1_ETYPE_UNIVERSAL_STRING:
+    case ASN1_ETYPE_BMP_STRING:
+    case ASN1_ETYPE_UTF8_STRING:
+    case ASN1_ETYPE_VISIBLE_STRING:
       len2 = -1;
       if (asn1_get_octet_der
 	  (node->value, node->value_len, &len2, value, value_size,
diff --git a/lib/int.h b/lib/int.h
index 70fa896..9400cb8 100644
--- a/lib/int.h
+++ b/lib/int.h
@@ -73,20 +73,25 @@ typedef struct tag_and_class_st {
 	case ASN1_ETYPE_OBJECT_ID: \
 	case ASN1_ETYPE_OCTET_STRING: \
 	case ASN1_ETYPE_GENERALSTRING: \
-        case ASN1_ETYPE_NUMERICSTRING: \
-        case ASN1_ETYPE_IA5STRING: \
-        case ASN1_ETYPE_TELETEXSTRING: \
-        case ASN1_ETYPE_PRINTABLESTRING: \
-        case ASN1_ETYPE_UNIVERSALSTRING: \
-        case ASN1_ETYPE_BMPSTRING: \
-        case ASN1_ETYPE_UTF8STRING: \
-        case ASN1_ETYPE_VISIBLESTRING: \
+        case ASN1_ETYPE_NUMERIC_STRING: \
+        case ASN1_ETYPE_IA5_STRING: \
+        case ASN1_ETYPE_TELETEX_STRING: \
+        case ASN1_ETYPE_PRINTABLE_STRING: \
+        case ASN1_ETYPE_UNIVERSAL_STRING: \
+        case ASN1_ETYPE_BMP_STRING: \
+        case ASN1_ETYPE_UTF8_STRING: \
+        case ASN1_ETYPE_VISIBLE_STRING: \
 	case ASN1_ETYPE_BIT_STRING: \
 	case ASN1_ETYPE_SEQUENCE: \
 	case ASN1_ETYPE_SEQUENCE_OF: \
 	case ASN1_ETYPE_SET: \
 	case ASN1_ETYPE_SET_OF
 
+#define ETYPE_TAG(etype) (_asn1_tags[etype].tag)
+#define ETYPE_CLASS(etype) (_asn1_tags[etype].class)
+#define ETYPE_OK(etype) ((etype <= _asn1_tags_size)?1:0)
+
+extern unsigned int _asn1_tags_size;
 extern const tag_and_class_st _asn1_tags[];
 
 #define _asn1_strlen(s) strlen((const char *) s)
diff --git a/lib/libtasn1.h b/lib/libtasn1.h
index ad3b554..6a164b0 100644
--- a/lib/libtasn1.h
+++ b/lib/libtasn1.h
@@ -100,14 +100,14 @@ extern "C"
 #define ASN1_TAG_ENUMERATED		0x0A
 #define ASN1_TAG_NULL			0x05
 #define ASN1_TAG_GENERALSTRING		0x1B
-#define ASN1_TAG_NUMERICSTRING		0x12
-#define ASN1_TAG_IA5STRING		0x16
-#define ASN1_TAG_TELETEXSTRING		0x14
-#define ASN1_TAG_PRINTABLESTRING	0x13
-#define ASN1_TAG_UNIVERSALSTRING	0x1C
-#define ASN1_TAG_BMPSTRING		0x1E
-#define ASN1_TAG_UTF8STRING		0x0C
-#define ASN1_TAG_VISIBLESTRING		0x1A
+#define ASN1_TAG_NUMERIC_STRING		0x12
+#define ASN1_TAG_IA5_STRING		0x16
+#define ASN1_TAG_TELETEX_STRING		0x14
+#define ASN1_TAG_PRINTABLE_STRING	0x13
+#define ASN1_TAG_UNIVERSAL_STRING	0x1C
+#define ASN1_TAG_BMP_STRING		0x1E
+#define ASN1_TAG_UTF8_STRING		0x0C
+#define ASN1_TAG_VISIBLE_STRING		0x1A
 
   /******************************************************/
   /* Structure definition used for the node of the tree */
@@ -157,14 +157,14 @@ extern "C"
 #define ASN1_ETYPE_NULL          20
 #define ASN1_ETYPE_ENUMERATED    21
 #define ASN1_ETYPE_GENERALSTRING 27
-#define ASN1_ETYPE_NUMERICSTRING 28
-#define ASN1_ETYPE_IA5STRING     29
-#define ASN1_ETYPE_TELETEXSTRING 30
-#define ASN1_ETYPE_PRINTABLESTRING 31
-#define ASN1_ETYPE_UNIVERSALSTRING 32
-#define ASN1_ETYPE_BMPSTRING     33
-#define ASN1_ETYPE_UTF8STRING    34
-#define ASN1_ETYPE_VISIBLESTRING 35
+#define ASN1_ETYPE_NUMERIC_STRING 28
+#define ASN1_ETYPE_IA5_STRING     29
+#define ASN1_ETYPE_TELETEX_STRING 30
+#define ASN1_ETYPE_PRINTABLE_STRING 31
+#define ASN1_ETYPE_UNIVERSAL_STRING 32
+#define ASN1_ETYPE_BMP_STRING     33
+#define ASN1_ETYPE_UTF8_STRING    34
+#define ASN1_ETYPE_VISIBLE_STRING 35
 
   struct asn1_data_node_st
   {
@@ -272,7 +272,36 @@ extern "C"
 
   extern ASN1_API void asn1_perror (int error);
 
-  /* DER utility functions. */
+#define ASN1_MAX_TAG_SIZE 4
+#define ASN1_MAX_LENGTH_SIZE 9
+#define ASN1_MAX_TL_SIZE (ASN1_MAX_TAG_SIZE+ASN1_MAX_LENGTH_SIZE)
+  extern ASN1_API long
+    asn1_get_length_der (const unsigned char *der, int der_len, int *len);
+
+  extern ASN1_API long
+    asn1_get_length_ber (const unsigned char *ber, int ber_len, int *len);
+
+  extern ASN1_API void
+    asn1_length_der (unsigned long int len, unsigned char *ans, int *ans_len);
+
+  /* Other utility functions. */
+
+  extern ASN1_API 
+    int asn1_decode_simple_der (unsigned int etype, const unsigned char *der, unsigned int der_len,
+                        const unsigned char **str, unsigned int *str_len);
+
+  extern ASN1_API int
+    asn1_encode_simple_der (unsigned int etype, const unsigned char *str, unsigned int str_len,
+                        unsigned char *tl, unsigned int *tl_len);
+
+  extern ASN1_API asn1_node
+    asn1_find_node (asn1_node pointer, const char *name);
+
+  extern ASN1_API int
+    asn1_copy_node (asn1_node dst, const char *dst_name,
+		    asn1_node src, const char *src_name);
+
+  /* Internal and low-level DER utility functions. */
 
   extern ASN1_API int
     asn1_get_tag_der (const unsigned char *der, int der_len,
@@ -295,24 +324,6 @@ extern "C"
 		      int *ret_len, unsigned char *str,
 		      int str_size, int *bit_len);
 
-  extern ASN1_API long
-    asn1_get_length_der (const unsigned char *der, int der_len, int *len);
-
-  extern ASN1_API long
-    asn1_get_length_ber (const unsigned char *ber, int ber_len, int *len);
-
-  extern ASN1_API void
-    asn1_length_der (unsigned long int len, unsigned char *ans, int *ans_len);
-
-  /* Other utility functions. */
-
-  extern ASN1_API asn1_node
-    asn1_find_node (asn1_node pointer, const char *name);
-
-  extern ASN1_API int
-    asn1_copy_node (asn1_node dst, const char *dst_name,
-		    asn1_node src, const char *src_name);
-
 /* Compatibility types */
 
 typedef int asn1_retCode;	/* type returned by libtasn1 functions */
diff --git a/lib/libtasn1.map b/lib/libtasn1.map
index 83235ed..a2b9416 100644
--- a/lib/libtasn1.map
+++ b/lib/libtasn1.map
@@ -50,6 +50,8 @@ LIBTASN1_0_3
     asn1_strerror;
     asn1_write_value;
     asn1_read_node_value;
+    asn1_encode_simple_der;
+    asn1_decode_simple_der;
 
     # Old symbols
     libtasn1_strerror;
diff --git a/lib/parser_aux.c b/lib/parser_aux.c
index cced582..7d16fa3 100644
--- a/lib/parser_aux.c
+++ b/lib/parser_aux.c
@@ -241,10 +241,10 @@ _asn1_set_value (asn1_node node, const void *value, unsigned int len)
 }
 
 /******************************************************************/
-/* Function : _asn1_set_value_octet                               */
+/* Function : _asn1_set_value_lv                                  */
 /* Description: sets the field VALUE in a NODE_ASN element. The   */
 /*              previous value (if exist) will be lost. The value */
-/*		given is stored as an octet string.               */
+/*		given is stored as an length-value format (LV     */
 /* Parameters:                                                    */
 /*   node: element pointer.                                       */
 /*   value: pointer to the value that you want to set.            */
@@ -252,7 +252,7 @@ _asn1_set_value (asn1_node node, const void *value, unsigned int len)
 /* Return: pointer to the NODE_ASN element.                       */
 /******************************************************************/
 asn1_node
-_asn1_set_value_octet (asn1_node node, const void *value, unsigned int len)
+_asn1_set_value_lv (asn1_node node, const void *value, unsigned int len)
 {
   int len2;
   void *temp;
diff --git a/lib/parser_aux.h b/lib/parser_aux.h
index df369c7..f270b73 100644
--- a/lib/parser_aux.h
+++ b/lib/parser_aux.h
@@ -35,7 +35,7 @@ _asn1_set_value (asn1_node node, const void *value, unsigned int len);
 asn1_node _asn1_set_value_m (asn1_node node, void *value, unsigned int len);
 
 asn1_node
-_asn1_set_value_octet (asn1_node node, const void *value, unsigned int len);
+_asn1_set_value_lv (asn1_node node, const void *value, unsigned int len);
 
 asn1_node
 _asn1_append_value (asn1_node node, const void *value, unsigned int len);
diff --git a/lib/structure.c b/lib/structure.c
index 9136799..a508030 100644
--- a/lib/structure.c
+++ b/lib/structure.c
@@ -855,14 +855,14 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 	      break;
 	    case ASN1_ETYPE_OCTET_STRING:
 	    case ASN1_ETYPE_GENERALSTRING:
-	    case ASN1_ETYPE_NUMERICSTRING:
-	    case ASN1_ETYPE_IA5STRING:
-	    case ASN1_ETYPE_TELETEXSTRING:
-	    case ASN1_ETYPE_PRINTABLESTRING:
-	    case ASN1_ETYPE_UNIVERSALSTRING:
-	    case ASN1_ETYPE_BMPSTRING:
-	    case ASN1_ETYPE_UTF8STRING:
-	    case ASN1_ETYPE_VISIBLESTRING:
+	    case ASN1_ETYPE_NUMERIC_STRING:
+	    case ASN1_ETYPE_IA5_STRING:
+	    case ASN1_ETYPE_TELETEX_STRING:
+	    case ASN1_ETYPE_PRINTABLE_STRING:
+	    case ASN1_ETYPE_UNIVERSAL_STRING:
+	    case ASN1_ETYPE_BMP_STRING:
+	    case ASN1_ETYPE_UTF8_STRING:
+	    case ASN1_ETYPE_VISIBLE_STRING:
 	      if (p->value)
 		{
 		  len2 = -1;
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a7f8336..8f01d35 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -33,11 +33,12 @@ dist_check_SCRIPTS += threadsafety
 
 MOSTLYCLEANFILES = Test_parser_ERROR.asn
 
-check_PROGRAMS = Test_parser Test_tree Test_encoding Test_indefinite	\
-	Test_errors Test_simple Test_overflow
+check_PROGRAMS = Test_parser Test_tree Test_encoding Test_indefinite \
+	Test_errors Test_simple Test_overflow Test_strings
 
 TESTS = Test_parser Test_tree Test_encoding Test_indefinite	\
-	Test_errors Test_simple Test_overflow crlf threadsafety
+	Test_errors Test_simple Test_overflow crlf threadsafety \
+	Test_strings
 
 TESTS_ENVIRONMENT = \
 	ASN1PARSER=$(srcdir)/Test_parser.asn \
diff --git a/tests/Test_strings.c b/tests/Test_strings.c
new file mode 100644
index 0000000..b43620f
--- /dev/null
+++ b/tests/Test_strings.c
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2012 Free Software Foundation, Inc.
+ *
+ * This file is part of LIBTASN1.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Written by Simon Josefsson
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "libtasn1.h"
+
+struct tv
+{
+  unsigned int etype;
+  unsigned int str_len;
+  const void *str;
+  unsigned int der_len;
+  const void *der;
+};
+
+static const struct tv tv[] = {
+  {ASN1_ETYPE_IA5_STRING, 20, "\x63\x73\x63\x61\x40\x70\x61\x73\x73\x70\x6f\x72\x74\x2e\x67\x6f\x76\x2e\x67\x72",
+                          22, "\x16\x14\x63\x73\x63\x61\x40\x70\x61\x73\x73\x70\x6f\x72\x74\x2e\x67\x6f\x76\x2e\x67\x72"},
+  {ASN1_ETYPE_PRINTABLE_STRING, 5, "\x4e\x69\x6b\x6f\x73", 
+                               7, "\x13\x05\x4e\x69\x6b\x6f\x73"},
+  {ASN1_ETYPE_UTF8_STRING, 12, "Αττική",
+                          14, "\x0c\x0c\xce\x91\xcf\x84\xcf\x84\xce\xb9\xce\xba\xce\xae"},
+  {ASN1_ETYPE_TELETEX_STRING, 15, "\x53\x69\x6d\x6f\x6e\x20\x4a\x6f\x73\x65\x66\x73\x73\x6f\x6e",
+                             17, "\x14\x0f\x53\x69\x6d\x6f\x6e\x20\x4a\x6f\x73\x65\x66\x73\x73\x6f\x6e"},
+  {ASN1_ETYPE_OCTET_STRING, 36, "\x30\x22\x80\x0F\x32\x30\x31\x31\x30\x38\x32\x31\x30\x38\x30\x30\x30\x36\x5A\x81\x0F\x32\x30\x31\x31\x30\x38\x32\x33\x32\x30\x35\x39\x35\x39\x5A",
+                           38, "\x04\x24\x30\x22\x80\x0F\x32\x30\x31\x31\x30\x38\x32\x31\x30\x38\x30\x30\x30\x36\x5A\x81\x0F\x32\x30\x31\x31\x30\x38\x32\x33\x32\x30\x35\x39\x35\x39\x5A"}
+};
+
+int
+main (int argc, char *argv[])
+{
+  int ret;
+  unsigned char tl[ASN1_MAX_TL_SIZE];
+  unsigned int tl_len, der_len, str_len;
+  const unsigned char* str;
+  unsigned int i;
+
+  /* Dummy test */
+
+  for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++)
+    {
+      /* Encode */
+      tl_len = sizeof(tl);
+      ret = asn1_encode_simple_der(tv[i].etype, tv[i].str, tv[i].str_len,
+                                   tl, &tl_len);
+      if (ret != ASN1_SUCCESS)
+        {
+          fprintf(stderr, "Encoding error in %u: %s\n", i, asn1_strerror(ret));
+          return 1;
+        }
+      der_len = tl_len+tv[i].str_len;
+        
+      if (der_len != tv[i].der_len || memcmp(tl, tv[i].der, tl_len) != 0)
+        {
+          fprintf(stderr, "DER encoding differs in %u! (size: %u, expected: %u)\n", i, der_len, tv[i].der_len);
+          return 1;
+        }
+
+      /* decoding */
+      ret = asn1_decode_simple_der(tv[i].etype, tv[i].der, tv[i].der_len, &str, &str_len);
+      if (ret != ASN1_SUCCESS)
+        {
+          fprintf(stderr, "Decoding error in %u: %s\n", i, asn1_strerror(ret));
+          return 1;
+        }
+
+      if (str_len != tv[i].str_len || memcmp(str, tv[i].str, str_len) != 0)
+        {
+          fprintf(stderr, "DER decoded data differ in %u! (size: %u, expected: %u)\n", i, der_len, tv[i].str_len);
+          return 1;
+        }
+    }
+
+
+  return 0;
+}


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Fri Nov 23 15:42:49 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Tc05J-0007s8-Ls
	for mharc-libtasn1-commit@gnu.org; Fri, 23 Nov 2012 15:42:49 -0500
Received: from eggs.gnu.org ([208.118.235.92]:45843)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Tc05H-0007rt-6y
	for libtasn1-commit@gnu.org; Fri, 23 Nov 2012 15:42:48 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Tc05F-0003Ww-MF
	for libtasn1-commit@gnu.org; Fri, 23 Nov 2012 15:42:47 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:51249)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Tc05F-0003WE-Hm
	for libtasn1-commit@gnu.org; Fri, 23 Nov 2012 15:42:45 -0500
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Tc05E-0001dN-Q2
	for libtasn1-commit@gnu.org; Fri, 23 Nov 2012 20:42:44 +0000
Date: Fri, 23 Nov 2012 20:42:44 +0000
Message-Id: <E1Tc05E-0001dN-Q2@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_0-27-g57e61a0
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 1d02266a174c939e9ca1460641c8eaa9dc2a7843
X-Git-Newrev: 57e61a0d130b4bae6331c2412f87c45fcd540af2
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 23 Nov 2012 20:42:48 -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=57e61a0d130b4bae6331c2412f87c45fcd540af2

The branch, master has been updated
       via  57e61a0d130b4bae6331c2412f87c45fcd540af2 (commit)
      from  1d02266a174c939e9ca1460641c8eaa9dc2a7843 (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 57e61a0d130b4bae6331c2412f87c45fcd540af2
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Fri Nov 23 21:36:51 2012 +0100

    Added asn1_read_value_type().

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

Summary of changes:
 NEWS             |    1 +
 lib/element.c    |   80 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 lib/libtasn1.h   |    4 +++
 lib/libtasn1.map |    1 +
 4 files changed, 83 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index a29e187..371e804 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ GNU Libtasn1 NEWS                                     -*- outline -*-
   a warning is being print instead of failing.
 - Parser outputs more detailed syntax error message.
 - Added asn1_decode_simple_der() and asn1_encode_simple_der().
+- Added asn1_read_value_type() to return value and type.
 
 * Noteworthy changes in release 3.0 (2012-10-28) [stable]
 - Added tool in tests/ to benchmark X.509 structure decoding.
diff --git a/lib/element.c b/lib/element.c
index d5df2e5..2e3d48e 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -700,22 +700,96 @@ asn1_write_value (asn1_node node_root, const char *name,
 int
 asn1_read_value (asn1_node root, const char *name, void *ivalue, int *len)
 {
+  return asn1_read_value_type( root, name, ivalue, len, NULL);
+}
+
+/**
+ * asn1_read_value_type:
+ * @root: pointer to a structure.
+ * @name: the name of the element inside a structure that you want to read.
+ * @ivalue: vector that will contain the element's content, must be a
+ *   pointer to memory cells already allocated.
+ * @len: number of bytes of *value: value[0]..value[len-1]. Initialy
+ *   holds the sizeof value.
+ * @etype: The type of the value read (ASN1_ETYPE)
+ *
+ * Returns the value of one element inside a structure.
+ *
+ * If an element is OPTIONAL and the function "read_value" 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.
+ *
+ * INTEGER: VALUE will contain a two's complement form integer.
+ *
+ *            integer=-1  -> value[0]=0xFF , len=1.
+ *            integer=1   -> value[0]=0x01 , len=1.
+ *
+ * ENUMERATED: As INTEGER (but only with not negative numbers).
+ *
+ * BOOLEAN: VALUE will be the null terminated string "TRUE" or
+ *   "FALSE" and LEN=5 or LEN=6.
+ *
+ * OBJECT IDENTIFIER: VALUE will be a null terminated string with
+ *   each number separated by a dot (i.e. "1.2.3.543.1").
+ *
+ *                      LEN = strlen(VALUE)+1
+ *
+ * UTCTime: VALUE will be a null terminated string in one of these
+ *   formats: "YYMMDDhhmmss+hh'mm'" or "YYMMDDhhmmss-hh'mm'".
+ *   LEN=strlen(VALUE)+1.
+ *
+ * GeneralizedTime: VALUE will be a null terminated string in the
+ *   same format used to set the value.
+ *
+ * OCTET STRING: VALUE will contain the octet string and LEN will be
+ *   the number of octets.
+ *
+ * GeneralString: VALUE will contain the generalstring and LEN will
+ *   be the number of octets.
+ *
+ * BIT STRING: VALUE will contain the bit string organized by bytes
+ *   and LEN will be the number of bits.
+ *
+ * CHOICE: If NAME indicates a choice type, VALUE will specify the
+ *   alternative selected.
+ *
+ * ANY: If NAME indicates an any type, VALUE will indicate the DER
+ *   encoding of the structure actually used.
+ *
+ * Returns: %ASN1_SUCCESS if value is returned,
+ *   %ASN1_ELEMENT_NOT_FOUND if @name is not a valid element,
+ *   %ASN1_VALUE_NOT_FOUND if there isn't any value for the element
+ *   selected, and %ASN1_MEM_ERROR if The value vector isn't big enough
+ *   to store the result, and in this case @len will contain the number of
+ *   bytes needed.
+ **/
+int
+asn1_read_value_type (asn1_node root, const char *name, void *ivalue, int *len,
+                      unsigned int *etype)
+{
   asn1_node node, p, p2;
   int len2, len3;
   int value_size = *len;
   unsigned char *value = ivalue;
+  unsigned type;
 
   node = asn1_find_node (root, name);
   if (node == NULL)
     return ASN1_ELEMENT_NOT_FOUND;
 
-  if ((type_field (node->type) != ASN1_ETYPE_NULL) &&
-      (type_field (node->type) != ASN1_ETYPE_CHOICE) &&
+  type = type_field (node->type);
+
+  if ((type != ASN1_ETYPE_NULL) &&
+      (type != ASN1_ETYPE_CHOICE) &&
       !(node->type & CONST_DEFAULT) && !(node->type & CONST_ASSIGN) &&
       (node->value == NULL))
     return ASN1_VALUE_NOT_FOUND;
 
-  switch (type_field (node->type))
+  if (etype)
+    *etype = type;
+  switch (type)
     {
     case ASN1_ETYPE_NULL:
       PUT_STR_VALUE (value, value_size, "NULL");
diff --git a/lib/libtasn1.h b/lib/libtasn1.h
index 6a164b0..59c3093 100644
--- a/lib/libtasn1.h
+++ b/lib/libtasn1.h
@@ -224,6 +224,10 @@ extern "C"
 		     void *ivalue, int *len);
 
   extern ASN1_API int
+    asn1_read_value_type (asn1_node root, const char *name,
+		          void *ivalue, int *len, unsigned int* etype);
+
+  extern ASN1_API int
     asn1_read_node_value (asn1_node node, asn1_data_node_st* data);
 
   extern ASN1_API int
diff --git a/lib/libtasn1.map b/lib/libtasn1.map
index a2b9416..439e4b0 100644
--- a/lib/libtasn1.map
+++ b/lib/libtasn1.map
@@ -52,6 +52,7 @@ LIBTASN1_0_3
     asn1_read_node_value;
     asn1_encode_simple_der;
     asn1_decode_simple_der;
+    asn1_read_value_type;
 
     # Old symbols
     libtasn1_strerror;


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Sat Nov 24 10:23:50 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TcHaA-00055U-QT
	for mharc-libtasn1-commit@gnu.org; Sat, 24 Nov 2012 10:23:50 -0500
Received: from eggs.gnu.org ([208.118.235.92]:47604)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcHa4-00055O-2i
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 10:23:49 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcHZy-0001OD-Mm
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 10:23:44 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:43072)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcHZy-0001O9-Ha
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 10:23:38 -0500
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcHZx-0004QT-KD
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 15:23:37 +0000
Date: Sat, 24 Nov 2012 15:23:37 +0000
Message-Id: <E1TcHZx-0004QT-KD@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_0-33-g8cd1f61
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 57e61a0d130b4bae6331c2412f87c45fcd540af2
X-Git-Newrev: 8cd1f611d962eb62db6b5beb5b395597ce463110
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 24 Nov 2012 15:23:49 -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=8cd1f611d962eb62db6b5beb5b395597ce463110

The branch, master has been updated
       via  8cd1f611d962eb62db6b5beb5b395597ce463110 (commit)
       via  37c47bd8102ec213ee8d53c2800232a9bb7bace2 (commit)
       via  e2e72dead5e31c38a161e7bd8b3cfb716869db40 (commit)
       via  2ac0d04b5f8571866e729e9d816ea69780892634 (commit)
       via  bbfe113c2d7540c6883eb3d83d7052f49f7988fc (commit)
       via  435b15341e5aed9fe0f936d87a88bca31678458d (commit)
      from  57e61a0d130b4bae6331c2412f87c45fcd540af2 (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 8cd1f611d962eb62db6b5beb5b395597ce463110
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Sat Nov 24 16:23:08 2012 +0100

    simplified

commit 37c47bd8102ec213ee8d53c2800232a9bb7bace2
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Sat Nov 24 13:46:21 2012 +0100

    corrected typo

commit e2e72dead5e31c38a161e7bd8b3cfb716869db40
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Sat Nov 24 10:41:48 2012 +0100

    better error reporting

commit 2ac0d04b5f8571866e729e9d816ea69780892634
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Sat Nov 24 10:41:33 2012 +0100

    some simplifications in time handling

commit bbfe113c2d7540c6883eb3d83d7052f49f7988fc
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Sat Nov 24 09:41:50 2012 +0100

    Introduced ASN1_ETYPE_UTC_TIME and ASN1_ETYPE_GENERALIZED_TIME

commit 435b15341e5aed9fe0f936d87a88bca31678458d
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Sat Nov 24 09:07:41 2012 +0100

    updates in ETYPE_OK

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

Summary of changes:
 NEWS              |    1 +
 lib/ASN1.c        |    4 +-
 lib/ASN1.y        |    4 +-
 lib/coding.c      |   28 +--
 lib/decoding.c    |   32 +--
 lib/element.c     |   44 ++--
 lib/int.h         |   45 ++++-
 lib/libtasn1.h    |    4 +-
 lib/parser_aux.c  |    4 +-
 lib/structure.c   |   30 ++-
 tests/Test_tree.c |  637 +++++++++++++++++++++++++++--------------------------
 11 files changed, 442 insertions(+), 391 deletions(-)

diff --git a/NEWS b/NEWS
index 371e804..b2dddec 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ GNU Libtasn1 NEWS                                     -*- outline -*-
 - Parser outputs more detailed syntax error message.
 - Added asn1_decode_simple_der() and asn1_encode_simple_der().
 - Added asn1_read_value_type() to return value and type.
+- Introduced ASN1_ETYPE_UTC_TIME and ASN1_ETYPE_GENERALIZED_TIME
 
 * Noteworthy changes in release 3.0 (2012-10-28) [stable]
 - Added tool in tests/ to benchmark X.509 structure decoding.
diff --git a/lib/ASN1.c b/lib/ASN1.c
index 928d28d..2a60527 100644
--- a/lib/ASN1.c
+++ b/lib/ASN1.c
@@ -1987,14 +1987,14 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 233 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TIME|CONST_UTC);}
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UTC_TIME);}
     break;
 
   case 39:
 
 /* Line 1806 of yacc.c  */
 #line 234 "ASN1.y"
-    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TIME|CONST_GENERALIZED);}
+    {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_GENERALIZED_TIME);}
     break;
 
   case 40:
diff --git a/lib/ASN1.y b/lib/ASN1.y
index dafe15a..874eb13 100644
--- a/lib/ASN1.y
+++ b/lib/ASN1.y
@@ -230,8 +230,8 @@ integer_def: INTEGER                    {$$=_asn1_add_static_node(ASN1_ETYPE_INT
 boolean_def: BOOLEAN   {$$=_asn1_add_static_node(ASN1_ETYPE_BOOLEAN);}
 ;
 
-Time:   UTCTime          {$$=_asn1_add_static_node(ASN1_ETYPE_TIME|CONST_UTC);}
-      | GeneralizedTime  {$$=_asn1_add_static_node(ASN1_ETYPE_TIME|CONST_GENERALIZED);}
+Time:   UTCTime          {$$=_asn1_add_static_node(ASN1_ETYPE_UTC_TIME);}
+      | GeneralizedTime  {$$=_asn1_add_static_node(ASN1_ETYPE_GENERALIZED_TIME);}
 ;
 
 size_def2: SIZE'('num_identifier')'  {$$=_asn1_add_static_node(ASN1_ETYPE_SIZE|CONST_1_PARAM);
diff --git a/lib/coding.c b/lib/coding.c
index aa777f3..5361b3f 100644
--- a/lib/coding.c
+++ b/lib/coding.c
@@ -215,7 +215,10 @@ asn1_encode_simple_der (unsigned int etype, const unsigned char *str, unsigned i
 
   if (ETYPE_OK(etype) == 0)
     return ASN1_VALUE_NOT_VALID;
-    
+
+  /* doesn't handle constructed classes */
+  if (ETYPE_CLASS(etype) != ASN1_CLASS_UNIVERSAL)
+    return ASN1_VALUE_NOT_VALID;
 
   _asn1_tag_der (ETYPE_CLASS(etype), ETYPE_TAG(etype),
 	         der_tag, &tag_len);
@@ -255,11 +258,10 @@ asn1_encode_simple_der (unsigned int etype, const unsigned char *str, unsigned i
 /*   ASN1_SUCCESS otherwise                           */
 /******************************************************/
 static int
-_asn1_time_der (unsigned char *str, unsigned char *der, int *der_len)
+_asn1_time_der (unsigned char *str, int str_len, unsigned char *der, int *der_len)
 {
   int len_len;
   int max_len;
-  int str_len = _asn1_strlen (str);
 
   max_len = *der_len;
 
@@ -528,7 +530,7 @@ const tag_and_class_st _asn1_tags[] =
   [ASN1_ETYPE_VISIBLE_STRING] =   {ASN1_TAG_VISIBLE_STRING, ASN1_CLASS_UNIVERSAL, "type:VISIBLE_STR"},
   [ASN1_ETYPE_OCTET_STRING] =    {ASN1_TAG_OCTET_STRING, ASN1_CLASS_UNIVERSAL, "type:OCT_STR"},
   [ASN1_ETYPE_BIT_STRING] = {ASN1_TAG_BIT_STRING, ASN1_CLASS_UNIVERSAL, "type:BIT_STR"},
-  [ASN1_ETYPE_OBJECT_ID] =  {ASN1_TAG_OBJECT_ID, ASN1_CLASS_UNIVERSAL, "type:OBJ_STR"},
+  [ASN1_ETYPE_OBJECT_ID] =  {ASN1_TAG_OBJECT_ID, ASN1_CLASS_UNIVERSAL, "type:OBJ_ID"},
   [ASN1_ETYPE_NULL] =       {ASN1_TAG_NULL, ASN1_CLASS_UNIVERSAL, "type:NULL"},
   [ASN1_ETYPE_BOOLEAN] =    {ASN1_TAG_BOOLEAN, ASN1_CLASS_UNIVERSAL, "type:BOOLEAN"},
   [ASN1_ETYPE_INTEGER] =    {ASN1_TAG_INTEGER, ASN1_CLASS_UNIVERSAL, "type:INTEGER"},
@@ -537,7 +539,10 @@ const tag_and_class_st _asn1_tags[] =
   [ASN1_ETYPE_SEQUENCE_OF] ={ASN1_TAG_SEQUENCE, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED, "type:SEQ_OF"},
   [ASN1_ETYPE_SET] =        {ASN1_TAG_SET, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED, "type:SET"},
   [ASN1_ETYPE_SET_OF] =     {ASN1_TAG_SET, ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED, "type:SET_OF"},
+  [ASN1_ETYPE_GENERALIZED_TIME] = {ASN1_TAG_GENERALIZEDTime, ASN1_CLASS_UNIVERSAL, "type:GENERALIZED_TIME"},
+  [ASN1_ETYPE_UTC_TIME] = {ASN1_TAG_UTCTime, ASN1_CLASS_UNIVERSAL, "type:UTC_TIME"},
 };
+
 unsigned int _asn1_tags_size = sizeof(_asn1_tags)/sizeof(_asn1_tags[0]);
 
 /******************************************************/
@@ -631,16 +636,6 @@ _asn1_insert_tag_der (asn1_node node, unsigned char *der, int *counter,
       unsigned type = type_field (node->type);
       switch (type)
 	{
-	case ASN1_ETYPE_TIME:
-	  if (node->type & CONST_UTC)
-	    {
-	      _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_UTCTime, tag_der,
-			     &tag_len);
-	    }
-	  else
-	    _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_GENERALIZEDTime,
-			   tag_der, &tag_len);
-	  break;
         CASE_HANDLED_ETYPES:
 	  _asn1_tag_der (_asn1_tags[type].class, _asn1_tags[type].tag,
 			 tag_der, &tag_len);
@@ -1065,7 +1060,8 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
 	    }
 	  move = RIGHT;
 	  break;
-	case ASN1_ETYPE_TIME:
+	case ASN1_ETYPE_GENERALIZED_TIME:
+	case ASN1_ETYPE_UTC_TIME:
 	  if (p->value == NULL)
 	    {
 	      _asn1_error_description_value_not_found (p, ErrorDescription);
@@ -1073,7 +1069,7 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
 	      goto error;
 	    }
 	  len2 = max_len;
-	  err = _asn1_time_der (p->value, der + counter, &len2);
+	  err = _asn1_time_der (p->value, p->value_len, der + counter, &len2);
 	  if (err != ASN1_SUCCESS && err != ASN1_MEM_ERROR)
 	    goto error;
 
diff --git a/lib/decoding.c b/lib/decoding.c
index 5df1f36..f02fe10 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -511,25 +511,12 @@ _asn1_extract_tag_der (asn1_node node, const unsigned char *der, int der_len,
 	case ASN1_ETYPE_SEQUENCE_OF:
 	case ASN1_ETYPE_SET:
 	case ASN1_ETYPE_SET_OF:
+	case ASN1_ETYPE_GENERALIZED_TIME:
+	case ASN1_ETYPE_UTC_TIME:
 	  if ((class != _asn1_tags[type].class) || (tag != _asn1_tags[type].tag))
 	    return ASN1_DER_ERROR;
 	  break;
 
-	case ASN1_ETYPE_TIME:
-	  if (node->type & CONST_UTC)
-	    {
-	      if ((class != ASN1_CLASS_UNIVERSAL)
-		  || (tag != ASN1_TAG_UTCTime))
-		return ASN1_DER_ERROR;
-	    }
-	  else
-	    {
-	      if ((class != ASN1_CLASS_UNIVERSAL)
-		  || (tag != ASN1_TAG_GENERALIZEDTime))
-		return ASN1_DER_ERROR;
-	    }
-	  break;
-
 	case ASN1_ETYPE_OCTET_STRING:
 	  /* OCTET STRING is handled differently to allow
 	   * BER encodings (structured class). */
@@ -1055,7 +1042,8 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 	      counter += len2;
 	      move = RIGHT;
 	      break;
-	    case ASN1_ETYPE_TIME:
+	    case ASN1_ETYPE_GENERALIZED_TIME:
+	    case ASN1_ETYPE_UTC_TIME:
 	      result =
 		_asn1_get_time_der (der + counter, len - counter, &len2, temp,
 				    sizeof (temp) - 1);
@@ -1064,7 +1052,7 @@ asn1_der_decoding (asn1_node * element, const void *ider, int len,
 
 	      tlen = strlen (temp);
 	      if (tlen > 0)
-		_asn1_set_value (p, temp, tlen + 1);
+		_asn1_set_value (p, temp, tlen);
 	      counter += len2;
 	      move = RIGHT;
 	      break;
@@ -1707,7 +1695,8 @@ asn1_der_decoding_element (asn1_node * structure, const char *elementName,
 	      counter += len2;
 	      move = RIGHT;
 	      break;
-	    case ASN1_ETYPE_TIME:
+	    case ASN1_ETYPE_GENERALIZED_TIME:
+	    case ASN1_ETYPE_UTC_TIME:
 	      if (state == FOUND)
 		{
 		  result =
@@ -2347,7 +2336,8 @@ asn1_der_decoding_startEnd (asn1_node element, const void *ider, int len,
 	      counter += len3;
 	      move = RIGHT;
 	      break;
-	    case ASN1_ETYPE_TIME:
+	    case ASN1_ETYPE_UTC_TIME:
+	    case ASN1_ETYPE_GENERALIZED_TIME:
 	    case ASN1_ETYPE_OBJECT_ID:
 	    case ASN1_ETYPE_INTEGER:
 	    case ASN1_ETYPE_ENUMERATED:
@@ -2896,6 +2886,10 @@ asn1_decode_simple_der (unsigned int etype, const unsigned char *der, unsigned i
   if (ETYPE_OK(etype) == 0)
     return ASN1_VALUE_NOT_VALID;
 
+  /* doesn't handle constructed classes */
+  if (ETYPE_CLASS(etype) != ASN1_CLASS_UNIVERSAL)
+    return ASN1_VALUE_NOT_VALID;
+
   p = der;
   ret = asn1_get_tag_der (p, der_len, &class, &tag_len, &tag);
   if (ret != ASN1_SUCCESS)
diff --git a/lib/element.c b/lib/element.c
index 2e3d48e..2c761c5 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -276,6 +276,7 @@ asn1_write_value (asn1_node node_root, const char *name,
   int len2, k, k2, negative;
   size_t i;
   const unsigned char *value = ivalue;
+  unsigned int type;
 
   node = asn1_find_node (node_root, name);
   if (node == NULL)
@@ -286,8 +287,10 @@ asn1_write_value (asn1_node node_root, const char *name,
       asn1_delete_structure (&node);
       return ASN1_SUCCESS;
     }
+  
+  type = type_field(node->type);
 
-  if ((type_field (node->type) == ASN1_ETYPE_SEQUENCE_OF) && (value == NULL)
+  if ((type == ASN1_ETYPE_SEQUENCE_OF) && (value == NULL)
       && (len == 0))
     {
       p = node->down;
@@ -301,7 +304,7 @@ asn1_write_value (asn1_node node_root, const char *name,
       return ASN1_SUCCESS;
     }
 
-  switch (type_field (node->type))
+  switch (type)
     {
     case ASN1_ETYPE_BOOLEAN:
       if (!_asn1_strcmp (value, "TRUE"))
@@ -496,8 +499,7 @@ asn1_write_value (asn1_node node_root, const char *name,
 	}
       _asn1_set_value (node, value, _asn1_strlen (value) + 1);
       break;
-    case ASN1_ETYPE_TIME:
-      if (node->type & CONST_UTC)
+    case ASN1_ETYPE_UTC_TIME:
 	{
 	  if (_asn1_strlen (value) < 11)
 	    return ASN1_VALUE_NOT_VALID;
@@ -534,14 +536,13 @@ asn1_write_value (asn1_node node_root, const char *name,
 	    default:
 	      return ASN1_VALUE_NOT_FOUND;
 	    }
-	  _asn1_set_value (node, value, _asn1_strlen (value) + 1);
-	}
-      else
-	{			/* GENERALIZED TIME */
-	  if (value)
-	    _asn1_set_value (node, value, _asn1_strlen (value) + 1);
+	  _asn1_set_value (node, value, _asn1_strlen (value));
 	}
       break;
+    case ASN1_ETYPE_GENERALIZED_TIME:
+      if (value)
+        _asn1_set_value (node, value, _asn1_strlen (value));
+      break;
     case ASN1_ETYPE_OCTET_STRING:
     case ASN1_ETYPE_GENERALSTRING:
     case ASN1_ETYPE_NUMERIC_STRING:
@@ -627,6 +628,16 @@ asn1_write_value (asn1_node node_root, const char *name,
 		_asn1_strcpy(ptr, data); \
 	}
 
+#define PUT_AS_STR_VALUE( ptr, ptr_size, data, data_size) \
+	*len = data_size + 1; \
+	if (ptr_size < *len) { \
+		return ASN1_MEM_ERROR; \
+	} else { \
+		/* this strcpy is checked */ \
+		memcpy(ptr, data, data_size); \
+		ptr[data_size] = 0; \
+	}
+
 #define ADD_STR_VALUE( ptr, ptr_size, data) \
 	*len = (int) _asn1_strlen(data) + 1; \
 	if (ptr_size < (int) _asn1_strlen(ptr)+(*len)) { \
@@ -892,8 +903,9 @@ asn1_read_value_type (asn1_node root, const char *name, void *ivalue, int *len,
 	  PUT_STR_VALUE (value, value_size, node->value);
 	}
       break;
-    case ASN1_ETYPE_TIME:
-      PUT_STR_VALUE (value, value_size, node->value);
+    case ASN1_ETYPE_GENERALIZED_TIME:
+    case ASN1_ETYPE_UTC_TIME:
+      PUT_AS_STR_VALUE (value, value_size, node->value, node->value_len);
       break;
     case ASN1_ETYPE_OCTET_STRING:
     case ASN1_ETYPE_GENERALSTRING:
@@ -1003,14 +1015,6 @@ asn1_read_tag (asn1_node root, const char *name, int *tagValue,
 	CASE_HANDLED_ETYPES:
 	  *tagValue = _asn1_tags[type].tag;
 	  break;
-	case ASN1_ETYPE_TIME:
-	  if (node->type & CONST_UTC)
-	    {
-	      *tagValue = ASN1_TAG_UTCTime;
-	    }
-	  else
-	    *tagValue = ASN1_TAG_GENERALIZEDTime;
-	  break;
 	case ASN1_ETYPE_TAG:
 	case ASN1_ETYPE_CHOICE:
 	case ASN1_ETYPE_ANY:
diff --git a/lib/int.h b/lib/int.h
index 9400cb8..ce20ab2 100644
--- a/lib/int.h
+++ b/lib/int.h
@@ -85,11 +85,15 @@ typedef struct tag_and_class_st {
 	case ASN1_ETYPE_SEQUENCE: \
 	case ASN1_ETYPE_SEQUENCE_OF: \
 	case ASN1_ETYPE_SET: \
+	case ASN1_ETYPE_UTC_TIME: \
+	case ASN1_ETYPE_GENERALIZED_TIME: \
 	case ASN1_ETYPE_SET_OF
 
 #define ETYPE_TAG(etype) (_asn1_tags[etype].tag)
 #define ETYPE_CLASS(etype) (_asn1_tags[etype].class)
-#define ETYPE_OK(etype) ((etype <= _asn1_tags_size)?1:0)
+#define ETYPE_OK(etype) ((etype != ASN1_ETYPE_INVALID && \
+                          etype <= _asn1_tags_size && \
+                          _asn1_tags[etype].desc != NULL)?1:0)
 
 extern unsigned int _asn1_tags_size;
 extern const tag_and_class_st _asn1_tags[];
@@ -108,12 +112,6 @@ extern const tag_and_class_st _asn1_tags[];
 #define RIGHT  2
 #define DOWN   3
 
-/****************************************/
-/* Returns the first 8 bits.            */
-/* Used with the field type of asn1_node_st */
-/****************************************/
-#define type_field(x)     (x&0xFF)
-
 /***********************************************************************/
 /* List of constants to better specify the type of typedef asn1_node_st.   */
 /***********************************************************************/
@@ -139,6 +137,7 @@ extern const tag_and_class_st _asn1_tags[];
 
 #define CONST_DEFINED_BY  (1<<22)
 
+/* Those two are deprecated and used for backwards compatibility */
 #define CONST_GENERALIZED (1<<23)
 #define CONST_UTC         (1<<24)
 
@@ -151,4 +150,36 @@ extern const tag_and_class_st _asn1_tags[];
 #define CONST_DOWN        (1<<29)
 #define CONST_RIGHT       (1<<30)
 
+
+#define ASN1_ETYPE_TIME 17
+/****************************************/
+/* Returns the first 8 bits.            */
+/* Used with the field type of asn1_node_st */
+/****************************************/
+inline static unsigned int type_field(unsigned int ntype)
+{
+  return (ntype & 0xff);
+}
+
+/* To convert old types from a static structure */
+inline static unsigned int convert_old_type(unsigned int ntype)
+{
+unsigned int type = ntype & 0xff;
+  if (type == ASN1_ETYPE_TIME)
+    {
+      if (type & CONST_UTC)
+        type = ASN1_ETYPE_UTC_TIME;
+      else
+        type = ASN1_ETYPE_GENERALIZED_TIME;
+
+      ntype &= ~(CONST_UTC|CONST_GENERALIZED);
+      ntype &= 0xffffff00;
+      ntype |= type;
+
+      return ntype;
+    }
+  else
+    return ntype;
+}
+
 #endif /* INT_H */
diff --git a/lib/libtasn1.h b/lib/libtasn1.h
index 59c3093..5b50c47 100644
--- a/lib/libtasn1.h
+++ b/lib/libtasn1.h
@@ -135,6 +135,7 @@ extern "C"
   typedef struct asn1_static_node_st asn1_static_node;
 
 /* List of constants for field type of node_asn  */
+#define ASN1_ETYPE_INVALID        0
 #define ASN1_ETYPE_CONSTANT       1
 #define ASN1_ETYPE_IDENTIFIER     2
 #define ASN1_ETYPE_INTEGER        3
@@ -151,7 +152,6 @@ extern "C"
 #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
@@ -165,6 +165,8 @@ extern "C"
 #define ASN1_ETYPE_BMP_STRING     33
 #define ASN1_ETYPE_UTF8_STRING    34
 #define ASN1_ETYPE_VISIBLE_STRING 35
+#define ASN1_ETYPE_UTC_TIME       36
+#define ASN1_ETYPE_GENERALIZED_TIME 37
 
   struct asn1_data_node_st
   {
diff --git a/lib/parser_aux.c b/lib/parser_aux.c
index 7d16fa3..4fcc7d7 100644
--- a/lib/parser_aux.c
+++ b/lib/parser_aux.c
@@ -48,7 +48,7 @@ list_type *firstElement = NULL;
 /* Description: creates a new NODE_ASN element and    */
 /* puts it in the list pointed by firstElement.       */
 /* Parameters:                                        */
-/*   type: type of the new element (see ASN1_ETYPE_         */
+/*   type: type of the new element (see ASN1_ETYPE_   */
 /*         and CONST_ constants).                     */
 /* Return: pointer to the new element.                */
 /******************************************************/
@@ -73,7 +73,7 @@ _asn1_add_static_node (unsigned int type)
   listElement->next = firstElement;
   firstElement = listElement;
 
-  punt->type = type;
+  punt->type = convert_old_type(type);
 
   return punt;
 }
diff --git a/lib/structure.c b/lib/structure.c
index a508030..1659067 100644
--- a/lib/structure.c
+++ b/lib/structure.c
@@ -753,9 +753,6 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 	    case ASN1_ETYPE_IDENTIFIER:
 	      fprintf (out, "type:IDENTIFIER");
 	      break;
-	    case ASN1_ETYPE_TIME:
-	      fprintf (out, "type:TIME");
-	      break;
 	    case ASN1_ETYPE_ANY:
 	      fprintf (out, "type:ANY");
 	      break;
@@ -826,10 +823,6 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 		      fprintf (out, "%02x", (p->value)[k + len2]);
 		}
 	      break;
-	    case ASN1_ETYPE_TIME:
-	      if (p->value)
-		fprintf (out, "  value:%s", p->value);
-	      break;
 	    case ASN1_ETYPE_BOOLEAN:
 	      if (p->value)
 		{
@@ -853,14 +846,21 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 		    }
 		}
 	      break;
-	    case ASN1_ETYPE_OCTET_STRING:
+	    case ASN1_ETYPE_GENERALIZED_TIME:
+	    case ASN1_ETYPE_UTC_TIME:
+	      if (p->value)
+		{
+		  fprintf (out, "  value:");
+                  for (k = 0; k < p->value_len; k++)
+		    fprintf (out, "%c", (p->value)[k]);
+		}
+	      break;
 	    case ASN1_ETYPE_GENERALSTRING:
 	    case ASN1_ETYPE_NUMERIC_STRING:
 	    case ASN1_ETYPE_IA5_STRING:
 	    case ASN1_ETYPE_TELETEX_STRING:
 	    case ASN1_ETYPE_PRINTABLE_STRING:
 	    case ASN1_ETYPE_UNIVERSAL_STRING:
-	    case ASN1_ETYPE_BMP_STRING:
 	    case ASN1_ETYPE_UTF8_STRING:
 	    case ASN1_ETYPE_VISIBLE_STRING:
 	      if (p->value)
@@ -870,6 +870,18 @@ asn1_print_structure (FILE * out, asn1_node structure, const char *name,
 		  fprintf (out, "  value:");
 		  if (len > 0)
 		    for (k = 0; k < len; k++)
+		      fprintf (out, "%c", (p->value)[k + len2]);
+		}
+	      break;
+	    case ASN1_ETYPE_BMP_STRING:
+	    case ASN1_ETYPE_OCTET_STRING:
+	      if (p->value)
+		{
+		  len2 = -1;
+		  len = asn1_get_length_der (p->value, p->value_len, &len2);
+		  fprintf (out, "  value:");
+		  if (len > 0)
+		    for (k = 0; k < len; k++)
 		      fprintf (out, "%02x", (p->value)[k + len2]);
 		}
 	      break;
diff --git a/tests/Test_tree.c b/tests/Test_tree.c
index abfaa5e..bcd3cbe 100644
--- a/tests/Test_tree.c
+++ b/tests/Test_tree.c
@@ -67,361 +67,362 @@ typedef struct
   const char *par2;
   int par3;
   int errorNumber;
+  int line;
 } test_type;
 
 
 test_type test_array[] = {
 
-  {ACT_DELETE, "", "", 0, ASN1_ELEMENT_NOT_FOUND},
+  {ACT_DELETE, "", "", 0, ASN1_ELEMENT_NOT_FOUND, __LINE__},
 
   /* Test: APPLICATION 30 */
-  {ACT_CREATE, "TEST_TREE.KrbError", 0, 0, ASN1_SUCCESS},
-  {ACT_WRITE, "pvno", "5", 0, ASN1_SUCCESS},
-  {ACT_ENCODING_LENGTH, "", 0, 5, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 4, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 5, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_CREATE, "TEST_TREE.KrbError", 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_DELETE_ELEMENT, "pvno", "", 0, ASN1_SUCCESS},
-  {ACT_DELETE_ELEMENT, "pvno", "", 0, ASN1_ELEMENT_NOT_FOUND},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
+  {ACT_CREATE, "TEST_TREE.KrbError", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "pvno", "5", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING_LENGTH, "", 0, 5, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 4, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 5, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_CREATE, "TEST_TREE.KrbError", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE_ELEMENT, "pvno", "", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE_ELEMENT, "pvno", "", 0, ASN1_ELEMENT_NOT_FOUND, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
 
   /* Test: CHOICE */
-  {ACT_CREATE, "TEST_TREE.CertTemplate", 0, 0, ASN1_SUCCESS},
-  {ACT_WRITE, "version", 0, 0, ASN1_SUCCESS},
-  {ACT_WRITE, "validity", 0, 0, ASN1_SUCCESS},
-  {ACT_WRITE, "issuer", "rdnSequence", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.3", 0, ASN1_SUCCESS},
+  {ACT_CREATE, "TEST_TREE.CertTemplate", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "version", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "validity", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "issuer", "rdnSequence", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.3", 0, ASN1_SUCCESS, __LINE__},
   {ACT_WRITE, "issuer.rdnSequence.?LAST.value",
    "\x0c\x18\x71\x75\x61\x73\x61\x72\x2e\x6c\x61\x73\x2e\x69\x63\x2e\x75\x6e\x69\x63\x61\x6d\x70\x2e\x62\x72",
-   26, ASN1_SUCCESS},
-  {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.7", 0, ASN1_SUCCESS},
+   26, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.7", 0, ASN1_SUCCESS, __LINE__},
   {ACT_WRITE, "issuer.rdnSequence.?LAST.value",
-   "\x0c\x08\x43\x61\x6d\x70\x69\x6e\x61\x73", 10, ASN1_SUCCESS},
-  {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.6", 0, ASN1_SUCCESS},
+   "\x0c\x08\x43\x61\x6d\x70\x69\x6e\x61\x73", 10, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.6", 0, ASN1_SUCCESS, __LINE__},
   {ACT_WRITE, "issuer.rdnSequence.?LAST.value",
-   "\x13\x06\x42\x72\x61\x73\x69\x6c", 8, ASN1_SUCCESS},
-  {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.10", 0, ASN1_SUCCESS},
+   "\x13\x06\x42\x72\x61\x73\x69\x6c", 8, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.10", 0, ASN1_SUCCESS, __LINE__},
   {ACT_WRITE, "issuer.rdnSequence.?LAST.value", "\x0c\x02\x49\x43", 4,
-   ASN1_SUCCESS},
-  {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.11", 0, ASN1_SUCCESS},
+   ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.11", 0, ASN1_SUCCESS, __LINE__},
   {ACT_WRITE, "issuer.rdnSequence.?LAST.value", "\x0c\x03\x4c\x41\x53", 5,
-   ASN1_SUCCESS},
-  {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.8", 0, ASN1_SUCCESS},
+   ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "2.5.4.8", 0, ASN1_SUCCESS, __LINE__},
   {ACT_WRITE, "issuer.rdnSequence.?LAST.value",
-   "\x0c\x09\x53\x61\x6f\x20\x50\x61\x75\x6c\x6f", 11, ASN1_SUCCESS},
-  {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS},
+   "\x0c\x09\x53\x61\x6f\x20\x50\x61\x75\x6c\x6f", 11, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "issuer.rdnSequence", "NEW", 0, ASN1_SUCCESS, __LINE__},
   {ACT_WRITE, "issuer.rdnSequence.?LAST.type", "1.2.840.113549.1.9.1", 0,
-   ASN1_SUCCESS},
+   ASN1_SUCCESS, __LINE__},
   {ACT_WRITE, "issuer.rdnSequence.?LAST.value",
    "\x16\x19\x65\x64\x75\x61\x72\x64\x6f\x40\x6c\x61\x73\x2e\x69\x63\x2e\x75\x6e\x69\x63\x61\x6d\x70\x2e\x62\x72",
-   27, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_ENCODING_LENGTH, "", 0, 152, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 151, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 152, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
-  {ACT_CREATE, "TEST_TREE.CertTemplate", 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_DELETE_ELEMENT, "issuer.rdnSequence.?1", "", 0, ASN1_SUCCESS},
+   27, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING_LENGTH, "", 0, 152, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 151, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 152, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_CREATE, "TEST_TREE.CertTemplate", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE_ELEMENT, "issuer.rdnSequence.?1", "", 0, ASN1_SUCCESS, __LINE__},
   {ACT_DELETE_ELEMENT, "issuer.rdnSequence.?1", "", 0,
-   ASN1_ELEMENT_NOT_FOUND},
-  {ACT_DELETE_ELEMENT, "issuer.rdnSequence.?3", "", 0, ASN1_SUCCESS},
-  {ACT_DELETE_ELEMENT, "issuer.rdnSequence.?5", "", 0, ASN1_SUCCESS},
-  {ACT_DELETE_ELEMENT, "issuer.rdnSequence.?7", "", 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
+   ASN1_ELEMENT_NOT_FOUND, __LINE__},
+  {ACT_DELETE_ELEMENT, "issuer.rdnSequence.?3", "", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE_ELEMENT, "issuer.rdnSequence.?5", "", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE_ELEMENT, "issuer.rdnSequence.?7", "", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
 
   /* Test: Empty sequnces */
-  {ACT_CREATE, "TEST_TREE.sequenceEmpty", 0, 0, ASN1_SUCCESS},
-  {ACT_WRITE, "int1", "1", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "seq1.int", NULL, 0, ASN1_SUCCESS},
-  {ACT_ENCODING_LENGTH, "", 0, 11, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 10, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 11, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
-  {ACT_CREATE, "TEST_TREE.sequenceEmpty", 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING_START_END, "seq1", "START", 5, ASN1_SUCCESS},
-  {ACT_DECODING_START_END, "seq1", "END", 6, ASN1_SUCCESS},
-  {ACT_DECODING_START_END, "set1", "START", 7, ASN1_SUCCESS},
-  {ACT_DECODING_START_END, "set1", "END", 10, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
+  {ACT_CREATE, "TEST_TREE.sequenceEmpty", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "int1", "1", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "seq1.int", NULL, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING_LENGTH, "", 0, 11, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 10, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 11, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_CREATE, "TEST_TREE.sequenceEmpty", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING_START_END, "seq1", "START", 5, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING_START_END, "seq1", "END", 6, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING_START_END, "set1", "START", 7, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING_START_END, "set1", "END", 10, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
 
   /* Test: Indefinite Length */
-  {ACT_CREATE, "TEST_TREE.IndefiniteLengthTest", 0, 0, ASN1_SUCCESS},
-  {ACT_WRITE, "int1", "1", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "seq1.int", "2", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "set1", "NEW", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "set1.?LAST", "1.2.3.4", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "set1", "NEW", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "set1.?LAST", "1.2.5.6", 0, ASN1_SUCCESS},
-  {ACT_ENCODING, "", 0, 255, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
+  {ACT_CREATE, "TEST_TREE.IndefiniteLengthTest", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "int1", "1", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "seq1.int", "2", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "set1", "NEW", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "set1.?LAST", "1.2.3.4", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "set1", "NEW", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "set1.?LAST", "1.2.5.6", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING, "", 0, 255, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
   {ACT_SET_DER,
    "\x30\x18\xa1\x80\x02\x01\x02\x00\x00\x31\x80\x06\x03\x2a\x03\x04\x06\x03\x2a\x05\x06\x00\x00\x02\x01\x01",
-   0, 26, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
-  {ACT_CREATE, "TEST_TREE.IndefiniteLengthTest", 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING_START_END, "seq1", "START", 2, ASN1_SUCCESS},
-  {ACT_DECODING_START_END, "seq1", "END", 8, ASN1_SUCCESS},
-  {ACT_DECODING_START_END, "set1", "START", 9, ASN1_SUCCESS},
-  {ACT_DECODING_START_END, "set1", "END", 22, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
+   0, 26, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_CREATE, "TEST_TREE.IndefiniteLengthTest", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING_START_END, "seq1", "START", 2, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING_START_END, "seq1", "END", 8, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING_START_END, "set1", "START", 9, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING_START_END, "set1", "END", 22, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
 
   /* Test: OID */
-  {ACT_CREATE, "TEST_TREE.OidTest", 0, 0, ASN1_SUCCESS},
-  {ACT_READ_LENGTH, "oid", NULL, 9, ASN1_MEM_ERROR},
-  {ACT_READ, "oid", "2.5.29.2", 9, ASN1_SUCCESS},
-  {ACT_WRITE, "oid", "1.2.3.4", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "oid2", "2.5.29.1", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "oid3", "1.2.29.2", 0, ASN1_SUCCESS},
-  {ACT_ENCODING_LENGTH, "", 0, 7, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 6, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 7, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
-  {ACT_CREATE, "TEST_TREE.OidTest", 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING_START_END, "oid", "START", 2, ASN1_SUCCESS},
-  {ACT_DECODING_START_END, "oid", "END", 6, ASN1_SUCCESS},
-  {ACT_DECODING_START_END, "", "START", 0, ASN1_SUCCESS},
-  {ACT_DECODING_START_END, "", "END", 6, ASN1_SUCCESS},
-  {ACT_READ, "oid2", "2.5.29.1", 9, ASN1_SUCCESS},
-  {ACT_READ, "oid3", "1.2.29.2", 9, ASN1_SUCCESS},
-  {ACT_WRITE, "oid", "1.2.3.4", 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
+  {ACT_CREATE, "TEST_TREE.OidTest", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_READ_LENGTH, "oid", NULL, 9, ASN1_MEM_ERROR, __LINE__},
+  {ACT_READ, "oid", "2.5.29.2", 9, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "oid", "1.2.3.4", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "oid2", "2.5.29.1", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "oid3", "1.2.29.2", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING_LENGTH, "", 0, 7, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 6, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 7, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_CREATE, "TEST_TREE.OidTest", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING_START_END, "oid", "START", 2, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING_START_END, "oid", "END", 6, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING_START_END, "", "START", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING_START_END, "", "END", 6, ASN1_SUCCESS, __LINE__},
+  {ACT_READ, "oid2", "2.5.29.1", 9, ASN1_SUCCESS, __LINE__},
+  {ACT_READ, "oid3", "1.2.29.2", 9, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "oid", "1.2.3.4", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
 
   /* Test: ENCODING_LENGTH and READ_LEN */
-  {ACT_CREATE, "TEST_TREE.OidAndTimeTest", 0, 0, ASN1_SUCCESS},
-  {ACT_WRITE, "oid", "1.2.3.4", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "time1", "9801011200Z", 1, ASN1_SUCCESS},
-  {ACT_WRITE, "time2", "2001010112001.12-0700", 1, ASN1_SUCCESS},
-  {ACT_WRITE, "oct", "ABCD", 4, ASN1_SUCCESS},
-  {ACT_WRITE, "bol", "TRUE", 1, ASN1_SUCCESS},
-  {ACT_WRITE, "enum", "2", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "bit", "1\xC0", 10, ASN1_SUCCESS},
-  {ACT_WRITE, "any", "\x30\x01\x01", 3, ASN1_SUCCESS},
-  {ACT_WRITE, "set", "NEW", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "set.?LAST", "10", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "set", "NEW", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "set.?LAST", "1", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "gen", "Prova", 5, ASN1_SUCCESS},
-  {ACT_READ_LENGTH, "oid", NULL, 8, ASN1_MEM_ERROR},
-  {ACT_READ_LENGTH, "time1", NULL, 12, ASN1_MEM_ERROR},
-  {ACT_READ_LENGTH, "time2", NULL, 22, ASN1_MEM_ERROR},
-  {ACT_READ_LENGTH, "oct", NULL, 4, ASN1_MEM_ERROR},
-  {ACT_READ_LENGTH, "bol", NULL, 5, ASN1_MEM_ERROR},
-  {ACT_READ_LENGTH, "enum", NULL, 1, ASN1_MEM_ERROR},
-  {ACT_READ_LENGTH, "any", NULL, 3, ASN1_MEM_ERROR},
-  {ACT_READ_LENGTH, "gen", NULL, 5, ASN1_MEM_ERROR},
-  {ACT_READ_LENGTH, "bit", NULL, 10, ASN1_MEM_ERROR},
-  {ACT_READ_BIT, "bit", "1\xC0", 10, ASN1_SUCCESS},
-  {ACT_ENCODING_LENGTH, "", 0, 79, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 78, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 79, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
-  {ACT_CREATE, "TEST_TREE.OidAndTimeTest", 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
+  {ACT_CREATE, "TEST_TREE.OidAndTimeTest", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "oid", "1.2.3.4", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "time1", "9801011200Z", 1, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "time2", "2001010112001.12-0700", 1, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "oct", "ABCD", 4, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "bol", "TRUE", 1, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "enum", "2", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "bit", "1\xC0", 10, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "any", "\x30\x01\x01", 3, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "set", "NEW", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "set.?LAST", "10", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "set", "NEW", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "set.?LAST", "1", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "gen", "Prova", 5, ASN1_SUCCESS, __LINE__},
+  {ACT_READ_LENGTH, "oid", NULL, 8, ASN1_MEM_ERROR, __LINE__},
+  {ACT_READ_LENGTH, "time1", NULL, 12, ASN1_MEM_ERROR, __LINE__},
+  {ACT_READ_LENGTH, "time2", NULL, 22, ASN1_MEM_ERROR, __LINE__},
+  {ACT_READ_LENGTH, "oct", NULL, 4, ASN1_MEM_ERROR, __LINE__},
+  {ACT_READ_LENGTH, "bol", NULL, 5, ASN1_MEM_ERROR, __LINE__},
+  {ACT_READ_LENGTH, "enum", NULL, 1, ASN1_MEM_ERROR, __LINE__},
+  {ACT_READ_LENGTH, "any", NULL, 3, ASN1_MEM_ERROR, __LINE__},
+  {ACT_READ_LENGTH, "gen", NULL, 5, ASN1_MEM_ERROR, __LINE__},
+  {ACT_READ_LENGTH, "bit", NULL, 10, ASN1_MEM_ERROR, __LINE__},
+  {ACT_READ_BIT, "bit", "1\xC0", 10, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING_LENGTH, "", 0, 79, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 78, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 79, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_CREATE, "TEST_TREE.OidAndTimeTest", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
 
   /* Test: OID to STRUCTURE */
-  {ACT_OID_2_STRUCTURE, "2.5.29.3", "", 0, ASN1_ELEMENT_NOT_FOUND},
-  {ACT_OID_2_STRUCTURE, "1.2.29.2", "", 0, ASN1_ELEMENT_NOT_FOUND},
-  {ACT_OID_2_STRUCTURE, "2.5.29.2", "anyTest2", 0, ASN1_SUCCESS},
+  {ACT_OID_2_STRUCTURE, "2.5.29.3", "", 0, ASN1_ELEMENT_NOT_FOUND, __LINE__},
+  {ACT_OID_2_STRUCTURE, "1.2.29.2", "", 0, ASN1_ELEMENT_NOT_FOUND, __LINE__},
+  {ACT_OID_2_STRUCTURE, "2.5.29.2", "anyTest2", 0, ASN1_SUCCESS, __LINE__},
 
   /* Test: READ TAG and CLASS */
-  {ACT_CREATE, "TEST_TREE.SequenceTestTag", 0, 0, ASN1_SUCCESS},
-  {ACT_READ_TAG_CLASS, "int", "", 0, ASN1_ELEMENT_NOT_FOUND},
-  {ACT_READ_TAG_CLASS, "int1", "TAG", ASN1_TAG_INTEGER, ASN1_SUCCESS},
-  {ACT_READ_TAG_CLASS, "int1", "CLASS", ASN1_CLASS_UNIVERSAL, ASN1_SUCCESS},
-  {ACT_READ_TAG_CLASS, "int2", "TAG", 3, ASN1_SUCCESS},
+  {ACT_CREATE, "TEST_TREE.SequenceTestTag", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_READ_TAG_CLASS, "int", "", 0, ASN1_ELEMENT_NOT_FOUND, __LINE__},
+  {ACT_READ_TAG_CLASS, "int1", "TAG", ASN1_TAG_INTEGER, ASN1_SUCCESS, __LINE__},
+  {ACT_READ_TAG_CLASS, "int1", "CLASS", ASN1_CLASS_UNIVERSAL, ASN1_SUCCESS, __LINE__},
+  {ACT_READ_TAG_CLASS, "int2", "TAG", 3, ASN1_SUCCESS, __LINE__},
   {ACT_READ_TAG_CLASS, "int2", "CLASS", ASN1_CLASS_CONTEXT_SPECIFIC,
-   ASN1_SUCCESS},
-  {ACT_READ_TAG_CLASS, "str1", "TAG", 1, ASN1_SUCCESS},
+   ASN1_SUCCESS, __LINE__},
+  {ACT_READ_TAG_CLASS, "str1", "TAG", 1, ASN1_SUCCESS, __LINE__},
   {ACT_READ_TAG_CLASS, "str1", "CLASS", ASN1_CLASS_CONTEXT_SPECIFIC,
-   ASN1_SUCCESS},
-  {ACT_READ_TAG_CLASS, "str2", "TAG", 28, ASN1_SUCCESS},
-  {ACT_READ_TAG_CLASS, "str2", "CLASS", ASN1_CLASS_UNIVERSAL, ASN1_SUCCESS},
-  {ACT_READ_TAG_CLASS, "str3", "TAG", 28, ASN1_SUCCESS},
-  {ACT_READ_TAG_CLASS, "str3", "CLASS", ASN1_CLASS_UNIVERSAL, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
+   ASN1_SUCCESS, __LINE__},
+  {ACT_READ_TAG_CLASS, "str2", "TAG", 28, ASN1_SUCCESS, __LINE__},
+  {ACT_READ_TAG_CLASS, "str2", "CLASS", ASN1_CLASS_UNIVERSAL, ASN1_SUCCESS, __LINE__},
+  {ACT_READ_TAG_CLASS, "str3", "TAG", 28, ASN1_SUCCESS, __LINE__},
+  {ACT_READ_TAG_CLASS, "str3", "CLASS", ASN1_CLASS_UNIVERSAL, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
 
   /* Test: OBJECT IDENTIFIER  elements */
-  {ACT_CREATE, "TEST_TREE.Sequence1", 0, 0, ASN1_SUCCESS},
-  {ACT_WRITE, "int1", "v2", 0, ASN1_SUCCESS},
-  {ACT_READ, "int1", "\x01", 1, ASN1_SUCCESS},
-  {ACT_WRITE, "int2", "0", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "oct", "\x02\x01\x0a", 3, ASN1_SUCCESS},
-  {ACT_WRITE, "id", "1 2 3 4 5", 0, ASN1_VALUE_NOT_VALID},
-  {ACT_WRITE, "id", "2.5.29.2", 0, ASN1_SUCCESS},
-  {ACT_READ, "id", "2.5.29.2", 9, ASN1_SUCCESS},
-  {ACT_READ_LENGTH, "id", NULL, 9, ASN1_MEM_ERROR},
-  {ACT_WRITE, "any1", "\x02\x01\x05", 3, ASN1_SUCCESS},
-  {ACT_READ_DEFINITIONS, "TEST_TREE.id-anyTest", "2.5.29.1", 9, ASN1_SUCCESS},
-  {ACT_ENCODING_LENGTH, "", 0, 20, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 19, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 200, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
-  {ACT_CREATE, "TEST_TREE.Sequence1", 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING_START_END, "id", "START", 7, ASN1_SUCCESS},
-  {ACT_READ, "id", "2.5.29.2", 9, ASN1_SUCCESS},
-  {ACT_EXPAND_ANY, "", NULL, 0, ASN1_SUCCESS},
-  {ACT_EXPAND_OCTET, "oct", "id", 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
+  {ACT_CREATE, "TEST_TREE.Sequence1", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "int1", "v2", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_READ, "int1", "\x01", 1, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "int2", "0", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "oct", "\x02\x01\x0a", 3, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "id", "1 2 3 4 5", 0, ASN1_VALUE_NOT_VALID, __LINE__},
+  {ACT_WRITE, "id", "2.5.29.2", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_READ, "id", "2.5.29.2", 9, ASN1_SUCCESS, __LINE__},
+  {ACT_READ_LENGTH, "id", NULL, 9, ASN1_MEM_ERROR, __LINE__},
+  {ACT_WRITE, "any1", "\x02\x01\x05", 3, ASN1_SUCCESS, __LINE__},
+  {ACT_READ_DEFINITIONS, "TEST_TREE.id-anyTest", "2.5.29.1", 9, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING_LENGTH, "", 0, 20, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 19, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 200, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_CREATE, "TEST_TREE.Sequence1", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING_START_END, "id", "START", 7, ASN1_SUCCESS, __LINE__},
+  {ACT_READ, "id", "2.5.29.2", 9, ASN1_SUCCESS, __LINE__},
+  {ACT_EXPAND_ANY, "", NULL, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_EXPAND_OCTET, "oct", "id", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
 
   /* Test: CHOICE elements */
-  {ACT_CREATE, "TEST_TREE.X520LocalityName", 0, 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_WRITE, "", "teletexString", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "teletexString", "PROVA", 5, ASN1_SUCCESS},
-  {ACT_ENCODING_LENGTH, "", 0, 7, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 6, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 7, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
-  {ACT_CREATE, "TEST_TREE.X520LocalityName", 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
+  {ACT_CREATE, "TEST_TREE.X520LocalityName", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "", "teletexString", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "teletexString", "PROVA", 5, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING_LENGTH, "", 0, 7, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 6, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 7, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_CREATE, "TEST_TREE.X520LocalityName", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
 
   /* Test: OPTIONAL elements */
-  {ACT_CREATE, "TEST_TREE.DHParameter", 0, 0, ASN1_SUCCESS},
-  {ACT_WRITE, "prime", "1", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "base", "2", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "privateValueLength", NULL, 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_ENCODING_LENGTH, "", 0, 8, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 7, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 8, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
-  {ACT_CREATE, "TEST_TREE.DHParameter", 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
+  {ACT_CREATE, "TEST_TREE.DHParameter", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "prime", "1", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "base", "2", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "privateValueLength", NULL, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING_LENGTH, "", 0, 8, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 7, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 8, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_CREATE, "TEST_TREE.DHParameter", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
 
   /* Test: Integer */
-  {ACT_CREATE, "TEST_TREE.AnyTest2", 0, 0, ASN1_SUCCESS},
-  {ACT_WRITE, "", "int", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "int", "0", 0, ASN1_SUCCESS},
-  {ACT_ENCODING_LENGTH, "", 0, 3, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 2, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 3, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_WRITE, "int", "-1", 0, ASN1_SUCCESS},
-  {ACT_ENCODING, "", 0, 1024, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_WRITE, "int", "1", 0, ASN1_SUCCESS},
-  {ACT_ENCODING, "", 0, 1024, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_WRITE, "int", "2000000000", 0, ASN1_SUCCESS},
-  {ACT_ENCODING, "", 0, 1024, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_WRITE, "int", "-2000000000", 0, ASN1_SUCCESS},
-  {ACT_ENCODING, "", 0, 1024, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_WRITE, "int", "-20000000000", 0, ASN1_SUCCESS},
-  {ACT_ENCODING, "", 0, 1024, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_WRITE, "int", "20000000000", 0, ASN1_SUCCESS},
-  {ACT_ENCODING, "", 0, 1024, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
+  {ACT_CREATE, "TEST_TREE.AnyTest2", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "", "int", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "int", "0", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING_LENGTH, "", 0, 3, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 2, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 3, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "int", "-1", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING, "", 0, 1024, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "int", "1", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING, "", 0, 1024, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "int", "2000000000", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING, "", 0, 1024, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "int", "-2000000000", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING, "", 0, 1024, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "int", "-20000000000", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING, "", 0, 1024, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "int", "20000000000", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING, "", 0, 1024, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
 
   /* Test: elements without names */
-  {ACT_CREATE, "TEST_TREE.Sequence1", 0, 0, ASN1_SUCCESS},
-  {ACT_WRITE, "int2", "10", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "seq", "NEW", 1, ASN1_SUCCESS},
-  {ACT_WRITE, "seq.?LAST", "1", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "seq", "NEW", 1, ASN1_SUCCESS},
-  {ACT_WRITE, "seq.?LAST", "2", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "any1", NULL, 0, ASN1_SUCCESS},
-  {ACT_NUMBER_OF_ELEMENTS, "seq", "", 2, ASN1_SUCCESS},
-  {ACT_WRITE, "id", "1.2.3.4", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "oct", "\x30\x03\x02\x01\x15", 5, ASN1_SUCCESS},
-  {ACT_ENCODING, "int2", 0, 1024, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_ENCODING, "seq.?2", 0, 2, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "seq.?2", 0, 3, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_ENCODING_LENGTH, "", 0, 25, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 24, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 25, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_CREATE, "TEST_TREE.Sequence1", 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING_ELEMENT, "int2", 0, 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_READ, "int2", "\x0a", 1, ASN1_SUCCESS},
-  {ACT_READ_LENGTH, "int2", NULL, 1, ASN1_MEM_ERROR},
-  {ACT_CREATE, "TEST_TREE.Sequence1", 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING_START_END, "seq.?2", "START", 10, ASN1_SUCCESS},
-  {ACT_EXPAND_OCTET, "oct", "id", 0, ASN1_SUCCESS},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
+  {ACT_CREATE, "TEST_TREE.Sequence1", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "int2", "10", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "seq", "NEW", 1, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "seq.?LAST", "1", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "seq", "NEW", 1, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "seq.?LAST", "2", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "any1", NULL, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_NUMBER_OF_ELEMENTS, "seq", "", 2, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "id", "1.2.3.4", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "oct", "\x30\x03\x02\x01\x15", 5, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING, "int2", 0, 1024, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING, "seq.?2", 0, 2, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "seq.?2", 0, 3, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING_LENGTH, "", 0, 25, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 24, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 25, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_CREATE, "TEST_TREE.Sequence1", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING_ELEMENT, "int2", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_READ, "int2", "\x0a", 1, ASN1_SUCCESS, __LINE__},
+  {ACT_READ_LENGTH, "int2", NULL, 1, ASN1_MEM_ERROR, __LINE__},
+  {ACT_CREATE, "TEST_TREE.Sequence1", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING_START_END, "seq.?2", "START", 10, ASN1_SUCCESS, __LINE__},
+  {ACT_EXPAND_OCTET, "oct", "id", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
 
   /* Test GeneralString */
-  {ACT_CREATE, "TEST_TREE.Test3", 0, 0, ASN1_SUCCESS},
-  {ACT_WRITE, "a", "1234", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "b", "prova", 5, ASN1_SUCCESS},
-  {ACT_ENCODING_LENGTH, "", 0, 17, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 16, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 17, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
-  {ACT_CREATE, "TEST_TREE.Test3", 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING_ELEMENT, "b", 0, 0, ASN1_SUCCESS},
-  {ACT_READ, "b", "prova", 5, ASN1_SUCCESS},
-  {ACT_READ_LENGTH, "b", NULL, 5, ASN1_MEM_ERROR},
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
+  {ACT_CREATE, "TEST_TREE.Test3", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "a", "1234", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "b", "prova", 5, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING_LENGTH, "", 0, 17, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 16, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 17, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_CREATE, "TEST_TREE.Test3", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING_ELEMENT, "b", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_READ, "b", "prova", 5, ASN1_SUCCESS, __LINE__},
+  {ACT_READ_LENGTH, "b", NULL, 5, ASN1_MEM_ERROR, __LINE__},
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
 
   /* Bug regression test: Empty write on 64-bit platforms */
-  {ACT_CREATE, "TEST_TREE.Checksum", 0, 0, ASN1_SUCCESS},
-  {ACT_WRITE, "checksum", "foo", 0, ASN1_SUCCESS},
-  {ACT_WRITE, "checksum", "", 0, ASN1_SUCCESS},
-  {ACT_ENCODING_LENGTH, "", 0, 4, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 3, ASN1_MEM_ERROR},
-  {ACT_ENCODING, "", 0, 4, ASN1_SUCCESS},
-  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
-  {ACT_CREATE, "TEST_TREE.Checksum", 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS},
-  {ACT_DECODING_ELEMENT, "checksum", 0, 0, ASN1_SUCCESS},
-  {ACT_READ, "checksum", "", 0, ASN1_SUCCESS},
-  {ACT_READ_LENGTH, "checksum", NULL, 0, ASN1_SUCCESS},	/* MEM_FAILURE? */
-  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS},
-  {ACT_DELETE, "", "", 0, ASN1_SUCCESS},
+  {ACT_CREATE, "TEST_TREE.Checksum", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "checksum", "foo", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_WRITE, "checksum", "", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_ENCODING_LENGTH, "", 0, 4, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 3, ASN1_MEM_ERROR, __LINE__},
+  {ACT_ENCODING, "", 0, 4, ASN1_SUCCESS, __LINE__},
+  {ACT_PRINT_DER, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_CREATE, "TEST_TREE.Checksum", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING, 0, 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_DECODING_ELEMENT, "checksum", 0, 0, ASN1_SUCCESS, __LINE__},
+  {ACT_READ, "checksum", "", 0, ASN1_SUCCESS, __LINE__},
+  {ACT_READ_LENGTH, "checksum", NULL, 0, ASN1_SUCCESS, __LINE__},	/* MEM_FAILURE? */
+  {ACT_VISIT, "", "", ASN1_PRINT_ALL, ASN1_SUCCESS, __LINE__},
+  {ACT_DELETE, "", "", 0, ASN1_SUCCESS, __LINE__},
 
   /* end */
   {ACT_NULL}
@@ -429,6 +430,8 @@ test_type test_array[] = {
 };
 
 
+#define  error() fprintf(stderr, "Error at line %d\n", __LINE__); exit(1)
+
 int
 main (int argc, char *argv[])
 {
@@ -625,25 +628,27 @@ main (int argc, char *argv[])
 	  if (result != test->errorNumber)
 	    {
 	      errorCounter++;
-	      printf ("ERROR N. %d:\n", errorCounter);
+	      printf ("ERROR in %d:\n", test->line);
 	      printf ("  Action %d - %s - %s - %d\n", test->action,
 		      test->par1, test->par2, test->par3);
 	      printf ("  Error expected: %s\n",
 		      asn1_strerror (test->errorNumber));
 	      printf ("  Error detected: %s\n\n", asn1_strerror (result));
+	      error();
 	    }
 	  break;
 	case ACT_DECODING_ELEMENT:
 	  if (result != test->errorNumber)
 	    {
 	      errorCounter++;
-	      printf ("ERROR N. %d:\n", errorCounter);
+	      printf ("ERROR in %d:\n", test->line);
 	      printf ("  Action %d - %s - %s - %d\n", test->action,
 		      test->par1, test->par2, test->par3);
 	      printf ("  Error expected: %s\n",
 		      asn1_strerror (test->errorNumber));
 	      printf ("  Error detected: %s\n", asn1_strerror (result));
 	      printf ("  Error description : %s\n\n", errorDescription);
+	      error();
 	    }
 	  break;
 	case ACT_NUMBER_OF_ELEMENTS:
@@ -651,24 +656,26 @@ main (int argc, char *argv[])
 	  if ((result != test->errorNumber) || (valueLen != test->par3))
 	    {
 	      errorCounter++;
-	      printf ("ERROR N. %d:\n", errorCounter);
+	      printf ("ERROR in %d:\n", test->line);
 	      printf ("  Action %d - %s\n", test->action, test->par1);
 	      printf ("  Error expected: %s - %d\n",
 		      asn1_strerror (test->errorNumber), test->par3);
 	      printf ("  Error detected: %s - %d\n\n", asn1_strerror (result),
 		      valueLen);
+	      error();
 	    }
 	  break;
 	case ACT_ENCODING_LENGTH:
 	  if ((result != test->errorNumber) || (der_len != test->par3))
 	    {
 	      errorCounter++;
-	      printf ("ERROR N. %d:\n", errorCounter);
+	      printf ("ERROR in %d:\n", test->line);
 	      printf ("  Action %d - %s\n", test->action, test->par1);
 	      printf ("  Error expected: %s - %d\n",
 		      asn1_strerror (test->errorNumber), test->par3);
 	      printf ("  Error detected: %s - %d\n\n", asn1_strerror (result),
 		      der_len);
+	      error();
 	    }
 	  break;
 	case ACT_OID_2_STRUCTURE:
@@ -678,11 +685,12 @@ main (int argc, char *argv[])
 	       && (strcmp (str_p, test->par2))))
 	    {
 	      errorCounter++;
-	      printf ("ERROR N. %d:\n", errorCounter);
+	      printf ("ERROR in %d:\n", test->line);
 	      printf ("  Action %d - %s\n", test->action, test->par1);
 	      printf ("  Error expected: %s - %s\n",
 		      asn1_strerror (test->errorNumber), test->par2);
 	      printf ("  Value detected: %s\n\n", str_p);
+	      error();
 	    }
 	  break;
 	case ACT_DECODING_START_END:
@@ -691,7 +699,7 @@ main (int argc, char *argv[])
 	      ((!strcmp (test->par2, "END")) && (end != test->par3)))
 	    {
 	      errorCounter++;
-	      printf ("ERROR N. %d:\n", errorCounter);
+	      printf ("ERROR in %d:\n", test->line);
 	      printf ("  Action %d - %s - %d\n", test->action, test->par1,
 		      test->par3);
 	      printf ("  Error expected: %s - %s - %d\n",
@@ -699,6 +707,7 @@ main (int argc, char *argv[])
 		      test->par3);
 	      printf ("  Error detected: %s - %d - %d\n\n",
 		      asn1_strerror (result), start, end);
+	      error();
 	    }
 	  break;
 
@@ -708,7 +717,7 @@ main (int argc, char *argv[])
 	      ((!strcmp (test->par2, "CLASS")) && (class != test->par3)))
 	    {
 	      errorCounter++;
-	      printf ("ERROR N. %d:\n", errorCounter);
+	      printf ("ERROR in %d:\n", test->line);
 	      printf ("  Action %d - %s - %d\n", test->action, test->par1,
 		      test->par3);
 	      printf ("  Error expected: %s - %s - %d\n",
@@ -716,6 +725,7 @@ main (int argc, char *argv[])
 		      test->par3);
 	      printf ("  Error detected: %s - %d - %d\n\n",
 		      asn1_strerror (result), tag, class);
+	      error();
 	    }
 
 	  break;
@@ -746,7 +756,7 @@ main (int argc, char *argv[])
 	      (valueLen != test->par3) || (k == -1))
 	    {
 	      errorCounter++;
-	      printf ("ERROR N. %d:\n", errorCounter);
+	      printf ("ERROR in %d:\n", test->line);
 	      printf ("  Action %d - %s\n", test->action, test->par1);
 	      printf ("  Error expected: %s - %d - ",
 		      asn1_strerror (test->errorNumber), test->par3);
@@ -758,6 +768,7 @@ main (int argc, char *argv[])
 		printf ("%02x", value[k]);
 	      printf ("\n\n");
 
+	      error();
 	    }
 
 	  break;


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Sat Nov 24 10:45:35 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TcHvD-0000Jp-LK
	for mharc-libtasn1-commit@gnu.org; Sat, 24 Nov 2012 10:45:35 -0500
Received: from eggs.gnu.org ([208.118.235.92]:33514)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcHvB-0000Hf-5o
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 10:45:34 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcHv9-0008A8-V8
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 10:45:33 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:41230)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcHv9-0008A0-Kn
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 10:45:31 -0500
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcHv9-0005lf-7g
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 15:45:31 +0000
Date: Sat, 24 Nov 2012 15:45:31 +0000
Message-Id: <E1TcHv9-0005lf-7g@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_0-34-g87eaca2
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 8cd1f611d962eb62db6b5beb5b395597ce463110
X-Git-Newrev: 87eaca2a83999caa575df98a7d7e483251c361ee
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 24 Nov 2012 15:45:34 -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=87eaca2a83999caa575df98a7d7e483251c361ee

The branch, master has been updated
       via  87eaca2a83999caa575df98a7d7e483251c361ee (commit)
      from  8cd1f611d962eb62db6b5beb5b395597ce463110 (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 87eaca2a83999caa575df98a7d7e483251c361ee
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Sat Nov 24 16:45:23 2012 +0100

    simplified

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

Summary of changes:
 lib/element.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/element.c b/lib/element.c
index 2c761c5..a49758b 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -389,7 +389,6 @@ asn1_write_value (asn1_node node_root, const char *name,
 	  memcpy (value_temp, value, len);
 	}
 
-
       if (value_temp[0] & 0x80)
 	negative = 1;
       else
@@ -501,12 +500,12 @@ asn1_write_value (asn1_node node_root, const char *name,
       break;
     case ASN1_ETYPE_UTC_TIME:
 	{
-	  if (_asn1_strlen (value) < 11)
+	  if (len < 11)
 	    return ASN1_VALUE_NOT_VALID;
 	  for (k = 0; k < 10; k++)
 	    if (!isdigit (value[k]))
 	      return ASN1_VALUE_NOT_VALID;
-	  switch (_asn1_strlen (value))
+	  switch (len)
 	    {
 	    case 11:
 	      if (value[10] != 'Z')
@@ -536,12 +535,12 @@ asn1_write_value (asn1_node node_root, const char *name,
 	    default:
 	      return ASN1_VALUE_NOT_FOUND;
 	    }
-	  _asn1_set_value (node, value, _asn1_strlen (value));
+	  _asn1_set_value (node, value, len);
 	}
       break;
     case ASN1_ETYPE_GENERALIZED_TIME:
       if (value)
-        _asn1_set_value (node, value, _asn1_strlen (value));
+        _asn1_set_value (node, value, len);
       break;
     case ASN1_ETYPE_OCTET_STRING:
     case ASN1_ETYPE_GENERALSTRING:


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Sat Nov 24 11:58:25 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TcJ3h-0002hB-5z
	for mharc-libtasn1-commit@gnu.org; Sat, 24 Nov 2012 11:58:25 -0500
Received: from eggs.gnu.org ([208.118.235.92]:54024)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcJ3e-0002h5-Sh
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 11:58:24 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcJ3d-0003g6-NW
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 11:58:22 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:35581)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcJ3d-0003g2-KA
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 11:58:21 -0500
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcJ3c-0001KW-U9
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 16:58:21 +0000
Date: Sat, 24 Nov 2012 16:58:21 +0000
Message-Id: <E1TcJ3c-0001KW-U9@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_0-35-g3c439d2
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 87eaca2a83999caa575df98a7d7e483251c361ee
X-Git-Newrev: 3c439d2a5c5fb669645076bcd380a352fb23d725
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 24 Nov 2012 16:58:24 -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=3c439d2a5c5fb669645076bcd380a352fb23d725

The branch, master has been updated
       via  3c439d2a5c5fb669645076bcd380a352fb23d725 (commit)
      from  87eaca2a83999caa575df98a7d7e483251c361ee (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 3c439d2a5c5fb669645076bcd380a352fb23d725
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Sat Nov 24 17:57:51 2012 +0100

    corrected compatibility mode with old structures.

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

Summary of changes:
 lib/int.h        |    2 +-
 lib/parser_aux.c |    2 +-
 lib/structure.c  |    9 ++++++---
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/lib/int.h b/lib/int.h
index ce20ab2..3163d50 100644
--- a/lib/int.h
+++ b/lib/int.h
@@ -167,7 +167,7 @@ inline static unsigned int convert_old_type(unsigned int ntype)
 unsigned int type = ntype & 0xff;
   if (type == ASN1_ETYPE_TIME)
     {
-      if (type & CONST_UTC)
+      if (ntype & CONST_UTC)
         type = ASN1_ETYPE_UTC_TIME;
       else
         type = ASN1_ETYPE_GENERALIZED_TIME;
diff --git a/lib/parser_aux.c b/lib/parser_aux.c
index 4fcc7d7..50238d2 100644
--- a/lib/parser_aux.c
+++ b/lib/parser_aux.c
@@ -73,7 +73,7 @@ _asn1_add_static_node (unsigned int type)
   listElement->next = firstElement;
   firstElement = listElement;
 
-  punt->type = convert_old_type(type);
+  punt->type = type;
 
   return punt;
 }
diff --git a/lib/structure.c b/lib/structure.c
index 1659067..31a5f65 100644
--- a/lib/structure.c
+++ b/lib/structure.c
@@ -181,6 +181,7 @@ asn1_array2tree (const asn1_static_node * array, asn1_node * definitions,
   unsigned long k;
   int move;
   int result;
+  unsigned int type;
 
 
   if (*definitions != NULL)
@@ -191,7 +192,9 @@ asn1_array2tree (const asn1_static_node * array, asn1_node * definitions,
   k = 0;
   while (array[k].value || array[k].type || array[k].name)
     {
-      p = _asn1_add_static_node (array[k].type & (~CONST_DOWN));
+      type = convert_old_type(array[k].type);
+
+      p = _asn1_add_static_node (type & (~CONST_DOWN));
       if (array[k].name)
 	_asn1_set_name (p, array[k].name);
       if (array[k].value)
@@ -207,9 +210,9 @@ asn1_array2tree (const asn1_static_node * array, asn1_node * definitions,
 
       p_last = p;
 
-      if (array[k].type & CONST_DOWN)
+      if (type & CONST_DOWN)
 	move = DOWN;
-      else if (array[k].type & CONST_RIGHT)
+      else if (type & CONST_RIGHT)
 	move = RIGHT;
       else
 	{


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Sat Nov 24 12:28:35 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TcJWt-0001PD-LA
	for mharc-libtasn1-commit@gnu.org; Sat, 24 Nov 2012 12:28:35 -0500
Received: from eggs.gnu.org ([208.118.235.92]:44051)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcJWq-0001P7-Nd
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 12:28:34 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcJWo-0003xe-Ro
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 12:28:32 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:47558)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcJWo-0003xa-Nm
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 12:28:30 -0500
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcJWo-0003PF-Eq
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 17:28:30 +0000
Date: Sat, 24 Nov 2012 17:28:30 +0000
Message-Id: <E1TcJWo-0003PF-Eq@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_0-39-gabd9f8b
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 3c439d2a5c5fb669645076bcd380a352fb23d725
X-Git-Newrev: abd9f8b947f8ee5ee8643ea2f2e9821f149f1858
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 24 Nov 2012 17:28:34 -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=abd9f8b947f8ee5ee8643ea2f2e9821f149f1858

The branch, master has been updated
       via  abd9f8b947f8ee5ee8643ea2f2e9821f149f1858 (commit)
       via  020ed0387e48fedf89224539d10db1bb464bb4a2 (commit)
       via  76c0e3bca289c1001597dd7081e894f860cee0ec (commit)
       via  99f058ce44b5354d4d44cfae0b9394a36c1fe8f4 (commit)
      from  3c439d2a5c5fb669645076bcd380a352fb23d725 (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 abd9f8b947f8ee5ee8643ea2f2e9821f149f1858
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Sat Nov 24 18:27:34 2012 +0100

    released 3.1

commit 020ed0387e48fedf89224539d10db1bb464bb4a2
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Sat Nov 24 18:22:32 2012 +0100

    revert to use strlen when writing time values.

commit 76c0e3bca289c1001597dd7081e894f860cee0ec
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Sat Nov 24 18:13:29 2012 +0100

    Documented the new functions

commit 99f058ce44b5354d4d44cfae0b9394a36c1fe8f4
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Sat Nov 24 18:07:23 2012 +0100

    bumped version

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

Summary of changes:
 NEWS              |    4 ++--
 configure.ac      |    6 +++---
 doc/Makefile.am   |    6 ++++++
 doc/libtasn1.texi |   12 ++++++++++++
 lib/element.c     |    5 +++--
 lib/libtasn1.h    |    2 +-
 6 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/NEWS b/NEWS
index b2dddec..220afde 100644
--- a/NEWS
+++ b/NEWS
@@ -1,12 +1,12 @@
 GNU Libtasn1 NEWS                                     -*- outline -*-
 
-* Noteworthy changes in release 3.1 (unreleased) [stable]
+* Noteworthy changes in release 3.1 (released 2012-11-24) [stable]
 - Completed rename of types:
   ASN1_ARRAY_TYPE -> asn1_static_node (was asn1_static_node_t)
 - Added new types: VisibleString, NumericString, IA5String, TeletexString,
   PrintableString, UniversalString, BMPString, UTF8String. When re-defined
   a warning is being print instead of failing.
-- Parser outputs more detailed syntax error message.
+- Parser outputs more detailed syntax error messages.
 - Added asn1_decode_simple_der() and asn1_encode_simple_der().
 - Added asn1_read_value_type() to return value and type.
 - Introduced ASN1_ETYPE_UTC_TIME and ASN1_ETYPE_GENERALIZED_TIME
diff --git a/configure.ac b/configure.ac
index 839fc6b..a3d089b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,7 +17,7 @@ dnl Process this file with autoconf to produce a configure script.
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 AC_PREREQ([2.61])
-AC_INIT([GNU Libtasn1],[3.0],[help-libtasn1@gnu.org])
+AC_INIT([GNU Libtasn1],[3.1],[help-libtasn1@gnu.org])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADERS(config.h)
@@ -28,9 +28,9 @@ AM_SILENT_RULES([yes])
 # Interfaces changed/added/removed:   CURRENT++       REVISION=0
 # Interfaces added:                             AGE++
 # Interfaces removed:                           AGE=0
-AC_SUBST(LT_CURRENT, 6)
+AC_SUBST(LT_CURRENT, 7)
 AC_SUBST(LT_REVISION, 0)
-AC_SUBST(LT_AGE, 0)
+AC_SUBST(LT_AGE, 1)
 
 AC_PROG_CC
 gl_EARLY
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 71f4b69..2ede853 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -61,15 +61,18 @@ gdoc_MANS += man/asn1_der_decoding_element.3
 gdoc_MANS += man/asn1_der_decoding_startEnd.3
 gdoc_MANS += man/asn1_expand_any_defined_by.3
 gdoc_MANS += man/asn1_expand_octet_string.3
+gdoc_MANS += man/asn1_decode_simple_der.3
 gdoc_MANS += man/asn1_perror.3
 gdoc_MANS += man/asn1_strerror.3
 gdoc_MANS += man/asn1_find_node.3
 gdoc_MANS += man/asn1_length_der.3
 gdoc_MANS += man/asn1_octet_der.3
+gdoc_MANS += man/asn1_encode_simple_der.3
 gdoc_MANS += man/asn1_bit_der.3
 gdoc_MANS += man/asn1_der_coding.3
 gdoc_MANS += man/asn1_write_value.3
 gdoc_MANS += man/asn1_read_value.3
+gdoc_MANS += man/asn1_read_value_type.3
 gdoc_MANS += man/asn1_read_tag.3
 gdoc_MANS += man/asn1_read_node_value.3
 gdoc_MANS += man/asn1_array2tree.3
@@ -103,15 +106,18 @@ gdoc_TEXINFOS += texi/asn1_der_decoding_element.texi
 gdoc_TEXINFOS += texi/asn1_der_decoding_startEnd.texi
 gdoc_TEXINFOS += texi/asn1_expand_any_defined_by.texi
 gdoc_TEXINFOS += texi/asn1_expand_octet_string.texi
+gdoc_TEXINFOS += texi/asn1_decode_simple_der.texi
 gdoc_TEXINFOS += texi/asn1_perror.texi
 gdoc_TEXINFOS += texi/asn1_strerror.texi
 gdoc_TEXINFOS += texi/asn1_find_node.texi
 gdoc_TEXINFOS += texi/asn1_length_der.texi
 gdoc_TEXINFOS += texi/asn1_octet_der.texi
+gdoc_TEXINFOS += texi/asn1_encode_simple_der.texi
 gdoc_TEXINFOS += texi/asn1_bit_der.texi
 gdoc_TEXINFOS += texi/asn1_der_coding.texi
 gdoc_TEXINFOS += texi/asn1_write_value.texi
 gdoc_TEXINFOS += texi/asn1_read_value.texi
+gdoc_TEXINFOS += texi/asn1_read_value_type.texi
 gdoc_TEXINFOS += texi/asn1_read_tag.texi
 gdoc_TEXINFOS += texi/asn1_read_node_value.texi
 gdoc_TEXINFOS += texi/asn1_array2tree.texi
diff --git a/doc/libtasn1.texi b/doc/libtasn1.texi
index 9ed4d4a..ac2d52c 100644
--- a/doc/libtasn1.texi
+++ b/doc/libtasn1.texi
@@ -112,6 +112,7 @@ POSIX is required.
 @menu
 * ASN.1 syntax::
 * Naming::
+* Simple parsing::
 * Library Notes::
 * Future developments::
 @end menu
@@ -243,6 +244,17 @@ receive the names @code{?1}, @code{?2}, and so on.
 The @code{?LAST} name indicates the last element of a @code{SET OF} or
 @code{SEQUENCE OF}.
 
+@node Simple parsing
+@section Simple parsing
+
+For simple types like @code{OCTET STRING} the simple parsing functions listed
+below may be used instead.
+
+@itemize
+@item @ref{asn1_decode_simple_der}
+@item @ref{asn1_encode_simple_der}
+@end itemize
+
 @node Library Notes
 @section Library Notes
 
diff --git a/lib/element.c b/lib/element.c
index a49758b..763ac58 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -500,6 +500,7 @@ asn1_write_value (asn1_node node_root, const char *name,
       break;
     case ASN1_ETYPE_UTC_TIME:
 	{
+	  len = _asn1_strlen(value);
 	  if (len < 11)
 	    return ASN1_VALUE_NOT_VALID;
 	  for (k = 0; k < 10; k++)
@@ -539,8 +540,8 @@ asn1_write_value (asn1_node node_root, const char *name,
 	}
       break;
     case ASN1_ETYPE_GENERALIZED_TIME:
-      if (value)
-        _asn1_set_value (node, value, len);
+      len = _asn1_strlen(value);
+      _asn1_set_value (node, value, len);
       break;
     case ASN1_ETYPE_OCTET_STRING:
     case ASN1_ETYPE_GENERALSTRING:
diff --git a/lib/libtasn1.h b/lib/libtasn1.h
index 5b50c47..06474f3 100644
--- a/lib/libtasn1.h
+++ b/lib/libtasn1.h
@@ -44,7 +44,7 @@ extern "C"
 {
 #endif
 
-#define ASN1_VERSION "3.0"
+#define ASN1_VERSION "3.1"
 
   /*****************************************/
   /* Errors returned by libtasn1 functions */


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Sat Nov 24 12:32:14 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TcJaQ-0002Mu-IB
	for mharc-libtasn1-commit@gnu.org; Sat, 24 Nov 2012 12:32:14 -0500
Received: from eggs.gnu.org ([208.118.235.92]:58183)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcJaO-0002Lu-ML
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 12:32:13 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcJaN-00057l-5t
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 12:32:12 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:47729)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcJaN-00057g-2X
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 12:32:11 -0500
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcJaM-0003iJ-PO
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 17:32:10 +0000
Date: Sat, 24 Nov 2012 17:32:10 +0000
Message-Id: <E1TcJaM-0003iJ-PO@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 annotated tag, libtasn1_3_1, created. libtasn1_3_1
X-Git-Refname: refs/tags/libtasn1_3_1
X-Git-Reftype: annotated tag
X-Git-Oldrev: 0000000000000000000000000000000000000000
X-Git-Newrev: 40769ab236263c359498872ecf385f16bf004db5
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 24 Nov 2012 17:32:14 -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=40769ab236263c359498872ecf385f16bf004db5

The annotated tag, libtasn1_3_1 has been created
        at  40769ab236263c359498872ecf385f16bf004db5 (tag)
   tagging  abd9f8b947f8ee5ee8643ea2f2e9821f149f1858 (commit)
  replaces  libtasn1_3_0
 tagged by  Nikos Mavrogiannopoulos
        on  Sat Nov 24 18:27:43 2012 +0100

- Log -----------------------------------------------------------------
released 3.1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQEcBAABAgAGBQJQsQOSAAoJEJ1eqvaQE7hCX9EIAKEC58Lrie/qrl4VBGR8hhEH
YUi8tOSunBkdBacUMTBL0UFzR7vY9eHqmyqwCJfX+XNJ8pdhmVUgDjT+5agaBWkA
yrerO3D1w3bEU46u183w0t5RncjhHisVyrR7F8C14W3iR6KcZnjzNAoEnaS/txtj
/l+j+sSG1fVApr2xgNKgB4YrY35YWot3sokOuCJrCV/VgrxKF0kZObTIdL+CIqxM
0Tho9dbJRb82tEblQp8XO/QhClqcE5C6l/ZntF+Aqs09xfphOJfbd4U/2/1EwFyO
XauX5TsepxFm1o1LKHih9oBlwE6BDq+zfRnbgE0s9QRfJ5MBASQQ3r7R62k86ug=
=HV3M
-----END PGP SIGNATURE-----

Ivan Shmakov (2):
      Typographical and wording fixes to doc/libtasn1.texi
      use stderr for status messages in asn1{Coding, Decoding, Parser}

Nikos Mavrogiannopoulos (32):
      Corrected type asn1_static_node_t -> asn1_static_node.
      Check for errors reading the assignment file in asn1Coding.
      Added more ASN.1 string types and several simplifications.
      idented code
      indented C code in ASN1.y, and added more verbose error reporting.
      documented updates
      small simplifications
      better name
      updated
      use const for the data
      documented new types
      store duplicate (with built-in values) in structure to be compatible with old version.
      init strings
      better error printing
      updated generated structures
      zeroize last_error_token on unknown errors.
      Added asn1_decode_string_der() and asn1_encode_string_der().
      renamed types
      simplified and renamed asn1_encode_string_der() and asn1_decode_string_der()
      Added asn1_read_value_type().
      updates in ETYPE_OK
      Introduced ASN1_ETYPE_UTC_TIME and ASN1_ETYPE_GENERALIZED_TIME
      some simplifications in time handling
      better error reporting
      corrected typo
      simplified
      simplified
      corrected compatibility mode with old structures.
      bumped version
      Documented the new functions
      revert to use strlen when writing time values.
      released 3.1

Simon Josefsson (3):
      Generated.
      Don't overload the 'time' global name.
      Ignore more.

Thierry Reding (2):
      Fix bootstrap with automake 1.12
      Fix out of tree build

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


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Sat Nov 24 12:45:08 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TcJmu-0005D1-3g
	for mharc-libtasn1-commit@gnu.org; Sat, 24 Nov 2012 12:45:08 -0500
Received: from eggs.gnu.org ([208.118.235.92]:54149)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcJmr-0005B7-61
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 12:45:06 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcJmq-00010F-2O
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 12:45:05 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:41661)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcJmp-0000zT-Uj
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 12:45:03 -0500
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TcJmp-0004W8-9m
	for libtasn1-commit@gnu.org; Sat, 24 Nov 2012 17:45:03 +0000
Date: Sat, 24 Nov 2012 17:45:03 +0000
Message-Id: <E1TcJmp-0004W8-9m@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_1-1-g0ffd9af
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: abd9f8b947f8ee5ee8643ea2f2e9821f149f1858
X-Git-Newrev: 0ffd9af63f06998f76c6ef014fb2ebbfbe69c33a
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 24 Nov 2012 17:45:06 -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=0ffd9af63f06998f76c6ef014fb2ebbfbe69c33a

The branch, master has been updated
       via  0ffd9af63f06998f76c6ef014fb2ebbfbe69c33a (commit)
      from  abd9f8b947f8ee5ee8643ea2f2e9821f149f1858 (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 0ffd9af63f06998f76c6ef014fb2ebbfbe69c33a
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Sat Nov 24 18:40:48 2012 +0100

    updated

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

Summary of changes:
 doc/libtasn1.texi |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/doc/libtasn1.texi b/doc/libtasn1.texi
index ac2d52c..5ef2cdb 100644
--- a/doc/libtasn1.texi
+++ b/doc/libtasn1.texi
@@ -37,7 +37,8 @@ Documentation License''.
 @subtitle Abstract Syntax Notation One (ASN.1) library for the GNU system
 @subtitle for version @value{VERSION}, @value{UPDATED}
 @author Fabio Fiorina
-@author Simon Josefsson (@email{help-libtasn1@@gnu.org})
+@author Simon Josefsson
+@author Nikos Mavrogiannopoulos (@email{help-libtasn1@@gnu.org})
 @page
 @vskip 0pt plus 1filll
 @insertcopying


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Sun Nov 25 08:16:39 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Tcc4d-00035a-Qw
	for mharc-libtasn1-commit@gnu.org; Sun, 25 Nov 2012 08:16:39 -0500
Received: from eggs.gnu.org ([208.118.235.92]:52924)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Tcc4a-00035I-Hl
	for libtasn1-commit@gnu.org; Sun, 25 Nov 2012 08:16:37 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Tcc4Z-0001aB-5h
	for libtasn1-commit@gnu.org; Sun, 25 Nov 2012 08:16:36 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:39014)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Tcc4Z-0001a7-32
	for libtasn1-commit@gnu.org; Sun, 25 Nov 2012 08:16:35 -0500
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Tcc4Y-0001BR-CU
	for libtasn1-commit@gnu.org; Sun, 25 Nov 2012 13:16:34 +0000
Date: Sun, 25 Nov 2012 13:16:34 +0000
Message-Id: <E1Tcc4Y-0001BR-CU@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_1-2-gaa6e97f
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 0ffd9af63f06998f76c6ef014fb2ebbfbe69c33a
X-Git-Newrev: aa6e97f68d6c8d06f531d9b6bb462dc1c0720f77
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 25 Nov 2012 13:16:38 -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=aa6e97f68d6c8d06f531d9b6bb462dc1c0720f77

The branch, master has been updated
       via  aa6e97f68d6c8d06f531d9b6bb462dc1c0720f77 (commit)
      from  0ffd9af63f06998f76c6ef014fb2ebbfbe69c33a (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 aa6e97f68d6c8d06f531d9b6bb462dc1c0720f77
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Sun Nov 25 14:16:24 2012 +0100

    corrected possible buffer overflow in parser errors.

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

Summary of changes:
 lib/ASN1.c |    6 +++---
 lib/ASN1.y |    6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/ASN1.c b/lib/ASN1.c
index 2a60527..df6fb64 100644
--- a/lib/ASN1.c
+++ b/lib/ASN1.c
@@ -119,7 +119,7 @@ static unsigned int line_number;	/* line number describing the
 					   parser position inside the
 					   file */
 static char last_error[ASN1_MAX_ERROR_DESCRIPTION_SIZE] = "";
-static char last_error_token[ASN1_MAX_NAME_SIZE+1] = ""; /* used when expected errors occur */
+static char last_error_token[ASN1_MAX_ERROR_DESCRIPTION_SIZE+1] = ""; /* used when expected errors occur */
 static char last_token[ASN1_MAX_NAME_SIZE+1] = ""; /* last token find in the file
 					   to parse before the 'parse
 					   error' */
@@ -3283,7 +3283,7 @@ _asn1_yyerror (const char *s)
       strcmp (last_token, "TeletexString") == 0 ||
       strcmp (last_token, "BMPString") == 0)
     {
-      snprintf (last_error_token, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
+      snprintf (last_error_token, sizeof(last_error_token),
                 "%s", last_token);
       fprintf(stderr, 
                "%s:%u: Warning: %s is a built-in ASN.1 type.\n",
@@ -3294,7 +3294,7 @@ _asn1_yyerror (const char *s)
 
   if (result_parse != ASN1_NAME_TOO_LONG)
     {
-      snprintf (last_error, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
+      snprintf (last_error, sizeof(last_error),
                 "%s:%u: Error: %s near '%s'", file_name,
                 line_number, s, last_token);
       result_parse = ASN1_SYNTAX_ERROR;
diff --git a/lib/ASN1.y b/lib/ASN1.y
index 874eb13..e0add54 100644
--- a/lib/ASN1.y
+++ b/lib/ASN1.y
@@ -42,7 +42,7 @@ static unsigned int line_number;	/* line number describing the
 					   parser position inside the
 					   file */
 static char last_error[ASN1_MAX_ERROR_DESCRIPTION_SIZE] = "";
-static char last_error_token[ASN1_MAX_NAME_SIZE+1] = ""; /* used when expected errors occur */
+static char last_error_token[ASN1_MAX_ERROR_DESCRIPTION_SIZE+1] = ""; /* used when expected errors occur */
 static char last_token[ASN1_MAX_NAME_SIZE+1] = ""; /* last token find in the file
 					   to parse before the 'parse
 					   error' */
@@ -869,7 +869,7 @@ _asn1_yyerror (const char *s)
       strcmp (last_token, "TeletexString") == 0 ||
       strcmp (last_token, "BMPString") == 0)
     {
-      snprintf (last_error_token, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
+      snprintf (last_error_token, sizeof(last_error_token),
                 "%s", last_token);
       fprintf(stderr, 
                "%s:%u: Warning: %s is a built-in ASN.1 type.\n",
@@ -880,7 +880,7 @@ _asn1_yyerror (const char *s)
 
   if (result_parse != ASN1_NAME_TOO_LONG)
     {
-      snprintf (last_error, ASN1_MAX_ERROR_DESCRIPTION_SIZE,
+      snprintf (last_error, sizeof(last_error),
                 "%s:%u: Error: %s near '%s'", file_name,
                 line_number, s, last_token);
       result_parse = ASN1_SYNTAX_ERROR;


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Fri Nov 30 05:15:48 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TeNdL-0001lo-Q8
	for mharc-libtasn1-commit@gnu.org; Fri, 30 Nov 2012 05:15:47 -0500
Received: from eggs.gnu.org ([208.118.235.92]:48885)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TeNdH-0001lN-Or
	for libtasn1-commit@gnu.org; Fri, 30 Nov 2012 05:15:46 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TeNdB-0007Xl-9V
	for libtasn1-commit@gnu.org; Fri, 30 Nov 2012 05:15:43 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:48239)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TeNdB-0007Xh-5b
	for libtasn1-commit@gnu.org; Fri, 30 Nov 2012 05:15:37 -0500
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TeNdA-0003pg-JF
	for libtasn1-commit@gnu.org; Fri, 30 Nov 2012 10:15:36 +0000
Date: Fri, 30 Nov 2012 10:15:36 +0000
Message-Id: <E1TeNdA-0003pg-JF@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_3_1-5-gaf362a4
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: aa6e97f68d6c8d06f531d9b6bb462dc1c0720f77
X-Git-Newrev: af362a497f70b680a39a15cb719dd6b846b32d34
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 30 Nov 2012 10:15:46 -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=af362a497f70b680a39a15cb719dd6b846b32d34

The branch, master has been updated
       via  af362a497f70b680a39a15cb719dd6b846b32d34 (commit)
       via  bda1eb5ad6fd0a8ad593abc772e3e447fd75309f (commit)
       via  6ac65bdf6fb21eea71fba8447c6ed62593432f84 (commit)
      from  aa6e97f68d6c8d06f531d9b6bb462dc1c0720f77 (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 af362a497f70b680a39a15cb719dd6b846b32d34
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Fri Nov 30 11:15:15 2012 +0100

    released

commit bda1eb5ad6fd0a8ad593abc772e3e447fd75309f
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Thu Nov 29 19:00:24 2012 +0100

    bumped version

commit 6ac65bdf6fb21eea71fba8447c6ed62593432f84
Author: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date:   Sun Nov 25 14:22:57 2012 +0100

    documented update

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

Summary of changes:
 NEWS           |    4 ++++
 configure.ac   |    4 ++--
 lib/libtasn1.h |    2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 220afde..6fa0d12 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,9 @@
 GNU Libtasn1 NEWS                                     -*- outline -*-
 
+* Noteworthy changes in release 3.2 (released 2012-11-30) [stable]
+- Corrected buffer overflow in the error reporting of the parser (reported
+by Andreas Metzler).
+
 * Noteworthy changes in release 3.1 (released 2012-11-24) [stable]
 - Completed rename of types:
   ASN1_ARRAY_TYPE -> asn1_static_node (was asn1_static_node_t)
diff --git a/configure.ac b/configure.ac
index a3d089b..a49dccd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,7 +17,7 @@ dnl Process this file with autoconf to produce a configure script.
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 AC_PREREQ([2.61])
-AC_INIT([GNU Libtasn1],[3.1],[help-libtasn1@gnu.org])
+AC_INIT([GNU Libtasn1],[3.2],[help-libtasn1@gnu.org])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADERS(config.h)
@@ -29,7 +29,7 @@ AM_SILENT_RULES([yes])
 # Interfaces added:                             AGE++
 # Interfaces removed:                           AGE=0
 AC_SUBST(LT_CURRENT, 7)
-AC_SUBST(LT_REVISION, 0)
+AC_SUBST(LT_REVISION, 1)
 AC_SUBST(LT_AGE, 1)
 
 AC_PROG_CC
diff --git a/lib/libtasn1.h b/lib/libtasn1.h
index 06474f3..c296198 100644
--- a/lib/libtasn1.h
+++ b/lib/libtasn1.h
@@ -44,7 +44,7 @@ extern "C"
 {
 #endif
 
-#define ASN1_VERSION "3.1"
+#define ASN1_VERSION "3.2"
 
   /*****************************************/
   /* Errors returned by libtasn1 functions */


hooks/post-receive
-- 
GNU libtasn1


From MAILER-DAEMON Fri Nov 30 05:15:48 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1TeNdM-0001m0-Ts
	for mharc-libtasn1-commit@gnu.org; Fri, 30 Nov 2012 05:15:48 -0500
Received: from eggs.gnu.org ([208.118.235.92]:48910)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TeNdK-0001lY-Hn
	for libtasn1-commit@gnu.org; Fri, 30 Nov 2012 05:15:47 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TeNdI-0007YV-79
	for libtasn1-commit@gnu.org; Fri, 30 Nov 2012 05:15:46 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:48252)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TeNdI-0007YR-3r
	for libtasn1-commit@gnu.org; Fri, 30 Nov 2012 05:15:44 -0500
Received: from nmav by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1TeNdH-0003qn-RT
	for libtasn1-commit@gnu.org; Fri, 30 Nov 2012 10:15:43 +0000
Date: Fri, 30 Nov 2012 10:15:43 +0000
Message-Id: <E1TeNdH-0003qn-RT@vcs.savannah.gnu.org>
From: "Nikos Mavrogiannopoulos" <nmav@gnutls.org>
To: libtasn1-commit@gnu.org
Subject: [SCM] GNU libtasn1 annotated tag, libtasn1_3_2, created. libtasn1_3_2
X-Git-Refname: refs/tags/libtasn1_3_2
X-Git-Reftype: annotated tag
X-Git-Oldrev: 0000000000000000000000000000000000000000
X-Git-Newrev: 15cdfbe5ed220cd246a02c464087cccd144a93a4
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 140.186.70.72
X-BeenThere: libtasn1-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit messages for GNU Libtasn1 <libtasn1-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/libtasn1-commit>
List-Post: <mailto:libtasn1-commit@gnu.org>
List-Help: <mailto:libtasn1-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/libtasn1-commit>,
	<mailto:libtasn1-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 30 Nov 2012 10:15:47 -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=15cdfbe5ed220cd246a02c464087cccd144a93a4

The annotated tag, libtasn1_3_2 has been created
        at  15cdfbe5ed220cd246a02c464087cccd144a93a4 (tag)
   tagging  af362a497f70b680a39a15cb719dd6b846b32d34 (commit)
  replaces  libtasn1_3_1
 tagged by  Nikos Mavrogiannopoulos
        on  Fri Nov 30 11:15:23 2012 +0100

- Log -----------------------------------------------------------------
released 3.2
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQEcBAABAgAGBQJQuIc7AAoJEJ1eqvaQE7hCIqcH/AoEmFjMFOPJTfHVPJkJnbwn
8H1Ao733guY4QEDhho7qhOrtO9/P1U/hD3dcIQBfZdNN2jiybrMgbis/S5piaf0s
dfnQoa7nlU+evz/l1qYrW35XWcuxkjsy738KUQoTneZWfO2pJKv5IapdUb/hyKF2
uORuf5pmHn5ROEoQEJP/Z5cbeexhrSSuk9SKrKXtvR8lYpKV2jnNVVEMrh3fXWVO
rCTh5hxirLjMABAB4O7NdTiWUrSXm+2Qk9XCbyqvXvJcEKlA6oW+M2s/P8AnILpt
EvXxg8bjMLt3yrMlU7ryZZjNaz9M3Tde1ESdgUj0HOHBSoy9RDYVX5oYC4e2Gf0=
=s+lQ
-----END PGP SIGNATURE-----

Nikos Mavrogiannopoulos (5):
      updated
      corrected possible buffer overflow in parser errors.
      documented update
      bumped version
      released

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


hooks/post-receive
-- 
GNU libtasn1


