2 * Copyright (C) 2004, 2006 Free Software Foundation
3 * Copyright (C) 2002 Fabio Fiorina
5 * This file is part of LIBTASN1.
7 * The LIBTASN1 library is free software; you can redistribute it
8 * and/or modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 /*****************************************************/
25 /* File: structure.c */
26 /* Description: Functions to create and delete an */
28 /*****************************************************/
33 #include <structure.h>
34 #include "parser_aux.h"
38 extern char _asn1_identifierMissing
[];
41 /******************************************************/
42 /* Function : _asn1_add_node_only */
43 /* Description: creates a new NODE_ASN element. */
45 /* type: type of the new element (see TYPE_ */
46 /* and CONST_ constants). */
47 /* Return: pointer to the new element. */
48 /******************************************************/
50 _asn1_add_node_only (unsigned int type
)
54 punt
= (node_asn
*) _asn1_malloc (sizeof (node_asn
));
69 /******************************************************************/
70 /* Function : _asn1_find_left */
71 /* Description: returns the NODE_ASN element with RIGHT field that*/
72 /* points the element NODE. */
74 /* node: NODE_ASN element pointer. */
75 /* Return: NULL if not found. */
76 /******************************************************************/
78 _asn1_find_left (node_asn
* node
)
80 if ((node
== NULL
) || (node
->left
== NULL
) || (node
->left
->down
== node
))
88 _asn1_create_static_structure (ASN1_TYPE pointer
, char *output_file_name
,
95 file
= fopen (output_file_name
, "w");
98 return ASN1_FILE_NOT_FOUND
;
100 fprintf (file
, "\n#include <libtasn1.h>\n\n");
101 fprintf (file
, "extern const ASN1_ARRAY_TYPE %s[]={\n", vector_name
);
107 fprintf (file
, " {");
110 fprintf (file
, "\"%s\",", p
->name
);
112 fprintf (file
, "0,");
120 fprintf (file
, "%lu,", t
);
123 fprintf (file
, "\"%s\"},\n", p
->value
);
125 fprintf (file
, "0},\n");
139 p
= _asn1_find_up (p
);
154 fprintf (file
, " {0,0,0}\n};\n");
163 * asn1_array2tree - Creates the structures needed to manage the ASN1 definitions.
164 * @array: specify the array that contains ASN.1 declarations
165 * @definitions: return the pointer to the structure created by
166 * *ARRAY ASN.1 declarations
167 * @errorDescription: return the error description.
169 * Creates the structures needed to manage the ASN.1 definitions.
170 * @array is a vector created by asn1_parser2array().
174 * ASN1_SUCCESS: Structure created correctly.
176 * ASN1_ELEMENT_NOT_EMPTY: *@definitions not ASN1_TYPE_EMPTY.
178 * ASN1_IDENTIFIER_NOT_FOUND: In the file there is an identifier that
179 * is not defined (see @errorDescription for more information).
181 * ASN1_ARRAY_ERROR: The array pointed by @array is wrong.
184 asn1_array2tree (const ASN1_ARRAY_TYPE
* array
, ASN1_TYPE
* definitions
,
185 char *errorDescription
)
187 node_asn
*p
, *p_last
= NULL
;
193 if (*definitions
!= ASN1_TYPE_EMPTY
)
194 return ASN1_ELEMENT_NOT_EMPTY
;
199 while (array
[k
].value
|| array
[k
].type
|| array
[k
].name
)
201 p
= _asn1_add_node (array
[k
].type
& (~CONST_DOWN
));
203 _asn1_set_name (p
, array
[k
].name
);
205 _asn1_set_value (p
, array
[k
].value
, strlen (array
[k
].value
) + 1);
207 if (*definitions
== NULL
)
211 _asn1_set_down (p_last
, p
);
212 else if (move
== RIGHT
)
213 _asn1_set_right (p_last
, p
);
217 if (array
[k
].type
& CONST_DOWN
)
219 else if (array
[k
].type
& CONST_RIGHT
)
225 if (p_last
== *definitions
)
228 p_last
= _asn1_find_up (p_last
);
233 if (p_last
->type
& CONST_RIGHT
)
235 p_last
->type
&= ~CONST_RIGHT
;
244 if (p_last
== *definitions
)
246 result
= _asn1_check_identifier (*definitions
);
247 if (result
== ASN1_SUCCESS
)
249 _asn1_change_integer_value (*definitions
);
250 _asn1_expand_object_id (*definitions
);
255 result
= ASN1_ARRAY_ERROR
;
258 if (errorDescription
!= NULL
)
260 if (result
== ASN1_IDENTIFIER_NOT_FOUND
)
262 Estrcpy (errorDescription
, ":: identifier '");
263 Estrcat (errorDescription
, _asn1_identifierMissing
);
264 Estrcat (errorDescription
, "' not found");
267 errorDescription
[0] = 0;
270 if (result
!= ASN1_SUCCESS
)
272 _asn1_delete_list_and_nodes ();
273 *definitions
= ASN1_TYPE_EMPTY
;
276 _asn1_delete_list ();
282 * asn1_delete_structure - Deletes the structure pointed by *ROOT.
283 * @structure: pointer to the structure that you want to delete.
285 * Deletes the structure *@structure. At the end, *@structure is set
286 * to ASN1_TYPE_EMPTY.
290 * ASN1_SUCCESS: Everything OK.
292 * ASN1_ELEMENT_NOT_FOUND: *@structure was ASN1_TYPE_EMPTY.
296 asn1_delete_structure (ASN1_TYPE
* structure
)
298 node_asn
*p
, *p2
, *p3
;
300 if (*structure
== ASN1_TYPE_EMPTY
)
301 return ASN1_ELEMENT_NOT_FOUND
;
315 p3
= _asn1_find_up (p
);
316 _asn1_set_down (p3
, p2
);
317 _asn1_remove_node (p
);
322 p3
= _asn1_find_left (p
);
325 p3
= _asn1_find_up (p
);
327 _asn1_set_down (p3
, p2
);
331 p
->right
->left
= NULL
;
335 _asn1_set_right (p3
, p2
);
336 _asn1_remove_node (p
);
342 *structure
= ASN1_TYPE_EMPTY
;
349 * asn1_delete_element - Deletes the element of a structure.
350 * @structure: pointer to the structure that contains the element you
352 * @element_name: element's name you want to delete.
354 * Deletes the element named *@element_name inside *@structure.
358 * ASN1_SUCCESS: Everything OK.
360 * ASN1_ELEMENT_NOT_FOUND: The name element was not found.
364 asn1_delete_element (ASN1_TYPE structure
, const char *element_name
)
366 node_asn
*p2
, *p3
, *source_node
;
368 source_node
= asn1_find_node (structure
, element_name
);
370 if (source_node
== ASN1_TYPE_EMPTY
)
371 return ASN1_ELEMENT_NOT_FOUND
;
373 p2
= source_node
->right
;
374 p3
= _asn1_find_left (source_node
);
377 p3
= _asn1_find_up (source_node
);
379 _asn1_set_down (p3
, p2
);
380 else if (source_node
->right
)
381 source_node
->right
->left
= NULL
;
384 _asn1_set_right (p3
, p2
);
386 return asn1_delete_structure (&source_node
);
390 _asn1_copy_structure3 (node_asn
* source_node
)
392 node_asn
*dest_node
, *p_s
, *p_d
, *p_d_prev
;
395 if (source_node
== NULL
)
398 dest_node
= _asn1_add_node_only (source_node
->type
);
410 _asn1_set_name (p_d
, p_s
->name
);
412 _asn1_set_value (p_d
, p_s
->value
, p_s
->value_len
);
424 p_d
= _asn1_add_node_only (p_s
->type
);
425 _asn1_set_down (p_d_prev
, p_d
);
431 if (p_s
== source_node
)
440 p_d
= _asn1_add_node_only (p_s
->type
);
441 _asn1_set_right (p_d_prev
, p_d
);
448 p_s
= _asn1_find_up (p_s
);
449 p_d
= _asn1_find_up (p_d
);
452 while (p_s
!= source_node
);
459 _asn1_copy_structure2 (node_asn
* root
, const char *source_name
)
461 node_asn
*source_node
;
463 source_node
= asn1_find_node (root
, source_name
);
465 return _asn1_copy_structure3 (source_node
);
471 _asn1_type_choice_config (node_asn
* node
)
473 node_asn
*p
, *p2
, *p3
, *p4
;
477 return ASN1_ELEMENT_NOT_FOUND
;
482 while (!((p
== node
) && (move
== UP
)))
486 if ((type_field (p
->type
) == TYPE_CHOICE
) && (p
->type
& CONST_TAG
))
491 if (type_field (p2
->type
) != TYPE_TAG
)
493 p2
->type
|= CONST_TAG
;
494 p3
= _asn1_find_left (p2
);
497 if (type_field (p3
->type
) == TYPE_TAG
)
499 p4
= _asn1_add_node_only (p3
->type
);
500 tlen
= strlen (p3
->value
);
502 _asn1_set_value (p4
, p3
->value
, tlen
+ 1);
503 _asn1_set_right (p4
, p2
->down
);
504 _asn1_set_down (p2
, p4
);
506 p3
= _asn1_find_left (p3
);
511 p
->type
&= ~(CONST_TAG
);
516 if (type_field (p2
->type
) == TYPE_TAG
)
517 asn1_delete_structure (&p2
);
548 p
= _asn1_find_up (p
);
556 _asn1_expand_identifier (node_asn
** node
, node_asn
* root
)
558 node_asn
*p
, *p2
, *p3
;
559 char name2
[MAX_NAME_SIZE
+ 2];
563 return ASN1_ELEMENT_NOT_FOUND
;
568 while (!((p
== *node
) && (move
== UP
)))
572 if (type_field (p
->type
) == TYPE_IDENTIFIER
)
574 _asn1_str_cpy (name2
, sizeof (name2
), root
->name
);
575 _asn1_str_cat (name2
, sizeof (name2
), ".");
576 _asn1_str_cat (name2
, sizeof (name2
), p
->value
);
577 p2
= _asn1_copy_structure2 (root
, name2
);
580 return ASN1_IDENTIFIER_NOT_FOUND
;
582 _asn1_set_name (p2
, p
->name
);
583 p2
->right
= p
->right
;
592 _asn1_set_right (p3
, p2
->down
);
593 _asn1_set_down (p2
, p
->down
);
596 p3
= _asn1_find_left (p
);
598 _asn1_set_right (p3
, p2
);
601 p3
= _asn1_find_up (p
);
603 _asn1_set_down (p3
, p2
);
610 if (p
->type
& CONST_SIZE
)
611 p2
->type
|= CONST_SIZE
;
612 if (p
->type
& CONST_TAG
)
613 p2
->type
|= CONST_TAG
;
614 if (p
->type
& CONST_OPTION
)
615 p2
->type
|= CONST_OPTION
;
616 if (p
->type
& CONST_DEFAULT
)
617 p2
->type
|= CONST_DEFAULT
;
618 if (p
->type
& CONST_SET
)
619 p2
->type
|= CONST_SET
;
620 if (p
->type
& CONST_NOT_USED
)
621 p2
->type
|= CONST_NOT_USED
;
625 _asn1_remove_node (p
);
657 p
= _asn1_find_up (p
);
665 * asn1_create_element - Creates a structure of type SOURCE_NAME.
666 * @definitions: pointer to the structure returned by "parser_asn1" function
667 * @source_name: the name of the type of the new structure (must be
668 * inside p_structure).
669 * @element: pointer to the structure created.
671 * Creates a structure of type @source_name. Example using
674 * rc = asn1_create_structure(cert_def, "PKIX1.Certificate",
679 * ASN1_SUCCESS: Creation OK.
681 * ASN1_ELEMENT_NOT_FOUND: SOURCE_NAME isn't known
684 asn1_create_element (ASN1_TYPE definitions
, const char *source_name
,
690 dest_node
= _asn1_copy_structure2 (definitions
, source_name
);
692 if (dest_node
== NULL
)
693 return ASN1_ELEMENT_NOT_FOUND
;
695 _asn1_set_name (dest_node
, "");
697 res
= _asn1_expand_identifier (&dest_node
, definitions
);
698 _asn1_type_choice_config (dest_node
);
700 *element
= dest_node
;
707 * asn1_print_structure - Prints on the standard output the structure's tree
708 * @out: pointer to the output file (e.g. stdout).
709 * @structure: pointer to the structure that you want to visit.
710 * @name: an element of the structure
711 * @mode: specify how much of the structure to print, can be
712 * %ASN1_PRINT_NAME, %ASN1_PRINT_NAME_TYPE,
713 * %ASN1_PRINT_NAME_TYPE_VALUE, or %ASN1_PRINT_ALL.
715 * Prints on the @out file descriptor the structure's tree starting
716 * from the @name element inside the structure @structure.
719 asn1_print_structure (FILE * out
, ASN1_TYPE structure
, const char *name
,
723 int k
, indent
= 0, len
, len2
, len3
;
728 root
= asn1_find_node (structure
, name
);
736 if (mode
== ASN1_PRINT_ALL
)
738 for (k
= 0; k
< indent
; k
++)
740 fprintf (out
, "name:");
742 fprintf (out
, "%s ", p
->name
);
744 fprintf (out
, "NULL ");
748 switch (type_field (p
->type
))
755 for (k
= 0; k
< indent
; k
++)
757 fprintf (out
, "name:");
759 fprintf (out
, "%s ", p
->name
);
761 fprintf (out
, "NULL ");
765 if (mode
!= ASN1_PRINT_NAME
)
767 switch (type_field (p
->type
))
770 if (mode
== ASN1_PRINT_ALL
)
771 fprintf (out
, "type:CONST");
774 if (mode
== ASN1_PRINT_ALL
)
775 fprintf (out
, "type:TAG");
778 if (mode
== ASN1_PRINT_ALL
)
779 fprintf (out
, "type:SIZE");
782 fprintf (out
, "type:DEFAULT");
785 fprintf (out
, "type:NULL");
787 case TYPE_IDENTIFIER
:
788 fprintf (out
, "type:IDENTIFIER");
791 fprintf (out
, "type:INTEGER");
793 case TYPE_ENUMERATED
:
794 fprintf (out
, "type:ENUMERATED");
797 fprintf (out
, "type:TIME");
800 fprintf (out
, "type:BOOLEAN");
803 fprintf (out
, "type:SEQUENCE");
805 case TYPE_BIT_STRING
:
806 fprintf (out
, "type:BIT_STR");
808 case TYPE_OCTET_STRING
:
809 fprintf (out
, "type:OCT_STR");
811 case TYPE_GENERALSTRING
:
812 fprintf (out
, "type:GENERALSTRING");
814 case TYPE_SEQUENCE_OF
:
815 fprintf (out
, "type:SEQ_OF");
818 fprintf (out
, "type:OBJ_ID");
821 fprintf (out
, "type:ANY");
824 fprintf (out
, "type:SET");
827 fprintf (out
, "type:SET_OF");
830 fprintf (out
, "type:CHOICE");
832 case TYPE_DEFINITIONS
:
833 fprintf (out
, "type:DEFINITIONS");
840 if ((mode
== ASN1_PRINT_NAME_TYPE_VALUE
) || (mode
== ASN1_PRINT_ALL
))
842 switch (type_field (p
->type
))
845 if (mode
== ASN1_PRINT_ALL
)
847 fprintf (out
, " value:%s", p
->value
);
850 if (mode
== ASN1_PRINT_ALL
)
852 fprintf (out
, " value:%s", p
->value
);
855 if (mode
== ASN1_PRINT_ALL
)
857 fprintf (out
, " value:%s", p
->value
);
861 fprintf (out
, " value:%s", p
->value
);
862 else if (p
->type
& CONST_TRUE
)
863 fprintf (out
, " value:TRUE");
864 else if (p
->type
& CONST_FALSE
)
865 fprintf (out
, " value:FALSE");
867 case TYPE_IDENTIFIER
:
869 fprintf (out
, " value:%s", p
->value
);
875 len
= asn1_get_length_der (p
->value
, p
->value_len
, &len2
);
876 fprintf (out
, " value:0x");
878 for (k
= 0; k
< len
; k
++)
879 fprintf (out
, "%02x", (p
->value
)[k
+ len2
]);
882 case TYPE_ENUMERATED
:
886 len
= asn1_get_length_der (p
->value
, p
->value_len
, &len2
);
887 fprintf (out
, " value:0x");
889 for (k
= 0; k
< len
; k
++)
890 fprintf (out
, "%02x", (p
->value
)[k
+ len2
]);
895 fprintf (out
, " value:%s", p
->value
);
900 if (p
->value
[0] == 'T')
901 fprintf (out
, " value:TRUE");
902 else if (p
->value
[0] == 'F')
903 fprintf (out
, " value:FALSE");
906 case TYPE_BIT_STRING
:
910 len
= asn1_get_length_der (p
->value
, p
->value_len
, &len2
);
913 fprintf (out
, " value(%i):",
914 (len
- 1) * 8 - (p
->value
[len2
]));
915 for (k
= 1; k
< len
; k
++)
916 fprintf (out
, "%02x", (p
->value
)[k
+ len2
]);
920 case TYPE_OCTET_STRING
:
924 len
= asn1_get_length_der (p
->value
, p
->value_len
, &len2
);
925 fprintf (out
, " value:");
927 for (k
= 0; k
< len
; k
++)
928 fprintf (out
, "%02x", (p
->value
)[k
+ len2
]);
931 case TYPE_GENERALSTRING
:
935 len
= asn1_get_length_der (p
->value
, p
->value_len
, &len2
);
936 fprintf (out
, " value:");
938 for (k
= 0; k
< len
; k
++)
939 fprintf (out
, "%02x", (p
->value
)[k
+ len2
]);
944 fprintf (out
, " value:%s", p
->value
);
950 len2
= asn1_get_length_der (p
->value
, p
->value_len
, &len3
);
951 fprintf (out
, " value:");
953 for (k
= 0; k
< len2
; k
++)
954 fprintf (out
, "%02x", (p
->value
)[k
+ len3
]);
960 case TYPE_DEFINITIONS
:
961 case TYPE_SEQUENCE_OF
:
970 if (mode
== ASN1_PRINT_ALL
)
972 if (p
->type
& 0x1FFFFF00)
974 fprintf (out
, " attr:");
975 if (p
->type
& CONST_UNIVERSAL
)
976 fprintf (out
, "UNIVERSAL,");
977 if (p
->type
& CONST_PRIVATE
)
978 fprintf (out
, "PRIVATE,");
979 if (p
->type
& CONST_APPLICATION
)
980 fprintf (out
, "APPLICATION,");
981 if (p
->type
& CONST_EXPLICIT
)
982 fprintf (out
, "EXPLICIT,");
983 if (p
->type
& CONST_IMPLICIT
)
984 fprintf (out
, "IMPLICIT,");
985 if (p
->type
& CONST_TAG
)
986 fprintf (out
, "TAG,");
987 if (p
->type
& CONST_DEFAULT
)
988 fprintf (out
, "DEFAULT,");
989 if (p
->type
& CONST_TRUE
)
990 fprintf (out
, "TRUE,");
991 if (p
->type
& CONST_FALSE
)
992 fprintf (out
, "FALSE,");
993 if (p
->type
& CONST_LIST
)
994 fprintf (out
, "LIST,");
995 if (p
->type
& CONST_MIN_MAX
)
996 fprintf (out
, "MIN_MAX,");
997 if (p
->type
& CONST_OPTION
)
998 fprintf (out
, "OPTION,");
999 if (p
->type
& CONST_1_PARAM
)
1000 fprintf (out
, "1_PARAM,");
1001 if (p
->type
& CONST_SIZE
)
1002 fprintf (out
, "SIZE,");
1003 if (p
->type
& CONST_DEFINED_BY
)
1004 fprintf (out
, "DEF_BY,");
1005 if (p
->type
& CONST_GENERALIZED
)
1006 fprintf (out
, "GENERALIZED,");
1007 if (p
->type
& CONST_UTC
)
1008 fprintf (out
, "UTC,");
1009 if (p
->type
& CONST_SET
)
1010 fprintf (out
, "SET,");
1011 if (p
->type
& CONST_NOT_USED
)
1012 fprintf (out
, "NOT_USED,");
1013 if (p
->type
& CONST_ASSIGN
)
1014 fprintf (out
, "ASSIGNMENT,");
1018 if (mode
== ASN1_PRINT_ALL
)
1020 fprintf (out
, "\n");
1024 switch (type_field (p
->type
))
1031 fprintf (out
, "\n");
1051 p
= _asn1_find_up (p
);
1071 * asn1_number_of_elements - Counts the number of elements of a structure.
1072 * @element: pointer to the root of an ASN1 structure.
1073 * @name: the name of a sub-structure of ROOT.
1074 * @num: pointer to an integer where the result will be stored
1076 * Counts the number of elements of a sub-structure called NAME with
1077 * names equal to "?1","?2", ...
1081 * ASN1_SUCCESS: Creation OK.
1083 * ASN1_ELEMENT_NOT_FOUND: NAME isn't known.
1085 * ASN1_GENERIC_ERROR: Pointer num equal to NULL.
1089 asn1_number_of_elements (ASN1_TYPE element
, const char *name
, int *num
)
1094 return ASN1_GENERIC_ERROR
;
1098 node
= asn1_find_node (element
, name
);
1100 return ASN1_ELEMENT_NOT_FOUND
;
1106 if ((p
->name
) && (p
->name
[0] == '?'))
1111 return ASN1_SUCCESS
;
1116 * asn1_find_structure_from_oid - Locate structure defined by a specific OID.
1117 * @definitions: ASN1 definitions
1118 * @oidValue: value of the OID to search (e.g. "1.2.3.4").
1120 * Search the structure that is defined just after an OID definition.
1122 * Returns: NULL when OIDVALUE not found, otherwise the pointer to a
1123 * constant string that contains the element name defined just
1128 asn1_find_structure_from_oid (ASN1_TYPE definitions
, const char *oidValue
)
1130 char definitionsName
[MAX_NAME_SIZE
], name
[2 * MAX_NAME_SIZE
+ 1];
1131 char value
[MAX_NAME_SIZE
];
1134 asn1_retCode result
;
1136 if ((definitions
== ASN1_TYPE_EMPTY
) || (oidValue
== NULL
))
1137 return NULL
; /* ASN1_ELEMENT_NOT_FOUND; */
1140 strcpy (definitionsName
, definitions
->name
);
1141 strcat (definitionsName
, ".");
1143 /* search the OBJECT_ID into definitions */
1144 p
= definitions
->down
;
1147 if ((type_field (p
->type
) == TYPE_OBJECT_ID
) &&
1148 (p
->type
& CONST_ASSIGN
))
1150 strcpy (name
, definitionsName
);
1151 strcat (name
, p
->name
);
1153 len
= MAX_NAME_SIZE
;
1154 result
= asn1_read_value (definitions
, name
, value
, &len
);
1156 if ((result
== ASN1_SUCCESS
) && (!strcmp (oidValue
, value
)))
1159 if (p
== NULL
) /* reach the end of ASN1 definitions */
1160 return NULL
; /* ASN1_ELEMENT_NOT_FOUND; */
1168 return NULL
; /* ASN1_ELEMENT_NOT_FOUND; */
1173 * @dst: Destination ASN1_TYPE node.
1174 * @dst_name: Field name in destination node.
1175 * @src: Source ASN1_TYPE node.
1176 * @src_name: Field name in source node.
1178 * Create a deep copy of a ASN1_TYPE variable.
1180 * Return value: Return ASN1_SUCCESS on success.
1183 asn1_copy_node (ASN1_TYPE dst
, const char *dst_name
,
1184 ASN1_TYPE src
, const char *src_name
)
1186 /* FIXME: rewrite using copy_structure().
1187 * It seems quite hard to do.
1194 result
= asn1_der_coding (src
, src_name
, NULL
, &size
, NULL
);
1195 if (result
!= ASN1_MEM_ERROR
)
1198 data
= _asn1_malloc (size
);
1200 return ASN1_MEM_ERROR
;
1202 result
= asn1_der_coding (src
, src_name
, data
, &size
, NULL
);
1203 if (result
!= ASN1_SUCCESS
)
1209 dst_node
= asn1_find_node (dst
, dst_name
);
1210 if (dst_node
== NULL
)
1213 return ASN1_ELEMENT_NOT_FOUND
;
1216 result
= asn1_der_decoding (&dst_node
, data
, size
, NULL
);