libtasn1-commit
[Top][All Lists]
Advanced

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

[SCM] GNU libtasn1 branch, master, updated. libtasn1_2_13-21-g95da366


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_2_13-21-g95da366
Date: Thu, 13 Sep 2012 20:20:20 +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=95da3661c7e758352893636508d776652aa5a991

The branch, master has been updated
       via  95da3661c7e758352893636508d776652aa5a991 (commit)
       via  3a85aab40b2a866b8ba7d0b32c74e4f3fe13ba7e (commit)
       via  4b8b8ccb3e96c4de1409f9ce701b870a53a2b720 (commit)
       via  94976d02fb6f3205ae2a05dfa6069bedfe1b547a (commit)
       via  580e59b33c1db66523210406fa3d9d0e0733013d (commit)
      from  55f4c0daccdc4db3cd8c1e6dc90291bd265a6f54 (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 95da3661c7e758352893636508d776652aa5a991
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Sep 13 21:38:49 2012 +0200

    _asn1_add_node_only -> _asn1_add_single_node

commit 3a85aab40b2a866b8ba7d0b32c74e4f3fe13ba7e
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Sep 13 21:34:46 2012 +0200

    _asn1_add_node -> _asn1_add_static_node

commit 4b8b8ccb3e96c4de1409f9ce701b870a53a2b720
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Sep 13 21:30:33 2012 +0200

    Eliminated _asn1_malloc, _asn1_free and _asn_calloc.

commit 94976d02fb6f3205ae2a05dfa6069bedfe1b547a
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Sep 13 21:11:19 2012 +0200

    reduced maximum name size

commit 580e59b33c1db66523210406fa3d9d0e0733013d
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Sep 13 21:10:35 2012 +0200

    no need to reserve.

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

Summary of changes:
 lib/ASN1.c       |   96 +++++++++++++++++++++++++-------------------------
 lib/ASN1.y       |  104 +++++++++++++++++++++++++++---------------------------
 lib/coding.c     |   20 +++++-----
 lib/element.c    |   32 +++++++----------
 lib/int.h        |    5 ---
 lib/libtasn1.h   |    3 +-
 lib/parser_aux.c |   32 ++++++++--------
 lib/parser_aux.h |    2 +-
 lib/structure.c  |   28 +++++++--------
 lib/structure.h  |    2 +-
 10 files changed, 155 insertions(+), 169 deletions(-)

diff --git a/lib/ASN1.c b/lib/ASN1.c
index d9b9133..5289e6a 100644
--- a/lib/ASN1.c
+++ b/lib/ASN1.c
@@ -1669,7 +1669,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 121 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_DEFINITIONS|(yyvsp[(3) - (8)].constant));
+    {(yyval.node)=_asn1_add_static_node(TYPE_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));
@@ -1747,7 +1747,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 151 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_CONSTANT);
+    {(yyval.node)=_asn1_add_static_node(TYPE_CONSTANT);
                                        _asn1_set_value((yyval.node),(yyvsp[(2) 
- (3)].str),strlen((yyvsp[(2) - (3)].str))+1);}
     break;
 
@@ -1755,7 +1755,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 153 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_CONSTANT);
+    {(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);}
     break;
@@ -1779,7 +1779,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 163 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_CONSTANT);
+    {(yyval.node)=_asn1_add_static_node(TYPE_CONSTANT);
                                    _asn1_set_value((yyval.node),(yyvsp[(1) - 
(1)].str),strlen((yyvsp[(1) - (1)].str))+1);}
     break;
 
@@ -1787,7 +1787,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 165 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_CONSTANT);
+    {(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);}
     break;
@@ -1832,7 +1832,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 180 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_TAG);
+    {(yyval.node)=_asn1_add_static_node(TYPE_TAG);
                             _asn1_set_value((yyval.node),(yyvsp[(2) - 
(3)].str),strlen((yyvsp[(2) - (3)].str))+1);}
     break;
 
@@ -1840,7 +1840,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 182 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_TAG | (yyvsp[(2) - (4)].constant));
+    {(yyval.node)=_asn1_add_static_node(TYPE_TAG | (yyvsp[(2) - 
(4)].constant));
                                 _asn1_set_value((yyval.node),(yyvsp[(3) - 
(4)].str),strlen((yyvsp[(3) - (4)].str))+1);}
     break;
 
@@ -1869,7 +1869,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 191 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_DEFAULT);
+    {(yyval.node)=_asn1_add_static_node(TYPE_DEFAULT);
                                        _asn1_set_value((yyval.node),(yyvsp[(2) 
- (2)].str),strlen((yyvsp[(2) - (2)].str))+1);}
     break;
 
@@ -1877,28 +1877,28 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 193 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_DEFAULT|CONST_TRUE);}
+    {(yyval.node)=_asn1_add_static_node(TYPE_DEFAULT|CONST_TRUE);}
     break;
 
   case 30:
 
 /* Line 1806 of yacc.c  */
 #line 194 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_DEFAULT|CONST_FALSE);}
+    {(yyval.node)=_asn1_add_static_node(TYPE_DEFAULT|CONST_FALSE);}
     break;
 
   case 33:
 
 /* Line 1806 of yacc.c  */
 #line 203 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_INTEGER);}
+    {(yyval.node)=_asn1_add_static_node(TYPE_INTEGER);}
     break;
 
   case 34:
 
 /* Line 1806 of yacc.c  */
 #line 204 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_INTEGER|CONST_LIST);
+    {(yyval.node)=_asn1_add_static_node(TYPE_INTEGER|CONST_LIST);
                                         _asn1_set_down((yyval.node),(yyvsp[(3) 
- (4)].node));}
     break;
 
@@ -1906,15 +1906,15 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 206 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_INTEGER);}
+    {(yyval.node)=_asn1_add_static_node(TYPE_INTEGER);}
     break;
 
   case 36:
 
 /* Line 1806 of yacc.c  */
 #line 208 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_INTEGER|CONST_MIN_MAX);
