corrected compatibility mode with old structures.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 24 Nov 2012 16:57:51 +0000 (17:57 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 24 Nov 2012 16:57:51 +0000 (17:57 +0100)
lib/int.h
lib/parser_aux.c
lib/structure.c

index ce20ab2..3163d50 100644 (file)
--- 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;
index 4fcc7d7..50238d2 100644 (file)
@@ -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;
 }
index 1659067..31a5f65 100644 (file)
@@ -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
        {