-                                         
_asn1_set_down((yyval.node),_asn1_add_node(TYPE_SIZE));
+    {(yyval.node)=_asn1_add_static_node(TYPE_INTEGER|CONST_MIN_MAX);
+                                         
_asn1_set_down((yyval.node),_asn1_add_static_node(TYPE_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;
@@ -1923,28 +1923,28 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 214 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_BOOLEAN);}
+    {(yyval.node)=_asn1_add_static_node(TYPE_BOOLEAN);}
     break;
 
   case 38:
 
 /* Line 1806 of yacc.c  */
 #line 217 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_TIME|CONST_UTC);}
+    {(yyval.node)=_asn1_add_static_node(TYPE_TIME|CONST_UTC);}
     break;
 
   case 39:
 
 /* Line 1806 of yacc.c  */
 #line 218 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_TIME|CONST_GENERALIZED);}
+    {(yyval.node)=_asn1_add_static_node(TYPE_TIME|CONST_GENERALIZED);}
     break;
 
   case 40:
 
 /* Line 1806 of yacc.c  */
 #line 221 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_SIZE|CONST_1_PARAM);
+    {(yyval.node)=_asn1_add_static_node(TYPE_SIZE|CONST_1_PARAM);
                                      _asn1_set_value((yyval.node),(yyvsp[(3) - 
(4)].str),strlen((yyvsp[(3) - (4)].str))+1);}
     break;
 
@@ -1952,7 +1952,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 224 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_SIZE|CONST_MIN_MAX);
+    {(yyval.node)=_asn1_add_static_node(TYPE_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;
@@ -1975,14 +1975,14 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 233 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_GENERALSTRING);}
+    {(yyval.node)=_asn1_add_static_node(TYPE_GENERALSTRING);}
     break;
 
   case 45:
 
 /* Line 1806 of yacc.c  */
 #line 234 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_GENERALSTRING|CONST_SIZE);
+    {(yyval.node)=_asn1_add_static_node(TYPE_GENERALSTRING|CONST_SIZE);
                                          
_asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
     break;
 
@@ -1990,14 +1990,14 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 238 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_OCTET_STRING);}
+    {(yyval.node)=_asn1_add_static_node(TYPE_OCTET_STRING);}
     break;
 
   case 47:
 
 /* Line 1806 of yacc.c  */
 #line 239 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_OCTET_STRING|CONST_SIZE);
+    {(yyval.node)=_asn1_add_static_node(TYPE_OCTET_STRING|CONST_SIZE);
                                            
_asn1_set_down((yyval.node),(yyvsp[(3) - (3)].node));}
     break;
 
@@ -2005,7 +2005,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 243 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_CONSTANT);
+    {(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);}
     break;
@@ -2029,21 +2029,21 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 253 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_BIT_STRING);}
+    {(yyval.node)=_asn1_add_static_node(TYPE_BIT_STRING);}
     break;
 
   case 52:
 
 /* Line 1806 of yacc.c  */
 #line 254 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_BIT_STRING|CONST_SIZE);}
+    {(yyval.node)=_asn1_add_static_node(TYPE_BIT_STRING|CONST_SIZE);}
     break;
 
   case 53:
 
 /* Line 1806 of yacc.c  */
 #line 256 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_BIT_STRING|CONST_LIST);
+    {(yyval.node)=_asn1_add_static_node(TYPE_BIT_STRING|CONST_LIST);
                                 _asn1_set_down((yyval.node),(yyvsp[(4) - 
(5)].node));}
     break;
 
@@ -2051,7 +2051,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 261 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_ENUMERATED|CONST_LIST);
+    {(yyval.node)=_asn1_add_static_node(TYPE_ENUMERATED|CONST_LIST);
                                 _asn1_set_down((yyval.node),(yyvsp[(3) - 
(4)].node));}
     break;
 
@@ -2059,14 +2059,14 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 266 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_OBJECT_ID);}
+    {(yyval.node)=_asn1_add_static_node(TYPE_OBJECT_ID);}
     break;
 
   case 56:
 
 /* Line 1806 of yacc.c  */
 #line 269 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_IDENTIFIER);
+    {(yyval.node)=_asn1_add_static_node(TYPE_IDENTIFIER);
                                        _asn1_set_value((yyval.node),(yyvsp[(1) 
- (1)].str),strlen((yyvsp[(1) - (1)].str))+1);}
     break;
 
@@ -2074,7 +2074,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 271 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_IDENTIFIER|CONST_SIZE);
+    {(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));}
     break;
@@ -2160,7 +2160,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 286 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_NULL);}
+    {(yyval.node)=_asn1_add_static_node(TYPE_NULL);}
     break;
 
   case 71:
@@ -2228,7 +2228,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 310 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_SEQUENCE);
+    {(yyval.node)=_asn1_add_static_node(TYPE_SEQUENCE);
                                               
_asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
     break;
 
@@ -2236,7 +2236,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 312 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_SEQUENCE_OF);
+    {(yyval.node)=_asn1_add_static_node(TYPE_SEQUENCE_OF);
                                               
_asn1_set_down((yyval.node),(yyvsp[(3) - (3)].node));}
     break;
 
@@ -2244,7 +2244,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 314 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_SEQUENCE_OF|CONST_SIZE);
+    {(yyval.node)=_asn1_add_static_node(TYPE_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;
@@ -2253,7 +2253,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 319 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_SET);
+    {(yyval.node)=_asn1_add_static_node(TYPE_SET);
                                      _asn1_set_down((yyval.node),(yyvsp[(3) - 
(4)].node));}
     break;
 
@@ -2261,7 +2261,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 321 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_SET_OF);
+    {(yyval.node)=_asn1_add_static_node(TYPE_SET_OF);
                                      _asn1_set_down((yyval.node),(yyvsp[(3) - 
(3)].node));}
     break;
 
@@ -2269,7 +2269,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 323 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_SET_OF|CONST_SIZE);
+    {(yyval.node)=_asn1_add_static_node(TYPE_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;
@@ -2278,7 +2278,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 328 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_CHOICE);
+    {(yyval.node)=_asn1_add_static_node(TYPE_CHOICE);
                                              
_asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
     break;
 
@@ -2286,15 +2286,15 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 332 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_ANY);}
+    {(yyval.node)=_asn1_add_static_node(TYPE_ANY);}
     break;
 
   case 87:
 
 /* Line 1806 of yacc.c  */
 #line 333 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_ANY|CONST_DEFINED_BY);
-                                        
_asn1_set_down((yyval.node),_asn1_add_node(TYPE_CONSTANT));
+    {(yyval.node)=_asn1_add_static_node(TYPE_ANY|CONST_DEFINED_BY);
+                                        
_asn1_set_down((yyval.node),_asn1_add_static_node(TYPE_CONSTANT));
                                        
_asn1_set_name(_asn1_get_down((yyval.node)),(yyvsp[(4) - (4)].str));}
     break;
 
@@ -2309,7 +2309,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 342 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_OBJECT_ID|CONST_ASSIGN);
+    {(yyval.node)=_asn1_add_static_node(TYPE_OBJECT_ID|CONST_ASSIGN);
                          _asn1_set_name((yyval.node),(yyvsp[(1) - (7)].str));
                          _asn1_set_down((yyval.node),(yyvsp[(6) - (7)].node));}
     break;
@@ -2318,7 +2318,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 346 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_OBJECT_ID|CONST_ASSIGN|CONST_1_PARAM);
+    
{(yyval.node)=_asn1_add_static_node(TYPE_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));}
@@ -2328,7 +2328,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 351 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_INTEGER|CONST_ASSIGN);
+    {(yyval.node)=_asn1_add_static_node(TYPE_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;
@@ -2366,7 +2366,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 365 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_OBJECT_ID);
+    {(yyval.node)=_asn1_add_static_node(TYPE_OBJECT_ID);
                                                           
_asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));
                                                           
_asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str));}
     break;
@@ -2375,7 +2375,7 @@ yyreduce:
 
 /* Line 1806 of yacc.c  */
 #line 368 "ASN1.y"
-    {(yyval.node)=_asn1_add_node(TYPE_OBJECT_ID);
+    {(yyval.node)=_asn1_add_static_node(TYPE_OBJECT_ID);
                                                           
_asn1_set_name((yyval.node),(yyvsp[(1) - (3)].str));}
     break;
 
diff --git a/lib/ASN1.y b/lib/ASN1.y
index 80a68cc..0611e85 100644
--- a/lib/ASN1.y
+++ b/lib/ASN1.y
@@ -118,7 +118,7 @@ static int _asn1_yylex(void);
 definitions:   definitions_id
                DEFINITIONS explicit_implicit TAGS "::=" BEGIN  /* imports_def 
*/
                type_constant_list END
-                   {$$=_asn1_add_node(TYPE_DEFINITIONS|$3);
+                   {$$=_asn1_add_static_node(TYPE_DEFINITIONS|$3);
                     _asn1_set_name($$,_asn1_get_name($1));
                     _asn1_set_name($1,"");
                     _asn1_set_right($1,$7);
@@ -148,9 +148,9 @@ pos_neg_identifier :  pos_neg_num    {strcpy($$,$1);}
                     | IDENTIFIER     {strcpy($$,$1);}
 ;
 
-constant: '(' pos_neg_num ')'         {$$=_asn1_add_node(TYPE_CONSTANT);
+constant: '(' pos_neg_num ')'         {$$=_asn1_add_static_node(TYPE_CONSTANT);
                                        _asn1_set_value($$,$2,strlen($2)+1);}
-        | IDENTIFIER'('pos_neg_num')' {$$=_asn1_add_node(TYPE_CONSTANT);
+        | IDENTIFIER'('pos_neg_num')' {$$=_asn1_add_static_node(TYPE_CONSTANT);
                                       _asn1_set_name($$,$1);
                                        _asn1_set_value($$,$3,strlen($3)+1);}
 ;
@@ -160,9 +160,9 @@ constant_list:  constant                   {$$=$1;}
                                             
_asn1_set_right(_asn1_get_last_right($1),$3);}
 ;
 
-obj_constant:  num_identifier     {$$=_asn1_add_node(TYPE_CONSTANT);
+obj_constant:  num_identifier     {$$=_asn1_add_static_node(TYPE_CONSTANT);
                                    _asn1_set_value($$,$1,strlen($1)+1);}
-             | IDENTIFIER'('NUM')' {$$=_asn1_add_node(TYPE_CONSTANT);
+             | IDENTIFIER'('NUM')' {$$=_asn1_add_static_node(TYPE_CONSTANT);
                                    _asn1_set_name($$,$1);
                                     _asn1_set_value($$,$3,strlen($3)+1);}
 ;
@@ -177,9 +177,9 @@ class :  UNIVERSAL    {$$=CONST_UNIVERSAL;}
        | APPLICATION  {$$=CONST_APPLICATION;}
 ;
 
-tag_type :  '[' NUM ']'    {$$=_asn1_add_node(TYPE_TAG);
+tag_type :  '[' NUM ']'    {$$=_asn1_add_static_node(TYPE_TAG);
                             _asn1_set_value($$,$2,strlen($2)+1);}
-          | '[' class NUM ']'  {$$=_asn1_add_node(TYPE_TAG | $2);
+          | '[' class NUM ']'  {$$=_asn1_add_static_node(TYPE_TAG | $2);
                                 _asn1_set_value($$,$3,strlen($3)+1);}
 ;
 
@@ -188,10 +188,10 @@ tag :  tag_type           {$$=$1;}
      | tag_type IMPLICIT  {$$=_asn1_mod_type($1,CONST_IMPLICIT);}
 ;
 
-default :  DEFAULT pos_neg_identifier {$$=_asn1_add_node(TYPE_DEFAULT);
+default :  DEFAULT pos_neg_identifier {$$=_asn1_add_static_node(TYPE_DEFAULT);
                                        _asn1_set_value($$,$2,strlen($2)+1);}
-         | DEFAULT ASN1_TRUE           
{$$=_asn1_add_node(TYPE_DEFAULT|CONST_TRUE);}
-         | DEFAULT ASN1_FALSE          
{$$=_asn1_add_node(TYPE_DEFAULT|CONST_FALSE);}
+         | DEFAULT ASN1_TRUE           
{$$=_asn1_add_static_node(TYPE_DEFAULT|CONST_TRUE);}
+         | DEFAULT ASN1_FALSE          
{$$=_asn1_add_static_node(TYPE_DEFAULT|CONST_FALSE);}
 ;
 
 
@@ -200,28 +200,28 @@ pos_neg_list:  pos_neg_num
 ;
 
 
-integer_def: INTEGER                    {$$=_asn1_add_node(TYPE_INTEGER);}
-           | INTEGER'{'constant_list'}' 
{$$=_asn1_add_node(TYPE_INTEGER|CONST_LIST);
+integer_def: INTEGER                    
{$$=_asn1_add_static_node(TYPE_INTEGER);}
+           | INTEGER'{'constant_list'}' 
{$$=_asn1_add_static_node(TYPE_INTEGER|CONST_LIST);
                                         _asn1_set_down($$,$3);}
-           | integer_def'(' pos_neg_list ')' {$$=_asn1_add_node(TYPE_INTEGER);}
+           | integer_def'(' pos_neg_list ')' 
{$$=_asn1_add_static_node(TYPE_INTEGER);}
            | integer_def'('num_identifier'.''.'num_identifier')'
-                                        
{$$=_asn1_add_node(TYPE_INTEGER|CONST_MIN_MAX);
-                                         
_asn1_set_down($$,_asn1_add_node(TYPE_SIZE));
+                                        
{$$=_asn1_add_static_node(TYPE_INTEGER|CONST_MIN_MAX);
+                                         
_asn1_set_down($$,_asn1_add_static_node(TYPE_SIZE));
                                          
_asn1_set_value(_asn1_get_down($$),$6,strlen($6)+1);
                                          
_asn1_set_name(_asn1_get_down($$),$3);}
 ;
 
-boolean_def: BOOLEAN   {$$=_asn1_add_node(TYPE_BOOLEAN);}
+boolean_def: BOOLEAN   {$$=_asn1_add_static_node(TYPE_BOOLEAN);}
 ;
 
-Time:   UTCTime          {$$=_asn1_add_node(TYPE_TIME|CONST_UTC);}
-      | GeneralizedTime  {$$=_asn1_add_node(TYPE_TIME|CONST_GENERALIZED);}
+Time:   UTCTime          {$$=_asn1_add_static_node(TYPE_TIME|CONST_UTC);}
+      | GeneralizedTime  
{$$=_asn1_add_static_node(TYPE_TIME|CONST_GENERALIZED);}
 ;
 
-size_def2: SIZE'('num_identifier')'  
{$$=_asn1_add_node(TYPE_SIZE|CONST_1_PARAM);
+size_def2: SIZE'('num_identifier')'  
{$$=_asn1_add_static_node(TYPE_SIZE|CONST_1_PARAM);
                                      _asn1_set_value($$,$3,strlen($3)+1);}
         | SIZE'('num_identifier'.''.'num_identifier')'
-                                     
{$$=_asn1_add_node(TYPE_SIZE|CONST_MIN_MAX);
+                                     
{$$=_asn1_add_static_node(TYPE_SIZE|CONST_MIN_MAX);
                                      _asn1_set_value($$,$3,strlen($3)+1);
                                       _asn1_set_name($$,$6);}
 ;
@@ -230,17 +230,17 @@ size_def:   size_def2          {$$=$1;}
           | '(' size_def2 ')'  {$$=$2;}
 ;
 
-generalstring_def: GeneralString {$$=_asn1_add_node(TYPE_GENERALSTRING);}
-                | GeneralString size_def 
{$$=_asn1_add_node(TYPE_GENERALSTRING|CONST_SIZE);
+generalstring_def: GeneralString 
{$$=_asn1_add_static_node(TYPE_GENERALSTRING);}
+                | GeneralString size_def 
{$$=_asn1_add_static_node(TYPE_GENERALSTRING|CONST_SIZE);
                                          _asn1_set_down($$,$2);}
 ;
 
-octet_string_def : OCTET STRING           
{$$=_asn1_add_node(TYPE_OCTET_STRING);}
-                 | OCTET STRING size_def  
{$$=_asn1_add_node(TYPE_OCTET_STRING|CONST_SIZE);
+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);
                                            _asn1_set_down($$,$3);}
 ;
 
-bit_element :  IDENTIFIER'('NUM')' {$$=_asn1_add_node(TYPE_CONSTANT);
+bit_element :  IDENTIFIER'('NUM')' {$$=_asn1_add_static_node(TYPE_CONSTANT);
                                   _asn1_set_name($$,$1);
                                     _asn1_set_value($$,$3,strlen($3)+1);}
 ;
@@ -250,25 +250,25 @@ bit_element_list :  bit_element   {$$=$1;}
                                                        
_asn1_set_right(_asn1_get_last_right($1),$3);}
 ;
 
-bit_string_def : BIT STRING    {$$=_asn1_add_node(TYPE_BIT_STRING);}
-               | BIT STRING size_def 
{$$=_asn1_add_node(TYPE_BIT_STRING|CONST_SIZE);}
+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'{'bit_element_list'}'
-                               {$$=_asn1_add_node(TYPE_BIT_STRING|CONST_LIST);
+                               
{$$=_asn1_add_static_node(TYPE_BIT_STRING|CONST_LIST);
                                 _asn1_set_down($$,$4);}
 ;
 
 enumerated_def : ENUMERATED'{'bit_element_list'}'
-                               {$$=_asn1_add_node(TYPE_ENUMERATED|CONST_LIST);
+                               
{$$=_asn1_add_static_node(TYPE_ENUMERATED|CONST_LIST);
                                 _asn1_set_down($$,$3);}
 ;
 
 
-object_def :  OBJECT STR_IDENTIFIER {$$=_asn1_add_node(TYPE_OBJECT_ID);}
+object_def :  OBJECT STR_IDENTIFIER {$$=_asn1_add_static_node(TYPE_OBJECT_ID);}
 ;
 
-type_assig_right: IDENTIFIER          {$$=_asn1_add_node(TYPE_IDENTIFIER);
+type_assig_right: IDENTIFIER          
{$$=_asn1_add_static_node(TYPE_IDENTIFIER);
                                        _asn1_set_value($$,$1,strlen($1)+1);}
-                | IDENTIFIER size_def 
{$$=_asn1_add_node(TYPE_IDENTIFIER|CONST_SIZE);
+                | IDENTIFIER size_def 
{$$=_asn1_add_static_node(TYPE_IDENTIFIER|CONST_SIZE);
                                        _asn1_set_value($$,$1,strlen($1)+1);
                                        _asn1_set_down($$,$2);}
                 | integer_def         {$$=$1;}
@@ -283,7 +283,7 @@ type_assig_right: IDENTIFIER          
{$$=_asn1_add_node(TYPE_IDENTIFIER);
                 | choise_def          {$$=$1;}
                 | any_def             {$$=$1;}
                 | set_def             {$$=$1;}
-                | TOKEN_NULL          {$$=_asn1_add_node(TYPE_NULL);}
+                | TOKEN_NULL          {$$=_asn1_add_static_node(TYPE_NULL);}
 ;
 
 type_assig_right_tag :   type_assig_right     {$$=$1;}
@@ -307,31 +307,31 @@ type_assig_list : type_assig                   {$$=$1;}
                                                 
_asn1_set_right(_asn1_get_last_right($1),$3);}
 ;
 
-sequence_def : SEQUENCE'{'type_assig_list'}' {$$=_asn1_add_node(TYPE_SEQUENCE);
+sequence_def : SEQUENCE'{'type_assig_list'}' 
{$$=_asn1_add_static_node(TYPE_SEQUENCE);
                                               _asn1_set_down($$,$3);}
-   | SEQUENCE OF type_assig_right            
{$$=_asn1_add_node(TYPE_SEQUENCE_OF);
+   | SEQUENCE OF type_assig_right            
{$$=_asn1_add_static_node(TYPE_SEQUENCE_OF);
                                               _asn1_set_down($$,$3);}
-   | SEQUENCE size_def OF type_assig_right 
{$$=_asn1_add_node(TYPE_SEQUENCE_OF|CONST_SIZE);
+   | SEQUENCE size_def OF type_assig_right 
{$$=_asn1_add_static_node(TYPE_SEQUENCE_OF|CONST_SIZE);
                                             _asn1_set_right($2,$4);
                                             _asn1_set_down($$,$2);}
 ;
 
-set_def :  SET'{'type_assig_list'}' {$$=_asn1_add_node(TYPE_SET);
+set_def :  SET'{'type_assig_list'}' {$$=_asn1_add_static_node(TYPE_SET);
                                      _asn1_set_down($$,$3);}
-   | SET OF type_assig_right        {$$=_asn1_add_node(TYPE_SET_OF);
+   | SET OF type_assig_right        {$$=_asn1_add_static_node(TYPE_SET_OF);
                                      _asn1_set_down($$,$3);}
-   | SET size_def OF type_assig_right 
{$$=_asn1_add_node(TYPE_SET_OF|CONST_SIZE);
+   | SET size_def OF type_assig_right 
{$$=_asn1_add_static_node(TYPE_SET_OF|CONST_SIZE);
                                        _asn1_set_right($2,$4);
                                        _asn1_set_down($$,$2);}
 ;
 
-choise_def :   CHOICE'{'type_assig_list'}'  {$$=_asn1_add_node(TYPE_CHOICE);
+choise_def :   CHOICE'{'type_assig_list'}'  
{$$=_asn1_add_static_node(TYPE_CHOICE);
                                              _asn1_set_down($$,$3);}
 ;
 
-any_def :  ANY                         {$$=_asn1_add_node(TYPE_ANY);}
-         | ANY DEFINED BY IDENTIFIER   
{$$=_asn1_add_node(TYPE_ANY|CONST_DEFINED_BY);
-                                        
_asn1_set_down($$,_asn1_add_node(TYPE_CONSTANT));
+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));
                                        _asn1_set_name(_asn1_get_down($$),$4);}
 ;
 
@@ -339,16 +339,16 @@ type_def : IDENTIFIER "::=" type_assig_right_tag  
{$$=_asn1_set_name($3,$1);}
 ;
 
 constant_def :  IDENTIFIER OBJECT STR_IDENTIFIER "::=" '{'obj_constant_list'}'
-                        {$$=_asn1_add_node(TYPE_OBJECT_ID|CONST_ASSIGN);
+                        {$$=_asn1_add_static_node(TYPE_OBJECT_ID|CONST_ASSIGN);
                          _asn1_set_name($$,$1);
                          _asn1_set_down($$,$6);}
               | IDENTIFIER IDENTIFIER "::=" '{' obj_constant_list '}'
-                        
{$$=_asn1_add_node(TYPE_OBJECT_ID|CONST_ASSIGN|CONST_1_PARAM);
+                        
{$$=_asn1_add_static_node(TYPE_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_node(TYPE_INTEGER|CONST_ASSIGN);
+                        {$$=_asn1_add_static_node(TYPE_INTEGER|CONST_ASSIGN);
                          _asn1_set_name($$,$1);
                          _asn1_set_value($$,$4,strlen($4)+1);}
 ;
@@ -362,27 +362,27 @@ type_constant_list :   type_constant    {$$=$1;}
                                                           
_asn1_set_right(_asn1_get_last_right($1),$2);}
 ;
 
-definitions_id  :  IDENTIFIER  '{' obj_constant_list '}' 
{$$=_asn1_add_node(TYPE_OBJECT_ID);
+definitions_id  :  IDENTIFIER  '{' obj_constant_list '}' 
{$$=_asn1_add_static_node(TYPE_OBJECT_ID);
                                                           
_asn1_set_down($$,$3);
                                                           
_asn1_set_name($$,$1);}
-                 | IDENTIFIER  '{' '}'                   
{$$=_asn1_add_node(TYPE_OBJECT_ID);
+                 | IDENTIFIER  '{' '}'                   
{$$=_asn1_add_static_node(TYPE_OBJECT_ID);
                                                           
_asn1_set_name($$,$1);}
 ;
 
 /*
-identifier_list  :  IDENTIFIER  {$$=_asn1_add_node(TYPE_IDENTIFIER);
+identifier_list  :  IDENTIFIER  {$$=_asn1_add_static_node(TYPE_IDENTIFIER);
                                  _asn1_set_name($$,$1);}
                   | identifier_list IDENTIFIER
                                 {$$=$1;
-                                 
_asn1_set_right(_asn1_get_last_right($$),_asn1_add_node(TYPE_IDENTIFIER));
+                                 
_asn1_set_right(_asn1_get_last_right($$),_asn1_add_static_node(TYPE_IDENTIFIER));
                                  _asn1_set_name(_asn1_get_last_right($$),$2);}
 ;
 
 
 imports_def :    empty   {$$=NULL;}
               | IMPORTS identifier_list FROM IDENTIFIER obj_constant_list
-                        {$$=_asn1_add_node(TYPE_IMPORTS);
-                         _asn1_set_down($$,_asn1_add_node(TYPE_OBJECT_ID));
+                        {$$=_asn1_add_static_node(TYPE_IMPORTS);
+                         
_asn1_set_down($$,_asn1_add_static_node(TYPE_OBJECT_ID));
                          _asn1_set_name(_asn1_get_down($$),$4);
                          _asn1_set_down(_asn1_get_down($$),$5);
                          _asn1_set_right($$,$2);}
diff --git a/lib/coding.c b/lib/coding.c
index 307dd40..11f8f48 100644
--- a/lib/coding.c
+++ b/lib/coding.c
@@ -260,7 +260,7 @@ _asn1_objectid_der (unsigned char *str, unsigned char *der, 
int *der_len)
 
   max_len = *der_len;
 
-  temp = _asn1_malloc (str_len + 2);
+  temp = malloc (str_len + 2);
   if (temp == NULL)
     return ASN1_MEM_ALLOC_ERROR;
 
@@ -313,7 +313,7 @@ _asn1_objectid_der (unsigned char *str, unsigned char *der, 
int *der_len)
     }
   *der_len += len_len;
 
-  _asn1_free (temp);
+  free (temp);
 
   if (max_len < (*der_len))
     return ASN1_MEM_ERROR;
@@ -638,7 +638,7 @@ _asn1_ordering_set (unsigned char *der, int der_len, 
ASN1_TYPE node)
   first = last = NULL;
   while (p)
     {
-      p_vet = (struct vet *) _asn1_malloc (sizeof (struct vet));
+      p_vet = malloc (sizeof (struct vet));
       if (p_vet == NULL)
        return;
 
@@ -679,7 +679,7 @@ _asn1_ordering_set (unsigned char *der, int der_len, 
ASN1_TYPE node)
          if (p_vet->value > p2_vet->value)
            {
              /* change position */
-             temp = (unsigned char *) _asn1_malloc (p_vet->end - counter);
+             temp = malloc (p_vet->end - counter);
              if (temp == NULL)
                return;
 
@@ -688,7 +688,7 @@ _asn1_ordering_set (unsigned char *der, int der_len, 
ASN1_TYPE node)
                      p2_vet->end - p_vet->end);
              memcpy (der + counter + p2_vet->end - p_vet->end, temp,
                      p_vet->end - counter);
-             _asn1_free (temp);
+             free (temp);
 
              tag = p_vet->value;
              p_vet->value = p2_vet->value;
@@ -706,7 +706,7 @@ _asn1_ordering_set (unsigned char *der, int der_len, 
ASN1_TYPE node)
        p_vet->prev->next = NULL;
       else
        first = NULL;
-      _asn1_free (p_vet);
+      free (p_vet);
       p_vet = first;
     }
 }
@@ -752,7 +752,7 @@ _asn1_ordering_set_of (unsigned char *der, int der_len, 
ASN1_TYPE node)
   first = last = NULL;
   while (p)
     {
-      p_vet = (struct vet *) _asn1_malloc (sizeof (struct vet));
+      p_vet = malloc (sizeof (struct vet));
       if (p_vet == NULL)
        return;
 
@@ -817,7 +817,7 @@ _asn1_ordering_set_of (unsigned char *der, int der_len, 
ASN1_TYPE node)
          if (change == 1)
            {
              /* change position */
-             temp = (unsigned char *) _asn1_malloc (p_vet->end - counter);
+             temp = malloc (p_vet->end - counter);
              if (temp == NULL)
                return;
 
@@ -826,7 +826,7 @@ _asn1_ordering_set_of (unsigned char *der, int der_len, 
ASN1_TYPE node)
                      (p2_vet->end) - (p_vet->end));
              memcpy (der + counter + (p2_vet->end) - (p_vet->end), temp,
                      (p_vet->end) - counter);
-             _asn1_free (temp);
+             free (temp);
 
              p_vet->end = counter + (p2_vet->end - p_vet->end);
            }
@@ -840,7 +840,7 @@ _asn1_ordering_set_of (unsigned char *der, int der_len, 
ASN1_TYPE node)
        p_vet->prev->next = NULL;
       else
        first = NULL;
-      _asn1_free (p_vet);
+      free (p_vet);
       p_vet = first;
     }
 }
diff --git a/lib/element.c b/lib/element.c
index ea8eb48..2ee4950 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -343,8 +343,7 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
        {
          if ((isdigit (value[0])) || (value[0] == '-'))
            {
-             value_temp =
-               (unsigned char *) _asn1_malloc (SIZEOF_UNSIGNED_LONG_INT);
+             value_temp = malloc (SIZEOF_UNSIGNED_LONG_INT);
              if (value_temp == NULL)
                return ASN1_MEM_ALLOC_ERROR;
 
@@ -362,9 +361,7 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
                    {
                      if (!_asn1_strcmp (p->name, value))
                        {
-                         value_temp =
-                           (unsigned char *)
-                           _asn1_malloc (SIZEOF_UNSIGNED_LONG_INT);
+                         value_temp = malloc (SIZEOF_UNSIGNED_LONG_INT);
                          if (value_temp == NULL)
                            return ASN1_MEM_ALLOC_ERROR;
 
@@ -383,7 +380,7 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
        }
       else
        {                       /* len != 0 */
-         value_temp = (unsigned char *) _asn1_malloc (len);
+         value_temp = malloc (len);
          if (value_temp == NULL)
            return ASN1_MEM_ALLOC_ERROR;
          memcpy (value_temp, value, len);
@@ -397,7 +394,7 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
 
       if (negative && (type_field (node->type) == TYPE_ENUMERATED))
        {
-         _asn1_free (value_temp);
+         free (value_temp);
          return ASN1_VALUE_NOT_VALID;
        }
 
@@ -420,11 +417,10 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
            p = p->right;
          if ((isdigit (p->value[0])) || (p->value[0] == '-'))
            {
-             default_temp =
-               (unsigned char *) _asn1_malloc (SIZEOF_UNSIGNED_LONG_INT);
+             default_temp = malloc (SIZEOF_UNSIGNED_LONG_INT);
              if (default_temp == NULL)
                {
-                 _asn1_free (value_temp);
+                 free (value_temp);
                  return ASN1_MEM_ALLOC_ERROR;
                }
 
@@ -435,7 +431,7 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
            {                   /* is an identifier like v1 */
              if (!(node->type & CONST_LIST))
                {
-                 _asn1_free (value_temp);
+                 free (value_temp);
                  return ASN1_VALUE_NOT_VALID;
                }
              p2 = node->down;
@@ -445,12 +441,10 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
                    {
                      if (!_asn1_strcmp (p2->name, p->value))
                        {
-                         default_temp =
-                           (unsigned char *)
-                           _asn1_malloc (SIZEOF_UNSIGNED_LONG_INT);
+                         default_temp = malloc (SIZEOF_UNSIGNED_LONG_INT);
                          if (default_temp == NULL)
                            {
-                             _asn1_free (value_temp);
+                             free (value_temp);
                              return ASN1_MEM_ALLOC_ERROR;
                            }
 
@@ -465,7 +459,7 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
                }
              if (p2 == NULL)
                {
-                 _asn1_free (value_temp);
+                 free (value_temp);
                  return ASN1_VALUE_NOT_VALID;
                }
            }
@@ -481,9 +475,9 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
              if (k2 == len2)
                _asn1_set_value (node, NULL, 0);
            }
-         _asn1_free (default_temp);
+         free (default_temp);
        }
-      _asn1_free (value_temp);
+      free (value_temp);
       break;
     case TYPE_OBJECT_ID:
       for (i = 0; i < _asn1_strlen (value); i++)
@@ -562,7 +556,7 @@ asn1_write_value (ASN1_TYPE node_root, const char *name,
       if (len == 0)
        len = _asn1_strlen (value);
       asn1_length_der ((len >> 3) + 2, NULL, &len2);
-      temp = (unsigned char *) _asn1_malloc ((len >> 3) + 2 + len2);
+      temp = malloc ((len >> 3) + 2 + len2);
       if (temp == NULL)
        return ASN1_MEM_ALLOC_ERROR;
 
diff --git a/lib/int.h b/lib/int.h
index 4d13d12..cabd599 100644
--- a/lib/int.h
+++ b/lib/int.h
@@ -57,11 +57,6 @@ struct node_asn_struct
   unsigned char small_value[ASN1_SMALL_VALUE_SIZE];    /* For small values */
 };
 
-#define _asn1_malloc malloc
-#define _asn1_free free
-#define _asn1_calloc calloc
-#define _asn1_realloc realloc
-#define _asn1_strdup strdup
 #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)
diff --git a/lib/libtasn1.h b/lib/libtasn1.h
index e67fdfe..6293e7d 100644
--- a/lib/libtasn1.h
+++ b/lib/libtasn1.h
@@ -114,7 +114,7 @@ extern "C"
 
   /* maximum number of characters of a name */
   /* inside a file with ASN1 definitons     */
-#define ASN1_MAX_NAME_SIZE 128
+#define ASN1_MAX_NAME_SIZE 64
 
 #define ASN1_TYPE_EMPTY  NULL
 
@@ -159,7 +159,6 @@ extern "C"
     const void *value;         /* Node value */
     unsigned int value_len;     /* Node value size */
     unsigned int type;         /* Node value type (ASN1_ETYPE_*) */
-    unsigned int vals[3];      /* reserved for future use */
   };
   typedef struct node_data_struct ASN1_DATA_NODE;
 
diff --git a/lib/parser_aux.c b/lib/parser_aux.c
index 83de603..1d22951 100644
--- a/lib/parser_aux.c
+++ b/lib/parser_aux.c
@@ -43,7 +43,7 @@ typedef struct list_struct
 list_type *firstElement = NULL;
 
 /******************************************************/
-/* Function : _asn1_add_node                          */
+/* Function : _asn1_add_static_node                   */
 /* Description: creates a new NODE_ASN element and    */
 /* puts it in the list pointed by firstElement.       */
 /* Parameters:                                        */
@@ -52,19 +52,19 @@ list_type *firstElement = NULL;
 /* Return: pointer to the new element.                */
 /******************************************************/
 ASN1_TYPE
-_asn1_add_node (unsigned int type)
+_asn1_add_static_node (unsigned int type)
 {
   list_type *listElement;
   ASN1_TYPE punt;
 
-  punt = (ASN1_TYPE) _asn1_calloc (1, sizeof (struct node_asn_struct));
+  punt = calloc (1, sizeof (struct node_asn_struct));
   if (punt == NULL)
     return NULL;
 
-  listElement = (list_type *) _asn1_malloc (sizeof (list_type));
+  listElement = malloc (sizeof (list_type));
   if (listElement == NULL)
     {
-      _asn1_free (punt);
+      free (punt);
       return NULL;
     }
 
@@ -204,7 +204,7 @@ _asn1_set_value (ASN1_TYPE node, const void *value, 
unsigned int len)
   if (node->value)
     {
       if (node->value != node->small_value)
-       _asn1_free (node->value);
+       free (node->value);
       node->value = NULL;
       node->value_len = 0;
     }
@@ -218,7 +218,7 @@ _asn1_set_value (ASN1_TYPE node, const void *value, 
unsigned int len)
     }
   else
     {
-      node->value = _asn1_malloc (len);
+      node->value = malloc (len);
       if (node->value == NULL)
        return NULL;
     }
@@ -249,7 +249,7 @@ _asn1_set_value_octet (ASN1_TYPE node, const void *value, 
unsigned int len)
     return node;
 
   asn1_length_der (len, NULL, &len2);
-  temp = (unsigned char *) _asn1_malloc (len + len2);
+  temp = malloc (len + len2);
   if (temp == NULL)
     return NULL;
 
@@ -269,7 +269,7 @@ _asn1_set_value_m (ASN1_TYPE node, void *value, unsigned 
int len)
   if (node->value)
     {
       if (node->value != node->small_value)
-       _asn1_free (node->value);
+       free (node->value);
       node->value = NULL;
       node->value_len = 0;
     }
@@ -303,7 +303,7 @@ _asn1_append_value (ASN1_TYPE node, const void *value, 
unsigned int len)
       /* value is allocated */
       int prev_len = node->value_len;
       node->value_len += len;
-      node->value = _asn1_realloc (node->value, node->value_len);
+      node->value = realloc (node->value, node->value_len);
       if (node->value == NULL)
        {
          node->value_len = 0;
@@ -318,7 +318,7 @@ _asn1_append_value (ASN1_TYPE node, const void *value, 
unsigned int len)
       /* value is in node */
       int prev_len = node->value_len;
       node->value_len += len;
-      node->value = _asn1_malloc (node->value_len);
+      node->value = malloc (node->value_len);
       if (node->value == NULL)
        {
          node->value_len = 0;
@@ -415,8 +415,8 @@ _asn1_remove_node (ASN1_TYPE node)
     return;
 
   if (node->value != NULL && node->value != node->small_value)
-    _asn1_free (node->value);
-  _asn1_free (node);
+    free (node->value);
+  free (node);
 }
 
 /******************************************************************/
@@ -456,7 +456,7 @@ _asn1_delete_list (void)
     {
       listElement = firstElement;
       firstElement = firstElement->next;
-      _asn1_free (listElement);
+      free (listElement);
     }
 }
 
@@ -475,7 +475,7 @@ _asn1_delete_list_and_nodes (void)
       listElement = firstElement;
       firstElement = firstElement->next;
       _asn1_remove_node (listElement->node);
-      _asn1_free (listElement);
+      free (listElement);
     }
 }
 
@@ -634,7 +634,7 @@ _asn1_expand_object_id (ASN1_TYPE node)
                        {
                          if (type_field (p4->type) == TYPE_CONSTANT)
                            {
-                             p5 = _asn1_add_node_only (TYPE_CONSTANT);
+                             p5 = _asn1_add_single_node (TYPE_CONSTANT);
                              _asn1_set_name (p5, p4->name);
                              tlen = _asn1_strlen (p4->value);
                              if (tlen > 0)
diff --git a/lib/parser_aux.h b/lib/parser_aux.h
index 7156088..0fc5f0d 100644
--- a/lib/parser_aux.h
+++ b/lib/parser_aux.h
@@ -27,7 +27,7 @@
 /***************************************/
 /*  Functions used by ASN.1 parser     */
 /***************************************/
-ASN1_TYPE _asn1_add_node (unsigned int type);
+ASN1_TYPE _asn1_add_static_node (unsigned int type);
 
 ASN1_TYPE
 _asn1_set_value (ASN1_TYPE node, const void *value, unsigned int len);
diff --git a/lib/structure.c b/lib/structure.c
index 93da56c..78e1f89 100644
--- a/lib/structure.c
+++ b/lib/structure.c
@@ -37,7 +37,7 @@ extern char _asn1_identifierMissing[];
 
 
 /******************************************************/
-/* Function : _asn1_add_node_only                     */
+/* Function : _asn1_add_single_node                     */
 /* Description: creates a new NODE_ASN element.       */
 /* Parameters:                                        */
 /*   type: type of the new element (see TYPE_         */
@@ -45,11 +45,11 @@ extern char _asn1_identifierMissing[];
 /* Return: pointer to the new element.                */
 /******************************************************/
 ASN1_TYPE
-_asn1_add_node_only (unsigned int type)
+_asn1_add_single_node (unsigned int type)
 {
   ASN1_TYPE punt;
 
-  punt = (ASN1_TYPE) _asn1_calloc (1, sizeof (struct node_asn_struct));
+  punt = calloc (1, sizeof (struct node_asn_struct));
   if (punt == NULL)
     return NULL;
 
@@ -191,7 +191,7 @@ asn1_array2tree (const ASN1_ARRAY_TYPE * array, ASN1_TYPE * 
definitions,
   k = 0;
   while (array[k].value || array[k].type || array[k].name)
     {
-      p = _asn1_add_node (array[k].type & (~CONST_DOWN));
+      p = _asn1_add_static_node (array[k].type & (~CONST_DOWN));
       if (array[k].name)
        _asn1_set_name (p, array[k].name);
       if (array[k].value)
@@ -380,7 +380,7 @@ _asn1_copy_structure3 (ASN1_TYPE source_node)
   if (source_node == NULL)
     return NULL;
 
-  dest_node = _asn1_add_node_only (source_node->type);
+  dest_node = _asn1_add_single_node (source_node->type);
 
   p_s = source_node;
   p_d = dest_node;
@@ -399,7 +399,7 @@ _asn1_copy_structure3 (ASN1_TYPE source_node)
            {
              p_s = p_s->down;
              p_d_prev = p_d;
-             p_d = _asn1_add_node_only (p_s->type);
+             p_d = _asn1_add_single_node (p_s->type);
              _asn1_set_down (p_d_prev, p_d);
              continue;
            }
@@ -413,7 +413,7 @@ _asn1_copy_structure3 (ASN1_TYPE source_node)
            move = RIGHT;
            p_s = p_s->right;
            p_d_prev = p_d;
-           p_d = _asn1_add_node_only (p_s->type);
+           p_d = _asn1_add_single_node (p_s->type);
            _asn1_set_right (p_d_prev, p_d);
         }
       else
@@ -470,7 +470,7 @@ _asn1_type_choice_config (ASN1_TYPE node)
                        {
                          if (type_field (p3->type) == TYPE_TAG)
                            {
-                             p4 = _asn1_add_node_only (p3->type);
+                             p4 = _asn1_add_single_node (p3->type);
                              tlen = _asn1_strlen (p3->value);
                              if (tlen > 0)
                                _asn1_set_value (p4, p3->value, tlen + 1);
@@ -545,9 +545,7 @@ _asn1_expand_identifier (ASN1_TYPE * node, ASN1_TYPE root)
        {
          if (type_field (p->type) == TYPE_IDENTIFIER)
            {
-             _asn1_str_cpy (name2, sizeof (name2), root->name);
-             _asn1_str_cat (name2, sizeof (name2), ".");
-             _asn1_str_cat (name2, sizeof (name2), (char *) p->value);
+             snprintf(name2, sizeof (name2), "%s.%s", root->name, p->value);
              p2 = _asn1_copy_structure2 (root, name2);
              if (p2 == NULL)
                {
@@ -1158,27 +1156,27 @@ asn1_copy_node (ASN1_TYPE dst, const char *dst_name,
   if (result != ASN1_MEM_ERROR)
     return result;
 
-  data = _asn1_malloc (size);
+  data = malloc (size);
   if (data == NULL)
     return ASN1_MEM_ERROR;
 
   result = asn1_der_coding (src, src_name, data, &size, NULL);
   if (result != ASN1_SUCCESS)
     {
-      _asn1_free (data);
+      free (data);
       return result;
     }
 
   dst_node = asn1_find_node (dst, dst_name);
   if (dst_node == NULL)
     {
-      _asn1_free (data);
+      free (data);
       return ASN1_ELEMENT_NOT_FOUND;
     }
 
   result = asn1_der_decoding (&dst_node, data, size, NULL);
 
-  _asn1_free (data);
+  free (data);
 
   return result;
 }
diff --git a/lib/structure.h b/lib/structure.h
index 0a84e26..cf4205b 100644
--- a/lib/structure.h
+++ b/lib/structure.h
@@ -34,7 +34,7 @@ asn1_retCode _asn1_create_static_structure (ASN1_TYPE pointer,
 
 ASN1_TYPE _asn1_copy_structure3 (ASN1_TYPE source_node);
 
-ASN1_TYPE _asn1_add_node_only (unsigned int type);
+ASN1_TYPE _asn1_add_single_node (unsigned int type);
 
 ASN1_TYPE _asn1_find_left (ASN1_TYPE node);
 


hooks/post-receive
-- 
GNU libtasn1



reply via email to

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