Initialize Tizen 2.3
[external/libtasn1.git] / doc / cyclo / cyclo-libtasn1.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
2 <html>
3 <!-- Generated by gnulib's pmccabe2html at 1274360673 -->
4 <head>
5 <title>Cyclomatic Complexity report for GNU Libtasn1</title>
6
7 <meta name="description" content="Cyclomatic Complexity report for GNU Libtasn1">
8 <meta name="keywords" content="Cyclomatic Complexity report for GNU Libtasn1">
9 <meta name="resource-type" content="document">
10 <meta name="distribution" content="global">
11 <meta name="Generator" content="pmccabe2html">
12 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
13 <script language="javascript" type="text/javascript">
14 function show_hide(idCapa, idButton, fuerzaVisibilidad){        var button = document.getElementById(idButton); var capa = document.getElementById(idCapa);     if (capa)       {               if (fuerzaVisibilidad && fuerzaVisibilidad!="") {                       if (fuerzaVisibilidad=="visible") capa.style.display="";                        else capa.style.display="none";         }               else            {                       if (capa.style.display == "none") {                             capa.style.display = "";                                button.innerHTML = "&uarr;";                    } else {                                capa.style.display = "none";                                button.innerHTML = "&darr;";                        }               }       }}
15 </script>
16 <style type ="text/css" media="screen">
17 <!--
18 body {
19
20     font-family: Helvetica, sans-serif;
21
22 }
23
24 .page_title {
25
26     font: 18pt Georgia, serif;
27 /*    font-size: 1.5em;
28     font-weight: bold; */
29     color: darkred;
30     border-bottom: 2px solid darkred;
31 }
32
33 .section_title {
34
35     font: 14pt Georgia, serif;
36     color: darkred;
37     border-bottom: 2px dashed darkred;
38 }
39
40 .report_timestamp {
41
42     color: darkred;
43     font-weight: bold;
44
45 }
46
47 .function_src {
48
49     text-align: left;
50     background: white;
51 }
52
53 .resume_table {
54
55 }
56
57 .resume_header_entry {
58     
59     color: black;
60 }
61
62 .resume_number_entry {
63
64     color: darkred;
65     font-weight: bold;
66     text-align: right;
67 }
68
69 .ranges_table {
70
71     border-spacing: 0px;
72     border-bottom: solid 2px black;
73     border-top: solid 2px black;
74     border-left: solid 2px black;
75     border-right: solid 2px black;
76 }
77
78 .ranges_header_entry {
79
80     padding: 5px;
81     border-bottom: solid 1px black;
82     font-size: 1em;
83     font-weight: bold;
84     color: darkred;
85     text-align: left;
86 }
87
88 .ranges_entry {
89
90 }
91
92 .ranges_entry_simple {
93
94     background: #87ff75; 
95
96 }
97
98 .ranges_entry_moderate {
99
100     background: #fffc60;
101
102 }
103
104 .ranges_entry_high {
105
106     background: #ff5a5d;
107
108 }
109
110 .ranges_entry_untestable {
111
112     background: #993300
113
114 }
115
116
117 .function_table {
118
119     border-spacing: 0px;
120     border-bottom: solid 2px black;
121     border-top: solid 2px black;
122     border-left: solid 2px black;
123     border-right: solid 2px black;
124 }
125
126 .function_table_caption {
127
128     font-size: 1.1em;
129     font-weight: bold;
130     color: black;
131     padding: 5px;
132 }
133
134 .function_table_header {
135     
136 }
137
138
139 .function_table_header_entry {
140
141     padding: 5px;
142     border-bottom: solid 1px black;
143     font-size: 1em;
144     font-weight: bold;
145     color: darkred;
146     text-align: left;
147 }
148
149 .function_entry {
150
151
152 }
153
154
155 .function_entry_simple {
156
157     background: #87ff75; 
158
159 }
160
161 .function_entry_moderate {
162
163     background: #fffc60;
164
165 }
166
167 .function_entry_high {
168
169     background: #ff5a5d;
170
171 }
172
173 .function_entry_untestable {
174
175     background: #993300
176
177 }
178
179
180 .function_entry_name {
181
182     font-size: 1em;
183     text-align: left;
184     font-weight: bold;
185     text-valign: top;
186
187     border-top: solid 1px black;
188     padding: 3px;
189 }
190
191 .function_entry_cyclo {
192
193     font-size: 1em;
194     text-align: right;
195     text-valign: top;
196
197     border-top: solid 1px black;
198     padding: 3px;
199 }
200
201 .function_entry_number {
202
203     font-size: 1em;
204     text-align: right;
205     text-valign: top;
206
207     border-top: solid 1px black;
208     padding: 3px;
209 }
210
211 .function_entry_filename {
212
213     font-size: 1em;
214     text-align: left;
215     text-valign: top;
216
217     border-top: solid 1px black;
218     padding: 3px;
219 }
220
221 .sidemenu {
222     
223     border: 1px black solid;
224     padding: 5px;
225
226 }
227
228 .sidemenuheader {
229  
230     color: darkred;
231     font-size: 1.1em;
232     font-weight: bold;
233     border-bottom: 1px dashed darkred;
234 }
235
236 .sidemenuentry {
237
238
239 }
240
241 .menu {
242
243 }
244
245 -->
246 </style />
247 </head>
248 <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
249 <a href="http://www.gnu.org/software/libtasn1/">Back to GNU Libtasn1 Homepage</a><br/><br/>
250 <div class="page_title">GNU Libtasn1 Cyclomatic Complexity Report</div>
251 <p>Report generated at: <span class="report_timestamp">Thu May 20 15:04:33 CEST 2010</div></p>
252 <div class="section_title">Resume</div>
253 <br/>
254 <table class="resume_table">
255 <tr>
256 <td class="resume_header_entry">
257 Total number of functions
258 </td>
259 <td class="resume_number_entry">
260 98
261 </td>
262 </tr>
263 <tr>
264 <td class="resume_header_entry">
265 Number of low risk functions
266 </td>
267 <td class="resume_number_entry">
268 64
269 </td>
270 </tr>
271 <tr>
272 <td class="resume_header_entry">
273 Number of moderate risk functions
274 </td>
275 <td class="resume_number_entry">
276 17
277 </td>
278 </tr>
279 <tr>
280 <td class="resume_header_entry">
281 Number of high risk functions
282 </td>
283 <td class="resume_number_entry">
284 10
285 </td>
286 </tr>
287 <tr>
288 <td class="resume_header_entry">
289 Number of untestable functions
290 </td>
291 <td class="resume_number_entry">
292 7
293 </td>
294 </tr>
295 </table>
296 <br/>
297 <div class="section_title">Details for all functions</div>
298 <p>Used ranges:</p>
299 <table class="ranges_table">
300 <tr>
301 <td class="ranges_header_entry">
302 &nbsp;
303 </td>
304 <td class="ranges_header_entry">
305 Cyclomatic Complexity
306 </td>
307 <td class="ranges_header_entry">
308 Risk Evaluation
309 </td>
310 </tr>
311 <tr>
312 <td class="ranges_entry_simple">
313 &nbsp;
314 </td>
315 <td class="ranges_entry">
316 0 - 10
317 </td>
318 <td class="ranges_entry">
319 Simple module, without much risk
320 </td>
321 </tr>
322 <tr>
323 <td class="ranges_entry_moderate">
324 &nbsp;
325 </td>
326 <td class="ranges_entry">
327 11 - 20
328 </td>
329 <td class="ranges_entry">
330 More complex module, moderate risk
331 </td>
332 </tr>
333 <tr>
334 <td class="ranges_entry_high">
335 &nbsp;
336 </td>
337 <td class="ranges_entry">
338 21 - 50
339 </td>
340 <td class="ranges_entry">
341 Complex module, high risk
342 </td>
343 </tr>
344 <tr>
345 <td class="ranges_entry_untestable">
346 &nbsp;
347 </td>
348 <td class="ranges_entry">
349 greater than 50
350 </td>
351 <td class="ranges_entry">
352 Untestable module, very high risk
353 </td>
354 </tr>
355 </table>
356 <br/>
357 <table width="90%" class="function_table" cellpadding="0" cellspacing="0">
358 <tr class="function_table_header">
359 <td class="function_table_header_entry">
360
361 </td>
362 <td class="function_table_header_entry">
363 Function Name
364 </td>
365 <td class="function_table_header_entry">
366 Cyclomatic
367 <br/>
368 Complexity
369 </td>
370 <td class="function_table_header_entry">
371 Number of
372 <br/>
373 Statements
374 </td>
375 <td class="function_table_header_entry">
376 Number of
377 <br/>
378 Lines
379 </td>
380 <td class="function_table_header_entry">
381 Source File
382 </td>
383 </tr>
384 <tr class="function_entry_untestable">
385 <td class="function_entry_filename">
386 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('asn1_der_decoding_element_src', 'asn1_der_decoding_element_button')"><span id="asn1_der_decoding_element_button">&darr;</span></a>
387 </td>
388 <td class="function_entry_name">
389 asn1_der_decoding_element
390 </td>
391 <td class="function_entry_cyclo">
392 155
393 </td>
394 <td class="function_entry_number">
395 401
396 </td>
397 <td class="function_entry_number">
398 744
399 </td>
400 <td class="function_entry_filename">
401 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/decoding.c;hb=HEAD">lib/decoding.c</a>
402 </td>
403 </tr>
404 <tr>
405 <td colspan="6" height="0">
406 <div id="asn1_der_decoding_element_src" class="function_src" style="position: relative; display: none;">
407 <pre class="function_src">
408 asn1_retCode
409 asn1_der_decoding_element (ASN1_TYPE * structure, const char *elementName,
410                            const void *ider, int len, char *errorDescription)
411 {
412   ASN1_TYPE node, p, p2, p3, nodeFound = ASN1_TYPE_EMPTY;
413   char temp[128], currentName[ASN1_MAX_NAME_SIZE * 10], *dot_p, *char_p;
414   int nameLen = ASN1_MAX_NAME_SIZE * 10 - 1, state;
415   int counter, len2, len3, len4, move, ris, tlen;
416   unsigned char class, *temp2;
417   unsigned long tag;
418   int indefinite, result;
419   const unsigned char *der = ider;
420
421   node = *structure;
422
423   if (node == ASN1_TYPE_EMPTY)
424     return ASN1_ELEMENT_NOT_FOUND;
425
426   if (elementName == NULL)
427     {
428       asn1_delete_structure (structure);
429       return ASN1_ELEMENT_NOT_FOUND;
430     }
431
432   if (node->type &amp; CONST_OPTION)
433     {
434       asn1_delete_structure (structure);
435       return ASN1_GENERIC_ERROR;
436     }
437
438   if ((*structure)->name)
439     {                           /* Has *structure got a name? */
440       nameLen -= strlen ((*structure)->name);
441       if (nameLen > 0)
442         strcpy (currentName, (*structure)->name);
443       else
444         {
445           asn1_delete_structure (structure);
446           return ASN1_MEM_ERROR;
447         }
448       if (!(strcmp (currentName, elementName)))
449         {
450           state = FOUND;
451           nodeFound = *structure;
452         }
453       else if (!memcmp (currentName, elementName, strlen (currentName)))
454         state = SAME_BRANCH;
455       else
456         state = OTHER_BRANCH;
457     }
458   else
459     {                           /* *structure doesn't have a name? */
460       currentName[0] = 0;
461       if (elementName[0] == 0)
462         {
463           state = FOUND;
464           nodeFound = *structure;
465         }
466       else
467         {
468           state = SAME_BRANCH;
469         }
470     }
471
472   counter = 0;
473   move = DOWN;
474   p = node;
475   while (1)
476     {
477
478       ris = ASN1_SUCCESS;
479
480       if (move != UP)
481         {
482           if (p->type &amp; CONST_SET)
483             {
484               p2 = _asn1_find_up (p);
485               len2 = strtol (p2->value, NULL, 10);
486               if (counter == len2)
487                 {
488                   p = p2;
489                   move = UP;
490                   continue;
491                 }
492               else if (counter > len2)
493                 {
494                   asn1_delete_structure (structure);
495                   return ASN1_DER_ERROR;
496                 }
497               p2 = p2->down;
498               while (p2)
499                 {
500                   if ((p2->type &amp; CONST_SET) && (p2->type & CONST_NOT_USED))
501                     {
502                       if (type_field (p2->type) != TYPE_CHOICE)
503                         ris =
504                           _asn1_extract_tag_der (p2, der + counter,
505                                                  len - counter, &amp;len2);
506                       else
507                         {
508                           p3 = p2->down;
509                           while (p3)
510                             {
511                               ris =
512                                 _asn1_extract_tag_der (p3, der + counter,
513                                                        len - counter, &amp;len2);
514                               if (ris == ASN1_SUCCESS)
515                                 break;
516                               p3 = p3->right;
517                             }
518                         }
519                       if (ris == ASN1_SUCCESS)
520                         {
521                           p2->type &amp;= ~CONST_NOT_USED;
522                           p = p2;
523                           break;
524                         }
525                     }
526                   p2 = p2->right;
527                 }
528               if (p2 == NULL)
529                 {
530                   asn1_delete_structure (structure);
531                   return ASN1_DER_ERROR;
532                 }
533             }
534
535           if ((p->type &amp; CONST_OPTION) || (p->type & CONST_DEFAULT))
536             {
537               p2 = _asn1_find_up (p);
538               len2 = strtol (p2->value, NULL, 10);
539               if (counter == len2)
540                 {
541                   if (p->right)
542                     {
543                       p2 = p->right;
544                       move = RIGHT;
545                     }
546                   else
547                     move = UP;
548
549                   if (p->type &amp; CONST_OPTION)
550                     asn1_delete_structure (&amp;p);
551
552                   p = p2;
553                   continue;
554                 }
555             }
556
557           if (type_field (p->type) == TYPE_CHOICE)
558             {
559               while (p->down)
560                 {
561                   if (counter < len)
562                     ris =
563                       _asn1_extract_tag_der (p->down, der + counter,
564                                              len - counter, &amp;len2);
565                   else
566                     ris = ASN1_DER_ERROR;
567                   if (ris == ASN1_SUCCESS)
568                     {
569                       while (p->down->right)
570                         {
571                           p2 = p->down->right;
572                           asn1_delete_structure (&amp;p2);
573                         }
574                       break;
575                     }
576                   else if (ris == ASN1_ERROR_TYPE_ANY)
577                     {
578                       asn1_delete_structure (structure);
579                       return ASN1_ERROR_TYPE_ANY;
580                     }
581                   else
582                     {
583                       p2 = p->down;
584                       asn1_delete_structure (&amp;p2);
585                     }
586                 }
587
588               if (p->down == NULL)
589                 {
590                   if (!(p->type &amp; CONST_OPTION))
591                     {
592                       asn1_delete_structure (structure);
593                       return ASN1_DER_ERROR;
594                     }
595                 }
596               else
597                 p = p->down;
598             }
599
600           if ((p->type &amp; CONST_OPTION) || (p->type & CONST_DEFAULT))
601             {
602               p2 = _asn1_find_up (p);
603               len2 = strtol (p2->value, NULL, 10);
604               if (counter > len2)
605                 ris = ASN1_TAG_ERROR;
606             }
607
608           if (ris == ASN1_SUCCESS)
609             ris =
610               _asn1_extract_tag_der (p, der + counter, len - counter, &amp;len2);
611           if (ris != ASN1_SUCCESS)
612             {
613               if (p->type &amp; CONST_OPTION)
614                 {
615                   p->type |= CONST_NOT_USED;
616                   move = RIGHT;
617                 }
618               else if (p->type &amp; CONST_DEFAULT)
619                 {
620                   _asn1_set_value (p, NULL, 0);
621                   move = RIGHT;
622                 }
623               else
624                 {
625                   if (errorDescription != NULL)
626                     _asn1_error_description_tag_error (p, errorDescription);
627
628                   asn1_delete_structure (structure);
629                   return ASN1_TAG_ERROR;
630                 }
631             }
632           else
633             counter += len2;
634         }
635
636       if (ris == ASN1_SUCCESS)
637         {
638           switch (type_field (p->type))
639             {
640             case TYPE_NULL:
641               if (der[counter])
642                 {
643                   asn1_delete_structure (structure);
644                   return ASN1_DER_ERROR;
645                 }
646
647               if (p == nodeFound)
648                 state = EXIT;
649
650               counter++;
651               move = RIGHT;
652               break;
653             case TYPE_BOOLEAN:
654               if (der[counter++] != 1)
655                 {
656                   asn1_delete_structure (structure);
657                   return ASN1_DER_ERROR;
658                 }
659
660               if (state == FOUND)
661                 {
662                   if (der[counter++] == 0)
663                     _asn1_set_value (p, "F", 1);
664                   else
665                     _asn1_set_value (p, "T", 1);
666
667                   if (p == nodeFound)
668                     state = EXIT;
669
670                 }
671               else
672                 counter++;
673
674               move = RIGHT;
675               break;
676             case TYPE_INTEGER:
677             case TYPE_ENUMERATED:
678               len2 =
679                 asn1_get_length_der (der + counter, len - counter, &amp;len3);
680               if (len2 < 0)
681                 return ASN1_DER_ERROR;
682               if (state == FOUND)
683                 {
684                   if (len3 + len2 > len - counter)
685                     return ASN1_DER_ERROR;
686                   _asn1_set_value (p, der + counter, len3 + len2);
687
688                   if (p == nodeFound)
689                     state = EXIT;
690                 }
691               counter += len3 + len2;
692               move = RIGHT;
693               break;
694             case TYPE_OBJECT_ID:
695               if (state == FOUND)
696                 {
697                   result =
698                     _asn1_get_objectid_der (der + counter, len - counter,
699                                             &amp;len2, temp, sizeof (temp));
700                   if (result != ASN1_SUCCESS)
701                     {
702                       return result;
703                     }
704
705                   tlen = strlen (temp);
706
707                   if (tlen > 0)
708                     _asn1_set_value (p, temp, tlen + 1);
709
710                   if (p == nodeFound)
711                     state = EXIT;
712                 }
713               else
714                 {
715                   len2 =
716                     asn1_get_length_der (der + counter, len - counter, &amp;len3);
717                   if (len2 < 0)
718                     return ASN1_DER_ERROR;
719                   len2 += len3;
720                 }
721
722               counter += len2;
723               move = RIGHT;
724               break;
725             case TYPE_TIME:
726               if (state == FOUND)
727                 {
728                   result =
729                     _asn1_get_time_der (der + counter, len - counter, &amp;len2,
730                                         temp, sizeof (temp) - 1);
731                   if (result != ASN1_SUCCESS)
732                     {
733                       asn1_delete_structure (structure);
734                       return result;
735                     }
736
737                   tlen = strlen (temp);
738                   if (tlen > 0)
739                     _asn1_set_value (p, temp, tlen + 1);
740
741                   if (p == nodeFound)
742                     state = EXIT;
743                 }
744               else
745                 {
746                   len2 =
747                     asn1_get_length_der (der + counter, len - counter, &amp;len3);
748                   if (len2 < 0)
749                     return ASN1_DER_ERROR;
750                   len2 += len3;
751                 }
752
753               counter += len2;
754               move = RIGHT;
755               break;
756             case TYPE_OCTET_STRING:
757               len3 = len - counter;
758               if (state == FOUND)
759                 {
760                   ris = _asn1_get_octet_string (der + counter, p, &amp;len3);
761                   if (p == nodeFound)
762                     state = EXIT;
763                 }
764               else
765                 ris = _asn1_get_octet_string (der + counter, NULL, &amp;len3);
766
767               if (ris != ASN1_SUCCESS)
768                 return ris;
769               counter += len3;
770               move = RIGHT;
771               break;
772             case TYPE_GENERALSTRING:
773               len2 =
774                 asn1_get_length_der (der + counter, len - counter, &amp;len3);
775               if (len2 < 0)
776                 return ASN1_DER_ERROR;
777               if (state == FOUND)
778                 {
779                   if (len3 + len2 > len - counter)
780                     return ASN1_DER_ERROR;
781                   _asn1_set_value (p, der + counter, len3 + len2);
782
783                   if (p == nodeFound)
784                     state = EXIT;
785                 }
786               counter += len3 + len2;
787               move = RIGHT;
788               break;
789             case TYPE_BIT_STRING:
790               len2 =
791                 asn1_get_length_der (der + counter, len - counter, &amp;len3);
792               if (len2 < 0)
793                 return ASN1_DER_ERROR;
794               if (state == FOUND)
795                 {
796                   if (len3 + len2 > len - counter)
797                     return ASN1_DER_ERROR;
798                   _asn1_set_value (p, der + counter, len3 + len2);
799
800                   if (p == nodeFound)
801                     state = EXIT;
802                 }
803               counter += len3 + len2;
804               move = RIGHT;
805               break;
806             case TYPE_SEQUENCE:
807             case TYPE_SET:
808               if (move == UP)
809                 {
810                   len2 = strtol (p->value, NULL, 10);
811                   _asn1_set_value (p, NULL, 0);
812                   if (len2 == -1)
813                     {           /* indefinite length method */
814                       if ((der[counter]) || der[counter + 1])
815                         {
816                           asn1_delete_structure (structure);
817                           return ASN1_DER_ERROR;
818                         }
819                       counter += 2;
820                     }
821                   else
822                     {           /* definite length method */
823                       if (len2 != counter)
824                         {
825                           asn1_delete_structure (structure);
826                           return ASN1_DER_ERROR;
827                         }
828                     }
829                   if (p == nodeFound)
830                     state = EXIT;
831                   move = RIGHT;
832                 }
833               else
834                 {               /* move==DOWN || move==RIGHT */
835                   if (state == OTHER_BRANCH)
836                     {
837                       len3 =
838                         asn1_get_length_der (der + counter, len - counter,
839                                              &amp;len2);
840                       if (len3 < 0)
841                         return ASN1_DER_ERROR;
842                       counter += len2 + len3;
843                       move = RIGHT;
844                     }
845                   else
846                     {           /*  state==SAME_BRANCH or state==FOUND */
847                       len3 =
848                         asn1_get_length_der (der + counter, len - counter,
849                                              &amp;len2);
850                       if (len3 < 0)
851                         return ASN1_DER_ERROR;
852                       counter += len2;
853                       if (len3 > 0)
854                         {
855                           _asn1_ltostr (counter + len3, temp);
856                           tlen = strlen (temp);
857
858                           if (tlen > 0)
859                             _asn1_set_value (p, temp, tlen + 1);
860                           move = DOWN;
861                         }
862                       else if (len3 == 0)
863                         {
864                           p2 = p->down;
865                           while (p2)
866                             {
867                               if (type_field (p2->type) != TYPE_TAG)
868                                 {
869                                   p3 = p2->right;
870                                   asn1_delete_structure (&amp;p2);
871                                   p2 = p3;
872                                 }
873                               else
874                                 p2 = p2->right;
875                             }
876                           move = RIGHT;
877                         }
878                       else
879                         {       /* indefinite length method */
880                           _asn1_set_value (p, "-1", 3);
881                           move = DOWN;
882                         }
883                     }
884                 }
885               break;
886             case TYPE_SEQUENCE_OF:
887             case TYPE_SET_OF:
888               if (move == UP)
889                 {
890                   len2 = strtol (p->value, NULL, 10);
891                   if (len2 > counter)
892                     {
893                       _asn1_append_sequence_set (p);
894                       p = p->down;
895                       while (p->right)
896                         p = p->right;
897                       move = RIGHT;
898                       continue;
899                     }
900                   _asn1_set_value (p, NULL, 0);
901                   if (len2 != counter)
902                     {
903                       asn1_delete_structure (structure);
904                       return ASN1_DER_ERROR;
905                     }
906
907                   if (p == nodeFound)
908                     state = EXIT;
909                 }
910               else
911                 {               /* move==DOWN || move==RIGHT */
912                   if (state == OTHER_BRANCH)
913                     {
914                       len3 =
915                         asn1_get_length_der (der + counter, len - counter,
916                                              &amp;len2);
917                       if (len3 < 0)
918                         return ASN1_DER_ERROR;
919                       counter += len2 + len3;
920                       move = RIGHT;
921                     }
922                   else
923                     {           /* state==FOUND or state==SAME_BRANCH */
924                       len3 =
925                         asn1_get_length_der (der + counter, len - counter,
926                                              &amp;len2);
927                       if (len3 < 0)
928                         return ASN1_DER_ERROR;
929                       counter += len2;
930                       if (len3)
931                         {
932                           _asn1_ltostr (counter + len3, temp);
933                           tlen = strlen (temp);
934
935                           if (tlen > 0)
936                             _asn1_set_value (p, temp, tlen + 1);
937                           p2 = p->down;
938                           while ((type_field (p2->type) == TYPE_TAG)
939                                  || (type_field (p2->type) == TYPE_SIZE))
940                             p2 = p2->right;
941                           if (p2->right == NULL)
942                             _asn1_append_sequence_set (p);
943                           p = p2;
944                           state = FOUND;
945                         }
946                     }
947                 }
948
949               break;
950             case TYPE_ANY:
951               if (asn1_get_tag_der
952                   (der + counter, len - counter, &amp;class, &len2,
953                    &amp;tag) != ASN1_SUCCESS)
954                 return ASN1_DER_ERROR;
955               if (counter + len2 > len)
956                 return ASN1_DER_ERROR;
957
958               len4 =
959                 asn1_get_length_der (der + counter + len2,
960                                      len - counter - len2, &amp;len3);
961               if (len4 < -1)
962                 return ASN1_DER_ERROR;
963
964               if (len4 != -1)
965                 {
966                   len2 += len4;
967                   if (state == FOUND)
968                     {
969                       _asn1_set_value_octet (p, der + counter, len2 + len3);
970                       temp2 = NULL;
971
972                       if (p == nodeFound)
973                         state = EXIT;
974                     }
975                   counter += len2 + len3;
976                 }
977               else
978                 {               /* indefinite length */
979                   /* Check indefinite lenth method in an EXPLICIT TAG */
980                   if ((p->type &amp; CONST_TAG) && (der[counter - 1] == 0x80))
981                     indefinite = 1;
982                   else
983                     indefinite = 0;
984
985                   len2 = len - counter;
986                   ris =
987                     _asn1_get_indefinite_length_string (der + counter, &amp;len2);
988                   if (ris != ASN1_SUCCESS)
989                     {
990                       asn1_delete_structure (structure);
991                       return ris;
992                     }
993
994                   if (state == FOUND)
995                     {
996                       _asn1_set_value_octet (p, der + counter, len2);
997
998                       if (p == nodeFound)
999                         state = EXIT;
1000                     }
1001
1002                   counter += len2;
1003
1004                   /* Check if a couple of 0x00 are present due to an EXPLICIT TAG with
1005                      an indefinite length method. */
1006                   if (indefinite)
1007                     {
1008                       if (!der[counter] &amp;& !der[counter + 1])
1009                         {
1010                           counter += 2;
1011                         }
1012                       else
1013                         {
1014                           asn1_delete_structure (structure);
1015                           return ASN1_DER_ERROR;
1016                         }
1017                     }
1018                 }
1019               move = RIGHT;
1020               break;
1021
1022             default:
1023               move = (move == UP) ? RIGHT : DOWN;
1024               break;
1025             }
1026         }
1027
1028       if ((p == node &amp;& move != DOWN) || (state == EXIT))
1029         break;
1030
1031       if (move == DOWN)
1032         {
1033           if (p->down)
1034             {
1035               p = p->down;
1036
1037               if (state != FOUND)
1038                 {
1039                   nameLen -= strlen (p->name) + 1;
1040                   if (nameLen > 0)
1041                     {
1042                       if (currentName[0])
1043                         strcat (currentName, ".");
1044                       strcat (currentName, p->name);
1045                     }
1046                   else
1047                     {
1048                       asn1_delete_structure (structure);
1049                       return ASN1_MEM_ERROR;
1050                     }
1051                   if (!(strcmp (currentName, elementName)))
1052                     {
1053                       state = FOUND;
1054                       nodeFound = p;
1055                     }
1056                   else
1057                     if (!memcmp
1058                         (currentName, elementName, strlen (currentName)))
1059                     state = SAME_BRANCH;
1060                   else
1061                     state = OTHER_BRANCH;
1062                 }
1063             }
1064           else
1065             move = RIGHT;
1066         }
1067
1068       if ((move == RIGHT) &amp;& !(p->type & CONST_SET))
1069         {
1070           if (p->right)
1071             {
1072               p = p->right;
1073
1074               if (state != FOUND)
1075                 {
1076                   dot_p = char_p = currentName;
1077                   while ((char_p = strchr (char_p, '.')))
1078                     {
1079                       dot_p = char_p++;
1080                       dot_p++;
1081                     }
1082
1083                   nameLen += strlen (currentName) - (dot_p - currentName);
1084                   *dot_p = 0;
1085
1086                   nameLen -= strlen (p->name);
1087                   if (nameLen > 0)
1088                     strcat (currentName, p->name);
1089                   else
1090                     {
1091                       asn1_delete_structure (structure);
1092                       return ASN1_MEM_ERROR;
1093                     }
1094
1095                   if (!(strcmp (currentName, elementName)))
1096                     {
1097                       state = FOUND;
1098                       nodeFound = p;
1099                     }
1100                   else
1101                     if (!memcmp
1102                         (currentName, elementName, strlen (currentName)))
1103                     state = SAME_BRANCH;
1104                   else
1105                     state = OTHER_BRANCH;
1106                 }
1107             }
1108           else
1109             move = UP;
1110         }
1111
1112       if (move == UP)
1113         {
1114           p = _asn1_find_up (p);
1115
1116           if (state != FOUND)
1117             {
1118               dot_p = char_p = currentName;
1119               while ((char_p = strchr (char_p, '.')))
1120                 {
1121                   dot_p = char_p++;
1122                   dot_p++;
1123                 }
1124
1125               nameLen += strlen (currentName) - (dot_p - currentName);
1126               *dot_p = 0;
1127
1128               if (!(strcmp (currentName, elementName)))
1129                 {
1130                   state = FOUND;
1131                   nodeFound = p;
1132                 }
1133               else
1134                 if (!memcmp (currentName, elementName, strlen (currentName)))
1135                 state = SAME_BRANCH;
1136               else
1137                 state = OTHER_BRANCH;
1138             }
1139         }
1140     }
1141
1142   _asn1_delete_not_used (*structure);
1143
1144   if (counter > len)
1145     {
1146       asn1_delete_structure (structure);
1147       return ASN1_DER_ERROR;
1148     }
1149
1150   return ASN1_SUCCESS;
1151 }
1152 </pre>
1153 </div>
1154 </td>
1155 </tr>
1156 <tr class="function_entry_untestable">
1157 <td class="function_entry_filename">
1158 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('asn1_der_decoding_src', 'asn1_der_decoding_button')"><span id="asn1_der_decoding_button">&darr;</span></a>
1159 </td>
1160 <td class="function_entry_name">
1161 asn1_der_decoding
1162 </td>
1163 <td class="function_entry_cyclo">
1164 119
1165 </td>
1166 <td class="function_entry_number">
1167 304
1168 </td>
1169 <td class="function_entry_number">
1170 527
1171 </td>
1172 <td class="function_entry_filename">
1173 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/decoding.c;hb=HEAD">lib/decoding.c</a>
1174 </td>
1175 </tr>
1176 <tr>
1177 <td colspan="6" height="0">
1178 <div id="asn1_der_decoding_src" class="function_src" style="position: relative; display: none;">
1179 <pre class="function_src">
1180 asn1_retCode
1181 asn1_der_decoding (ASN1_TYPE * element, const void *ider, int len,
1182                    char *errorDescription)
1183 {
1184   ASN1_TYPE node, p, p2, p3;
1185   char temp[128];
1186   int counter, len2, len3, len4, move, ris, tlen;
1187   unsigned char class;
1188   unsigned long tag;
1189   int indefinite, result;
1190   const unsigned char *der = ider;
1191
1192   node = *element;
1193
1194   if (node == ASN1_TYPE_EMPTY)
1195     return ASN1_ELEMENT_NOT_FOUND;
1196
1197   if (node->type &amp; CONST_OPTION)
1198     {
1199       asn1_delete_structure (element);
1200       return ASN1_GENERIC_ERROR;
1201     }
1202
1203   counter = 0;
1204   move = DOWN;
1205   p = node;
1206   while (1)
1207     {
1208       ris = ASN1_SUCCESS;
1209       if (move != UP)
1210         {
1211           if (p->type &amp; CONST_SET)
1212             {
1213               p2 = _asn1_find_up (p);
1214               len2 = strtol (p2->value, NULL, 10);
1215               if (len2 == -1)
1216                 {
1217                   if (!der[counter] &amp;& !der[counter + 1])
1218                     {
1219                       p = p2;
1220                       move = UP;
1221                       counter += 2;
1222                       continue;
1223                     }
1224                 }
1225               else if (counter == len2)
1226                 {
1227                   p = p2;
1228                   move = UP;
1229                   continue;
1230                 }
1231               else if (counter > len2)
1232                 {
1233                   asn1_delete_structure (element);
1234                   return ASN1_DER_ERROR;
1235                 }
1236               p2 = p2->down;
1237               while (p2)
1238                 {
1239                   if ((p2->type &amp; CONST_SET) && (p2->type & CONST_NOT_USED))
1240                     {
1241                       if (type_field (p2->type) != TYPE_CHOICE)
1242                         ris =
1243                           _asn1_extract_tag_der (p2, der + counter,
1244                                                  len - counter, &amp;len2);
1245                       else
1246                         {
1247                           p3 = p2->down;
1248                           while (p3)
1249                             {
1250                               ris =
1251                                 _asn1_extract_tag_der (p3, der + counter,
1252                                                        len - counter, &amp;len2);
1253                               if (ris == ASN1_SUCCESS)
1254                                 break;
1255                               p3 = p3->right;
1256                             }
1257                         }
1258                       if (ris == ASN1_SUCCESS)
1259                         {
1260                           p2->type &amp;= ~CONST_NOT_USED;
1261                           p = p2;
1262                           break;
1263                         }
1264                     }
1265                   p2 = p2->right;
1266                 }
1267               if (p2 == NULL)
1268                 {
1269                   asn1_delete_structure (element);
1270                   return ASN1_DER_ERROR;
1271                 }
1272             }
1273
1274           if ((p->type &amp; CONST_OPTION) || (p->type & CONST_DEFAULT))
1275             {
1276               p2 = _asn1_find_up (p);
1277               len2 = strtol (p2->value, NULL, 10);
1278               if (counter == len2)
1279                 {
1280                   if (p->right)
1281                     {
1282                       p2 = p->right;
1283                       move = RIGHT;
1284                     }
1285                   else
1286                     move = UP;
1287
1288                   if (p->type &amp; CONST_OPTION)
1289                     asn1_delete_structure (&amp;p);
1290
1291                   p = p2;
1292                   continue;
1293                 }
1294             }
1295
1296           if (type_field (p->type) == TYPE_CHOICE)
1297             {
1298               while (p->down)
1299                 {
1300                   if (counter < len)
1301                     ris =
1302                       _asn1_extract_tag_der (p->down, der + counter,
1303                                              len - counter, &amp;len2);
1304                   else
1305                     ris = ASN1_DER_ERROR;
1306                   if (ris == ASN1_SUCCESS)
1307                     {
1308                       while (p->down->right)
1309                         {
1310                           p2 = p->down->right;
1311                           asn1_delete_structure (&amp;p2);
1312                         }
1313                       break;
1314                     }
1315                   else if (ris == ASN1_ERROR_TYPE_ANY)
1316                     {
1317                       asn1_delete_structure (element);
1318                       return ASN1_ERROR_TYPE_ANY;
1319                     }
1320                   else
1321                     {
1322                       p2 = p->down;
1323                       asn1_delete_structure (&amp;p2);
1324                     }
1325                 }
1326
1327               if (p->down == NULL)
1328                 {
1329                   if (!(p->type &amp; CONST_OPTION))
1330                     {
1331                       asn1_delete_structure (element);
1332                       return ASN1_DER_ERROR;
1333                     }
1334                 }
1335               else
1336                 p = p->down;
1337             }
1338
1339           if ((p->type &amp; CONST_OPTION) || (p->type & CONST_DEFAULT))
1340             {
1341               p2 = _asn1_find_up (p);
1342               len2 = strtol (p2->value, NULL, 10);
1343               if ((len2 != -1) &amp;& (counter > len2))
1344                 ris = ASN1_TAG_ERROR;
1345             }
1346
1347           if (ris == ASN1_SUCCESS)
1348             ris =
1349               _asn1_extract_tag_der (p, der + counter, len - counter, &amp;len2);
1350           if (ris != ASN1_SUCCESS)
1351             {
1352               if (p->type &amp; CONST_OPTION)
1353                 {
1354                   p->type |= CONST_NOT_USED;
1355                   move = RIGHT;
1356                 }
1357               else if (p->type &amp; CONST_DEFAULT)
1358                 {
1359                   _asn1_set_value (p, NULL, 0);
1360                   move = RIGHT;
1361                 }
1362               else
1363                 {
1364                   if (errorDescription != NULL)
1365                     _asn1_error_description_tag_error (p, errorDescription);
1366
1367                   asn1_delete_structure (element);
1368                   return ASN1_TAG_ERROR;
1369                 }
1370             }
1371           else
1372             counter += len2;
1373         }
1374
1375       if (ris == ASN1_SUCCESS)
1376         {
1377           switch (type_field (p->type))
1378             {
1379             case TYPE_NULL:
1380               if (der[counter])
1381                 {
1382                   asn1_delete_structure (element);
1383                   return ASN1_DER_ERROR;
1384                 }
1385               counter++;
1386               move = RIGHT;
1387               break;
1388             case TYPE_BOOLEAN:
1389               if (der[counter++] != 1)
1390                 {
1391                   asn1_delete_structure (element);
1392                   return ASN1_DER_ERROR;
1393                 }
1394               if (der[counter++] == 0)
1395                 _asn1_set_value (p, "F", 1);
1396               else
1397                 _asn1_set_value (p, "T", 1);
1398               move = RIGHT;
1399               break;
1400             case TYPE_INTEGER:
1401             case TYPE_ENUMERATED:
1402               len2 =
1403                 asn1_get_length_der (der + counter, len - counter, &amp;len3);
1404               if (len2 < 0)
1405                 return ASN1_DER_ERROR;
1406               if (len2 + len3 > len - counter)
1407                 return ASN1_DER_ERROR;
1408               _asn1_set_value (p, der + counter, len3 + len2);
1409               counter += len3 + len2;
1410               move = RIGHT;
1411               break;
1412             case TYPE_OBJECT_ID:
1413               result =
1414                 _asn1_get_objectid_der (der + counter, len - counter, &amp;len2,
1415                                         temp, sizeof (temp));
1416               if (result != ASN1_SUCCESS)
1417                 {
1418                   asn1_delete_structure (element);
1419                   return result;
1420                 }
1421
1422               tlen = strlen (temp);
1423               if (tlen > 0)
1424                 _asn1_set_value (p, temp, tlen + 1);
1425               counter += len2;
1426               move = RIGHT;
1427               break;
1428             case TYPE_TIME:
1429               result =
1430                 _asn1_get_time_der (der + counter, len - counter, &amp;len2, temp,
1431                                     sizeof (temp) - 1);
1432               if (result != ASN1_SUCCESS)
1433                 {
1434                   asn1_delete_structure (element);
1435                   return result;
1436                 }
1437               tlen = strlen (temp);
1438               if (tlen > 0)
1439                 _asn1_set_value (p, temp, tlen + 1);
1440               counter += len2;
1441               move = RIGHT;
1442               break;
1443             case TYPE_OCTET_STRING:
1444               len3 = len - counter;
1445               ris = _asn1_get_octet_string (der + counter, p, &amp;len3);
1446               if (ris != ASN1_SUCCESS)
1447                 return ris;
1448               counter += len3;
1449               move = RIGHT;
1450               break;
1451             case TYPE_GENERALSTRING:
1452               len2 =
1453                 asn1_get_length_der (der + counter, len - counter, &amp;len3);
1454               if (len2 < 0)
1455                 return ASN1_DER_ERROR;
1456               if (len3 + len2 > len - counter)
1457                 return ASN1_DER_ERROR;
1458               _asn1_set_value (p, der + counter, len3 + len2);
1459               counter += len3 + len2;
1460               move = RIGHT;
1461               break;
1462             case TYPE_BIT_STRING:
1463               len2 =
1464                 asn1_get_length_der (der + counter, len - counter, &amp;len3);
1465               if (len2 < 0)
1466                 return ASN1_DER_ERROR;
1467               if (len3 + len2 > len - counter)
1468                 return ASN1_DER_ERROR;
1469               _asn1_set_value (p, der + counter, len3 + len2);
1470               counter += len3 + len2;
1471               move = RIGHT;
1472               break;
1473             case TYPE_SEQUENCE:
1474             case TYPE_SET:
1475               if (move == UP)
1476                 {
1477                   len2 = strtol (p->value, NULL, 10);
1478                   _asn1_set_value (p, NULL, 0);
1479                   if (len2 == -1)
1480                     {           /* indefinite length method */
1481                       if (len - counter + 1 > 0)
1482                         {
1483                           if ((der[counter]) || der[counter + 1])
1484                             {
1485                               asn1_delete_structure (element);
1486                               return ASN1_DER_ERROR;
1487                             }
1488                         }
1489                       else
1490                         return ASN1_DER_ERROR;
1491                       counter += 2;
1492                     }
1493                   else
1494                     {           /* definite length method */
1495                       if (len2 != counter)
1496                         {
1497                           asn1_delete_structure (element);
1498                           return ASN1_DER_ERROR;
1499                         }
1500                     }
1501                   move = RIGHT;
1502                 }
1503               else
1504                 {               /* move==DOWN || move==RIGHT */
1505                   len3 =
1506                     asn1_get_length_der (der + counter, len - counter, &amp;len2);
1507                   if (len3 < -1)
1508                     return ASN1_DER_ERROR;
1509                   counter += len2;
1510                   if (len3 > 0)
1511                     {
1512                       _asn1_ltostr (counter + len3, temp);
1513                       tlen = strlen (temp);
1514                       if (tlen > 0)
1515                         _asn1_set_value (p, temp, tlen + 1);
1516                       move = DOWN;
1517                     }
1518                   else if (len3 == 0)
1519                     {
1520                       p2 = p->down;
1521                       while (p2)
1522                         {
1523                           if (type_field (p2->type) != TYPE_TAG)
1524                             {
1525                               p3 = p2->right;
1526                               asn1_delete_structure (&amp;p2);
1527                               p2 = p3;
1528                             }
1529                           else
1530                             p2 = p2->right;
1531                         }
1532                       move = RIGHT;
1533                     }
1534                   else
1535                     {           /* indefinite length method */
1536                       _asn1_set_value (p, "-1", 3);
1537                       move = DOWN;
1538                     }
1539                 }
1540               break;
1541             case TYPE_SEQUENCE_OF:
1542             case TYPE_SET_OF:
1543               if (move == UP)
1544                 {
1545                   len2 = strtol (p->value, NULL, 10);
1546                   if (len2 == -1)
1547                     {           /* indefinite length method */
1548                       if ((counter + 2) > len)
1549                         return ASN1_DER_ERROR;
1550                       if ((der[counter]) || der[counter + 1])
1551                         {
1552                           _asn1_append_sequence_set (p);
1553                           p = p->down;
1554                           while (p->right)
1555                             p = p->right;
1556                           move = RIGHT;
1557                           continue;
1558                         }
1559                       _asn1_set_value (p, NULL, 0);
1560                       counter += 2;
1561                     }
1562                   else
1563                     {           /* definite length method */
1564                       if (len2 > counter)
1565                         {
1566                           _asn1_append_sequence_set (p);
1567                           p = p->down;
1568                           while (p->right)
1569                             p = p->right;
1570                           move = RIGHT;
1571                           continue;
1572                         }
1573                       _asn1_set_value (p, NULL, 0);
1574                       if (len2 != counter)
1575                         {
1576                           asn1_delete_structure (element);
1577                           return ASN1_DER_ERROR;
1578                         }
1579                     }
1580                 }
1581               else
1582                 {               /* move==DOWN || move==RIGHT */
1583                   len3 =
1584                     asn1_get_length_der (der + counter, len - counter, &amp;len2);
1585                   if (len3 < -1)
1586                     return ASN1_DER_ERROR;
1587                   counter += len2;
1588                   if (len3)
1589                     {
1590                       if (len3 > 0)
1591                         {       /* definite length method */
1592                           _asn1_ltostr (counter + len3, temp);
1593                           tlen = strlen (temp);
1594
1595                           if (tlen > 0)
1596                             _asn1_set_value (p, temp, tlen + 1);
1597                         }
1598                       else
1599                         {       /* indefinite length method */
1600                           _asn1_set_value (p, "-1", 3);
1601                         }
1602                       p2 = p->down;
1603                       while ((type_field (p2->type) == TYPE_TAG)
1604                              || (type_field (p2->type) == TYPE_SIZE))
1605                         p2 = p2->right;
1606                       if (p2->right == NULL)
1607                         _asn1_append_sequence_set (p);
1608                       p = p2;
1609                     }
1610                 }
1611               move = RIGHT;
1612               break;
1613             case TYPE_ANY:
1614               if (asn1_get_tag_der
1615                   (der + counter, len - counter, &amp;class, &len2,
1616                    &amp;tag) != ASN1_SUCCESS)
1617                 return ASN1_DER_ERROR;
1618               if (counter + len2 > len)
1619                 return ASN1_DER_ERROR;
1620               len4 =
1621                 asn1_get_length_der (der + counter + len2,
1622                                      len - counter - len2, &amp;len3);
1623               if (len4 < -1)
1624                 return ASN1_DER_ERROR;
1625               if (len4 > len - counter + len2 + len3)
1626                 return ASN1_DER_ERROR;
1627               if (len4 != -1)
1628                 {
1629                   len2 += len4;
1630                   _asn1_set_value_octet (p, der + counter, len2 + len3);
1631                   counter += len2 + len3;
1632                 }
1633               else
1634                 {               /* indefinite length */
1635                   /* Check indefinite lenth method in an EXPLICIT TAG */
1636                   if ((p->type &amp; CONST_TAG) && (der[counter - 1] == 0x80))
1637                     indefinite = 1;
1638                   else
1639                     indefinite = 0;
1640
1641                   len2 = len - counter;
1642                   ris =
1643                     _asn1_get_indefinite_length_string (der + counter, &amp;len2);
1644                   if (ris != ASN1_SUCCESS)
1645                     {
1646                       asn1_delete_structure (element);
1647                       return ris;
1648                     }
1649
1650                   _asn1_set_value_octet (p, der + counter, len2);
1651                   counter += len2;
1652
1653                   /* Check if a couple of 0x00 are present due to an EXPLICIT TAG with
1654                      an indefinite length method. */
1655                   if (indefinite)
1656                     {
1657                       if (!der[counter] &amp;& !der[counter + 1])
1658                         {
1659                           counter += 2;
1660                         }
1661                       else
1662                         {
1663                           asn1_delete_structure (element);
1664                           return ASN1_DER_ERROR;
1665                         }
1666                     }
1667                 }
1668               move = RIGHT;
1669               break;
1670             default:
1671               move = (move == UP) ? RIGHT : DOWN;
1672               break;
1673             }
1674         }
1675
1676       if (p == node &amp;& move != DOWN)
1677         break;
1678
1679       if (move == DOWN)
1680         {
1681           if (p->down)
1682             p = p->down;
1683           else
1684             move = RIGHT;
1685         }
1686       if ((move == RIGHT) &amp;& !(p->type & CONST_SET))
1687         {
1688           if (p->right)
1689             p = p->right;
1690           else
1691             move = UP;
1692         }
1693       if (move == UP)
1694         p = _asn1_find_up (p);
1695     }
1696
1697   _asn1_delete_not_used (*element);
1698
1699   if (counter != len)
1700     {
1701       asn1_delete_structure (element);
1702       return ASN1_DER_ERROR;
1703     }
1704
1705   return ASN1_SUCCESS;
1706 }
1707 </pre>
1708 </div>
1709 </td>
1710 </tr>
1711 <tr class="function_entry_untestable">
1712 <td class="function_entry_filename">
1713 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('asn1_write_value_src', 'asn1_write_value_button')"><span id="asn1_write_value_button">&darr;</span></a>
1714 </td>
1715 <td class="function_entry_name">
1716 asn1_write_value
1717 </td>
1718 <td class="function_entry_cyclo">
1719 111
1720 </td>
1721 <td class="function_entry_number">
1722 208
1723 </td>
1724 <td class="function_entry_number">
1725 343
1726 </td>
1727 <td class="function_entry_filename">
1728 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/element.c;hb=HEAD">lib/element.c</a>
1729 </td>
1730 </tr>
1731 <tr>
1732 <td colspan="6" height="0">
1733 <div id="asn1_write_value_src" class="function_src" style="position: relative; display: none;">
1734 <pre class="function_src">
1735 asn1_retCode
1736 asn1_write_value (ASN1_TYPE node_root, const char *name,
1737                   const void *ivalue, int len)
1738 {
1739   ASN1_TYPE node, p, p2;
1740   unsigned char *temp, *value_temp = NULL, *default_temp = NULL;
1741   int len2, k, k2, negative;
1742   size_t i;
1743   const unsigned char *value = ivalue;
1744
1745   node = asn1_find_node (node_root, name);
1746   if (node == NULL)
1747     return ASN1_ELEMENT_NOT_FOUND;
1748
1749   if ((node->type &amp; CONST_OPTION) && (value == NULL) && (len == 0))
1750     {
1751       asn1_delete_structure (&amp;node);
1752       return ASN1_SUCCESS;
1753     }
1754
1755   if ((type_field (node->type) == TYPE_SEQUENCE_OF) &amp;& (value == NULL)
1756       &amp;& (len == 0))
1757     {
1758       p = node->down;
1759       while ((type_field (p->type) == TYPE_TAG)
1760              || (type_field (p->type) == TYPE_SIZE))
1761         p = p->right;
1762
1763       while (p->right)
1764         asn1_delete_structure (&amp;p->right);
1765
1766       return ASN1_SUCCESS;
1767     }
1768
1769   switch (type_field (node->type))
1770     {
1771     case TYPE_BOOLEAN:
1772       if (!strcmp (value, "TRUE"))
1773         {
1774           if (node->type &amp; CONST_DEFAULT)
1775             {
1776               p = node->down;
1777               while (type_field (p->type) != TYPE_DEFAULT)
1778                 p = p->right;
1779               if (p->type &amp; CONST_TRUE)
1780                 _asn1_set_value (node, NULL, 0);
1781               else
1782                 _asn1_set_value (node, "T", 1);
1783             }
1784           else
1785             _asn1_set_value (node, "T", 1);
1786         }
1787       else if (!strcmp (value, "FALSE"))
1788         {
1789           if (node->type &amp; CONST_DEFAULT)
1790             {
1791               p = node->down;
1792               while (type_field (p->type) != TYPE_DEFAULT)
1793                 p = p->right;
1794               if (p->type &amp; CONST_FALSE)
1795                 _asn1_set_value (node, NULL, 0);
1796               else
1797                 _asn1_set_value (node, "F", 1);
1798             }
1799           else
1800             _asn1_set_value (node, "F", 1);
1801         }
1802       else
1803         return ASN1_VALUE_NOT_VALID;
1804       break;
1805     case TYPE_INTEGER:
1806     case TYPE_ENUMERATED:
1807       if (len == 0)
1808         {
1809           if ((isdigit (value[0])) || (value[0] == '-'))
1810             {
1811               value_temp =
1812                 (unsigned char *) _asn1_malloc (SIZEOF_UNSIGNED_LONG_INT);
1813               if (value_temp == NULL)
1814                 return ASN1_MEM_ALLOC_ERROR;
1815
1816               _asn1_convert_integer (value, value_temp,
1817                                      SIZEOF_UNSIGNED_LONG_INT, &amp;len);
1818             }
1819           else
1820             {                   /* is an identifier like v1 */
1821               if (!(node->type &amp; CONST_LIST))
1822                 return ASN1_VALUE_NOT_VALID;
1823               p = node->down;
1824               while (p)
1825                 {
1826                   if (type_field (p->type) == TYPE_CONSTANT)
1827                     {
1828                       if ((p->name) &amp;& (!strcmp (p->name, value)))
1829                         {
1830                           value_temp =
1831                             (unsigned char *)
1832                             _asn1_malloc (SIZEOF_UNSIGNED_LONG_INT);
1833                           if (value_temp == NULL)
1834                             return ASN1_MEM_ALLOC_ERROR;
1835
1836                           _asn1_convert_integer (p->value,
1837                                                  value_temp,
1838                                                  SIZEOF_UNSIGNED_LONG_INT,
1839                                                  &amp;len);
1840                           break;
1841                         }
1842                     }
1843                   p = p->right;
1844                 }
1845               if (p == NULL)
1846                 return ASN1_VALUE_NOT_VALID;
1847             }
1848         }
1849       else
1850         {                       /* len != 0 */
1851           value_temp = (unsigned char *) _asn1_malloc (len);
1852           if (value_temp == NULL)
1853             return ASN1_MEM_ALLOC_ERROR;
1854           memcpy (value_temp, value, len);
1855         }
1856
1857
1858       if (value_temp[0] &amp; 0x80)
1859         negative = 1;
1860       else
1861         negative = 0;
1862
1863       if (negative &amp;& (type_field (node->type) == TYPE_ENUMERATED))
1864         {
1865           _asn1_free (value_temp);
1866           return ASN1_VALUE_NOT_VALID;
1867         }
1868
1869       for (k = 0; k < len - 1; k++)
1870         if (negative &amp;& (value_temp[k] != 0xFF))
1871           break;
1872         else if (!negative &amp;& value_temp[k])
1873           break;
1874
1875       if ((negative &amp;& !(value_temp[k] & 0x80)) ||
1876           (!negative &amp;& (value_temp[k] & 0x80)))
1877         k--;
1878
1879       _asn1_set_value_octet (node, value_temp + k, len - k);
1880
1881       if (node->type &amp; CONST_DEFAULT)
1882         {
1883           p = node->down;
1884           while (type_field (p->type) != TYPE_DEFAULT)
1885             p = p->right;
1886           if ((isdigit (p->value[0])) || (p->value[0] == '-'))
1887             {
1888               default_temp =
1889                 (unsigned char *) _asn1_malloc (SIZEOF_UNSIGNED_LONG_INT);
1890               if (default_temp == NULL)
1891                 {
1892                   _asn1_free (value_temp);
1893                   return ASN1_MEM_ALLOC_ERROR;
1894                 }
1895
1896               _asn1_convert_integer (p->value, default_temp,
1897                                      SIZEOF_UNSIGNED_LONG_INT, &amp;len2);
1898             }
1899           else
1900             {                   /* is an identifier like v1 */
1901               if (!(node->type &amp; CONST_LIST))
1902                 {
1903                   _asn1_free (value_temp);
1904                   return ASN1_VALUE_NOT_VALID;
1905                 }
1906               p2 = node->down;
1907               while (p2)
1908                 {
1909                   if (type_field (p2->type) == TYPE_CONSTANT)
1910                     {
1911                       if ((p2->name) &amp;& (!strcmp (p2->name, p->value)))
1912                         {
1913                           default_temp =
1914                             (unsigned char *)
1915                             _asn1_malloc (SIZEOF_UNSIGNED_LONG_INT);
1916                           if (default_temp == NULL)
1917                             {
1918                               _asn1_free (value_temp);
1919                               return ASN1_MEM_ALLOC_ERROR;
1920                             }
1921
1922                           _asn1_convert_integer (p2->value,
1923                                                  default_temp,
1924                                                  SIZEOF_UNSIGNED_LONG_INT,
1925                                                  &amp;len2);
1926                           break;
1927                         }
1928                     }
1929                   p2 = p2->right;
1930                 }
1931               if (p2 == NULL)
1932                 {
1933                   _asn1_free (value_temp);
1934                   return ASN1_VALUE_NOT_VALID;
1935                 }
1936             }
1937
1938
1939           if ((len - k) == len2)
1940             {
1941               for (k2 = 0; k2 < len2; k2++)
1942                 if (value_temp[k + k2] != default_temp[k2])
1943                   {
1944                     break;
1945                   }
1946               if (k2 == len2)
1947                 _asn1_set_value (node, NULL, 0);
1948             }
1949           _asn1_free (default_temp);
1950         }
1951       _asn1_free (value_temp);
1952       break;
1953     case TYPE_OBJECT_ID:
1954       for (i = 0; i < strlen (value); i++)
1955         if ((!isdigit (value[i])) &amp;& (value[i] != '.') && (value[i] != '+'))
1956           return ASN1_VALUE_NOT_VALID;
1957       if (node->type &amp; CONST_DEFAULT)
1958         {
1959           p = node->down;
1960           while (type_field (p->type) != TYPE_DEFAULT)
1961             p = p->right;
1962           if (!strcmp (value, p->value))
1963             {
1964               _asn1_set_value (node, NULL, 0);
1965               break;
1966             }
1967         }
1968       _asn1_set_value (node, value, strlen (value) + 1);
1969       break;
1970     case TYPE_TIME:
1971       if (node->type &amp; CONST_UTC)
1972         {
1973           if (strlen (value) < 11)
1974             return ASN1_VALUE_NOT_VALID;
1975           for (k = 0; k < 10; k++)
1976             if (!isdigit (value[k]))
1977               return ASN1_VALUE_NOT_VALID;
1978           switch (strlen (value))
1979             {
1980             case 11:
1981               if (value[10] != 'Z')
1982                 return ASN1_VALUE_NOT_VALID;
1983               break;
1984             case 13:
1985               if ((!isdigit (value[10])) || (!isdigit (value[11])) ||
1986                   (value[12] != 'Z'))
1987                 return ASN1_VALUE_NOT_VALID;
1988               break;
1989             case 15:
1990               if ((value[10] != '+') &amp;& (value[10] != '-'))
1991                 return ASN1_VALUE_NOT_VALID;
1992               for (k = 11; k < 15; k++)
1993                 if (!isdigit (value[k]))
1994                   return ASN1_VALUE_NOT_VALID;
1995               break;
1996             case 17:
1997               if ((!isdigit (value[10])) || (!isdigit (value[11])))
1998                 return ASN1_VALUE_NOT_VALID;
1999               if ((value[12] != '+') &amp;& (value[12] != '-'))
2000                 return ASN1_VALUE_NOT_VALID;
2001               for (k = 13; k < 17; k++)
2002                 if (!isdigit (value[k]))
2003                   return ASN1_VALUE_NOT_VALID;
2004               break;
2005             default:
2006               return ASN1_VALUE_NOT_FOUND;
2007             }
2008           _asn1_set_value (node, value, strlen (value) + 1);
2009         }
2010       else
2011         {                       /* GENERALIZED TIME */
2012           if (value)
2013             _asn1_set_value (node, value, strlen (value) + 1);
2014         }
2015       break;
2016     case TYPE_OCTET_STRING:
2017       if (len == 0)
2018         len = strlen (value);
2019       _asn1_set_value_octet (node, value, len);
2020       break;
2021     case TYPE_GENERALSTRING:
2022       if (len == 0)
2023         len = strlen (value);
2024       _asn1_set_value_octet (node, value, len);
2025       break;
2026     case TYPE_BIT_STRING:
2027       if (len == 0)
2028         len = strlen (value);
2029       asn1_length_der ((len >> 3) + 2, NULL, &amp;len2);
2030       temp = (unsigned char *) _asn1_malloc ((len >> 3) + 2 + len2);
2031       if (temp == NULL)
2032         return ASN1_MEM_ALLOC_ERROR;
2033
2034       asn1_bit_der (value, len, temp, &amp;len2);
2035       _asn1_set_value_m (node, temp, len2);
2036       temp = NULL;
2037       break;
2038     case TYPE_CHOICE:
2039       p = node->down;
2040       while (p)
2041         {
2042           if (!strcmp (p->name, value))
2043             {
2044               p2 = node->down;
2045               while (p2)
2046                 {
2047                   if (p2 != p)
2048                     {
2049                       asn1_delete_structure (&amp;p2);
2050                       p2 = node->down;
2051                     }
2052                   else
2053                     p2 = p2->right;
2054                 }
2055               break;
2056             }
2057           p = p->right;
2058         }
2059       if (!p)
2060         return ASN1_ELEMENT_NOT_FOUND;
2061       break;
2062     case TYPE_ANY:
2063       _asn1_set_value_octet (node, value, len);
2064       break;
2065     case TYPE_SEQUENCE_OF:
2066     case TYPE_SET_OF:
2067       if (strcmp (value, "NEW"))
2068         return ASN1_VALUE_NOT_VALID;
2069       _asn1_append_sequence_set (node);
2070       break;
2071     default:
2072       return ASN1_ELEMENT_NOT_FOUND;
2073       break;
2074     }
2075
2076   return ASN1_SUCCESS;
2077 }
2078 </pre>
2079 </div>
2080 </td>
2081 </tr>
2082 <tr class="function_entry_untestable">
2083 <td class="function_entry_filename">
2084 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('asn1_print_structure_src', 'asn1_print_structure_button')"><span id="asn1_print_structure_button">&darr;</span></a>
2085 </td>
2086 <td class="function_entry_name">
2087 asn1_print_structure
2088 </td>
2089 <td class="function_entry_cyclo">
2090 125
2091 </td>
2092 <td class="function_entry_number">
2093 235
2094 </td>
2095 <td class="function_entry_number">
2096 349
2097 </td>
2098 <td class="function_entry_filename">
2099 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/structure.c;hb=HEAD">lib/structure.c</a>
2100 </td>
2101 </tr>
2102 <tr>
2103 <td colspan="6" height="0">
2104 <div id="asn1_print_structure_src" class="function_src" style="position: relative; display: none;">
2105 <pre class="function_src">
2106 void
2107 asn1_print_structure (FILE * out, ASN1_TYPE structure, const char *name,
2108                       int mode)
2109 {
2110   ASN1_TYPE p, root;
2111   int k, indent = 0, len, len2, len3;
2112
2113   if (out == NULL)
2114     return;
2115
2116   root = asn1_find_node (structure, name);
2117
2118   if (root == NULL)
2119     return;
2120
2121   p = root;
2122   while (p)
2123     {
2124       if (mode == ASN1_PRINT_ALL)
2125         {
2126           for (k = 0; k < indent; k++)
2127             fprintf (out, " ");
2128           fprintf (out, "name:");
2129           if (p->name)
2130             fprintf (out, "%s  ", p->name);
2131           else
2132             fprintf (out, "NULL  ");
2133         }
2134       else
2135         {
2136           switch (type_field (p->type))
2137             {
2138             case TYPE_CONSTANT:
2139             case TYPE_TAG:
2140             case TYPE_SIZE:
2141               break;
2142             default:
2143               for (k = 0; k < indent; k++)
2144                 fprintf (out, " ");
2145               fprintf (out, "name:");
2146               if (p->name)
2147                 fprintf (out, "%s  ", p->name);
2148               else
2149                 fprintf (out, "NULL  ");
2150             }
2151         }
2152
2153       if (mode != ASN1_PRINT_NAME)
2154         {
2155           switch (type_field (p->type))
2156             {
2157             case TYPE_CONSTANT:
2158               if (mode == ASN1_PRINT_ALL)
2159                 fprintf (out, "type:CONST");
2160               break;
2161             case TYPE_TAG:
2162               if (mode == ASN1_PRINT_ALL)
2163                 fprintf (out, "type:TAG");
2164               break;
2165             case TYPE_SIZE:
2166               if (mode == ASN1_PRINT_ALL)
2167                 fprintf (out, "type:SIZE");
2168               break;
2169             case TYPE_DEFAULT:
2170               fprintf (out, "type:DEFAULT");
2171               break;
2172             case TYPE_NULL:
2173               fprintf (out, "type:NULL");
2174               break;
2175             case TYPE_IDENTIFIER:
2176               fprintf (out, "type:IDENTIFIER");
2177               break;
2178             case TYPE_INTEGER:
2179               fprintf (out, "type:INTEGER");
2180               break;
2181             case TYPE_ENUMERATED:
2182               fprintf (out, "type:ENUMERATED");
2183               break;
2184             case TYPE_TIME:
2185               fprintf (out, "type:TIME");
2186               break;
2187             case TYPE_BOOLEAN:
2188               fprintf (out, "type:BOOLEAN");
2189               break;
2190             case TYPE_SEQUENCE:
2191               fprintf (out, "type:SEQUENCE");
2192               break;
2193             case TYPE_BIT_STRING:
2194               fprintf (out, "type:BIT_STR");
2195               break;
2196             case TYPE_OCTET_STRING:
2197               fprintf (out, "type:OCT_STR");
2198               break;
2199             case TYPE_GENERALSTRING:
2200               fprintf (out, "type:GENERALSTRING");
2201               break;
2202             case TYPE_SEQUENCE_OF:
2203               fprintf (out, "type:SEQ_OF");
2204               break;
2205             case TYPE_OBJECT_ID:
2206               fprintf (out, "type:OBJ_ID");
2207               break;
2208             case TYPE_ANY:
2209               fprintf (out, "type:ANY");
2210               break;
2211             case TYPE_SET:
2212               fprintf (out, "type:SET");
2213               break;
2214             case TYPE_SET_OF:
2215               fprintf (out, "type:SET_OF");
2216               break;
2217             case TYPE_CHOICE:
2218               fprintf (out, "type:CHOICE");
2219               break;
2220             case TYPE_DEFINITIONS:
2221               fprintf (out, "type:DEFINITIONS");
2222               break;
2223             default:
2224               break;
2225             }
2226         }
2227
2228       if ((mode == ASN1_PRINT_NAME_TYPE_VALUE) || (mode == ASN1_PRINT_ALL))
2229         {
2230           switch (type_field (p->type))
2231             {
2232             case TYPE_CONSTANT:
2233               if (mode == ASN1_PRINT_ALL)
2234                 if (p->value)
2235                   fprintf (out, "  value:%s", p->value);
2236               break;
2237             case TYPE_TAG:
2238               if (mode == ASN1_PRINT_ALL)
2239                 if (p->value)
2240                   fprintf (out, "  value:%s", p->value);
2241               break;
2242             case TYPE_SIZE:
2243               if (mode == ASN1_PRINT_ALL)
2244                 if (p->value)
2245                   fprintf (out, "  value:%s", p->value);
2246               break;
2247             case TYPE_DEFAULT:
2248               if (p->value)
2249                 fprintf (out, "  value:%s", p->value);
2250               else if (p->type &amp; CONST_TRUE)
2251                 fprintf (out, "  value:TRUE");
2252               else if (p->type &amp; CONST_FALSE)
2253                 fprintf (out, "  value:FALSE");
2254               break;
2255             case TYPE_IDENTIFIER:
2256               if (p->value)
2257                 fprintf (out, "  value:%s", p->value);
2258               break;
2259             case TYPE_INTEGER:
2260               if (p->value)
2261                 {
2262                   len2 = -1;
2263                   len = asn1_get_length_der (p->value, p->value_len, &amp;len2);
2264                   fprintf (out, "  value:0x");
2265                   if (len > 0)
2266                     for (k = 0; k < len; k++)
2267                       fprintf (out, "%02x", (p->value)[k + len2]);
2268                 }
2269               break;
2270             case TYPE_ENUMERATED:
2271               if (p->value)
2272                 {
2273                   len2 = -1;
2274                   len = asn1_get_length_der (p->value, p->value_len, &amp;len2);
2275                   fprintf (out, "  value:0x");
2276                   if (len > 0)
2277                     for (k = 0; k < len; k++)
2278                       fprintf (out, "%02x", (p->value)[k + len2]);
2279                 }
2280               break;
2281             case TYPE_TIME:
2282               if (p->value)
2283                 fprintf (out, "  value:%s", p->value);
2284               break;
2285             case TYPE_BOOLEAN:
2286               if (p->value)
2287                 {
2288                   if (p->value[0] == 'T')
2289                     fprintf (out, "  value:TRUE");
2290                   else if (p->value[0] == 'F')
2291                     fprintf (out, "  value:FALSE");
2292                 }
2293               break;
2294             case TYPE_BIT_STRING:
2295               if (p->value)
2296                 {
2297                   len2 = -1;
2298                   len = asn1_get_length_der (p->value, p->value_len, &amp;len2);
2299                   if (len > 0)
2300                     {
2301                       fprintf (out, "  value(%i):",
2302                                (len - 1) * 8 - (p->value[len2]));
2303                       for (k = 1; k < len; k++)
2304                         fprintf (out, "%02x", (p->value)[k + len2]);
2305                     }
2306                 }
2307               break;
2308             case TYPE_OCTET_STRING:
2309               if (p->value)
2310                 {
2311                   len2 = -1;
2312                   len = asn1_get_length_der (p->value, p->value_len, &amp;len2);
2313                   fprintf (out, "  value:");
2314                   if (len > 0)
2315                     for (k = 0; k < len; k++)
2316                       fprintf (out, "%02x", (p->value)[k + len2]);
2317                 }
2318               break;
2319             case TYPE_GENERALSTRING:
2320               if (p->value)
2321                 {
2322                   len2 = -1;
2323                   len = asn1_get_length_der (p->value, p->value_len, &amp;len2);
2324                   fprintf (out, "  value:");
2325                   if (len > 0)
2326                     for (k = 0; k < len; k++)
2327                       fprintf (out, "%02x", (p->value)[k + len2]);
2328                 }
2329               break;
2330             case TYPE_OBJECT_ID:
2331               if (p->value)
2332                 fprintf (out, "  value:%s", p->value);
2333               break;
2334             case TYPE_ANY:
2335               if (p->value)
2336                 {
2337                   len3 = -1;
2338                   len2 = asn1_get_length_der (p->value, p->value_len, &amp;len3);
2339                   fprintf (out, "  value:");
2340                   if (len2 > 0)
2341                     for (k = 0; k < len2; k++)
2342                       fprintf (out, "%02x", (p->value)[k + len3]);
2343                 }
2344               break;
2345             case TYPE_SET:
2346             case TYPE_SET_OF:
2347             case TYPE_CHOICE:
2348             case TYPE_DEFINITIONS:
2349             case TYPE_SEQUENCE_OF:
2350             case TYPE_SEQUENCE:
2351             case TYPE_NULL:
2352               break;
2353             default:
2354               break;
2355             }
2356         }
2357
2358       if (mode == ASN1_PRINT_ALL)
2359         {
2360           if (p->type &amp; 0x1FFFFF00)
2361             {
2362               fprintf (out, "  attr:");
2363               if (p->type &amp; CONST_UNIVERSAL)
2364                 fprintf (out, "UNIVERSAL,");
2365               if (p->type &amp; CONST_PRIVATE)
2366                 fprintf (out, "PRIVATE,");
2367               if (p->type &amp; CONST_APPLICATION)
2368                 fprintf (out, "APPLICATION,");
2369               if (p->type &amp; CONST_EXPLICIT)
2370                 fprintf (out, "EXPLICIT,");
2371               if (p->type &amp; CONST_IMPLICIT)
2372                 fprintf (out, "IMPLICIT,");
2373               if (p->type &amp; CONST_TAG)
2374                 fprintf (out, "TAG,");
2375               if (p->type &amp; CONST_DEFAULT)
2376                 fprintf (out, "DEFAULT,");
2377               if (p->type &amp; CONST_TRUE)
2378                 fprintf (out, "TRUE,");
2379               if (p->type &amp; CONST_FALSE)
2380                 fprintf (out, "FALSE,");
2381               if (p->type &amp; CONST_LIST)
2382                 fprintf (out, "LIST,");
2383               if (p->type &amp; CONST_MIN_MAX)
2384                 fprintf (out, "MIN_MAX,");
2385               if (p->type &amp; CONST_OPTION)
2386                 fprintf (out, "OPTION,");
2387               if (p->type &amp; CONST_1_PARAM)
2388                 fprintf (out, "1_PARAM,");
2389               if (p->type &amp; CONST_SIZE)
2390                 fprintf (out, "SIZE,");
2391               if (p->type &amp; CONST_DEFINED_BY)
2392                 fprintf (out, "DEF_BY,");
2393               if (p->type &amp; CONST_GENERALIZED)
2394                 fprintf (out, "GENERALIZED,");
2395               if (p->type &amp; CONST_UTC)
2396                 fprintf (out, "UTC,");
2397               if (p->type &amp; CONST_SET)
2398                 fprintf (out, "SET,");
2399               if (p->type &amp; CONST_NOT_USED)
2400                 fprintf (out, "NOT_USED,");
2401               if (p->type &amp; CONST_ASSIGN)
2402                 fprintf (out, "ASSIGNMENT,");
2403             }
2404         }
2405
2406       if (mode == ASN1_PRINT_ALL)
2407         {
2408           fprintf (out, "\n");
2409         }
2410       else
2411         {
2412           switch (type_field (p->type))
2413             {
2414             case TYPE_CONSTANT:
2415             case TYPE_TAG:
2416             case TYPE_SIZE:
2417               break;
2418             default:
2419               fprintf (out, "\n");
2420             }
2421         }
2422
2423       if (p->down)
2424         {
2425           p = p->down;
2426           indent += 2;
2427         }
2428       else if (p == root)
2429         {
2430           p = NULL;
2431           break;
2432         }
2433       else if (p->right)
2434         p = p->right;
2435       else
2436         {
2437           while (1)
2438             {
2439               p = _asn1_find_up (p);
2440               if (p == root)
2441                 {
2442                   p = NULL;
2443                   break;
2444                 }
2445               indent -= 2;
2446               if (p->right)
2447                 {
2448                   p = p->right;
2449                   break;
2450                 }
2451             }
2452         }
2453     }
2454 }
2455 </pre>
2456 </div>
2457 </td>
2458 </tr>
2459 <tr class="function_entry_untestable">
2460 <td class="function_entry_filename">
2461 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('asn1_der_decoding_startEnd_src', 'asn1_der_decoding_startEnd_button')"><span id="asn1_der_decoding_startEnd_button">&darr;</span></a>
2462 </td>
2463 <td class="function_entry_name">
2464 asn1_der_decoding_startEnd
2465 </td>
2466 <td class="function_entry_cyclo">
2467 85
2468 </td>
2469 <td class="function_entry_number">
2470 188
2471 </td>
2472 <td class="function_entry_number">
2473 320
2474 </td>
2475 <td class="function_entry_filename">
2476 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/decoding.c;hb=HEAD">lib/decoding.c</a>
2477 </td>
2478 </tr>
2479 <tr>
2480 <td colspan="6" height="0">
2481 <div id="asn1_der_decoding_startEnd_src" class="function_src" style="position: relative; display: none;">
2482 <pre class="function_src">
2483 asn1_retCode
2484 asn1_der_decoding_startEnd (ASN1_TYPE element, const void *ider, int len,
2485                             const char *name_element, int *start, int *end)
2486 {
2487   ASN1_TYPE node, node_to_find, p, p2, p3;
2488   int counter, len2, len3, len4, move, ris;
2489   unsigned char class;
2490   unsigned long tag;
2491   int indefinite;
2492   const unsigned char *der = ider;
2493
2494   node = element;
2495
2496   if (node == ASN1_TYPE_EMPTY)
2497     return ASN1_ELEMENT_NOT_FOUND;
2498
2499   node_to_find = asn1_find_node (node, name_element);
2500
2501   if (node_to_find == NULL)
2502     return ASN1_ELEMENT_NOT_FOUND;
2503
2504   if (node_to_find == node)
2505     {
2506       *start = 0;
2507       *end = len - 1;
2508       return ASN1_SUCCESS;
2509     }
2510
2511   if (node->type &amp; CONST_OPTION)
2512     return ASN1_GENERIC_ERROR;
2513
2514   counter = 0;
2515   move = DOWN;
2516   p = node;
2517   while (1)
2518     {
2519       ris = ASN1_SUCCESS;
2520
2521       if (move != UP)
2522         {
2523           if (p->type &amp; CONST_SET)
2524             {
2525               p2 = _asn1_find_up (p);
2526               len2 = strtol (p2->value, NULL, 10);
2527               if (len2 == -1)
2528                 {
2529                   if (!der[counter] &amp;& !der[counter + 1])
2530                     {
2531                       p = p2;
2532                       move = UP;
2533                       counter += 2;
2534                       continue;
2535                     }
2536                 }
2537               else if (counter == len2)
2538                 {
2539                   p = p2;
2540                   move = UP;
2541                   continue;
2542                 }
2543               else if (counter > len2)
2544                 return ASN1_DER_ERROR;
2545               p2 = p2->down;
2546               while (p2)
2547                 {
2548                   if ((p2->type &amp; CONST_SET) && (p2->type & CONST_NOT_USED))
2549                     {           /* CONTROLLARE */
2550                       if (type_field (p2->type) != TYPE_CHOICE)
2551                         ris =
2552                           _asn1_extract_tag_der (p2, der + counter,
2553                                                  len - counter, &amp;len2);
2554                       else
2555                         {
2556                           p3 = p2->down;
2557                           ris =
2558                             _asn1_extract_tag_der (p3, der + counter,
2559                                                    len - counter, &amp;len2);
2560                         }
2561                       if (ris == ASN1_SUCCESS)
2562                         {
2563                           p2->type &amp;= ~CONST_NOT_USED;
2564                           p = p2;
2565                           break;
2566                         }
2567                     }
2568                   p2 = p2->right;
2569                 }
2570               if (p2 == NULL)
2571                 return ASN1_DER_ERROR;
2572             }
2573
2574           if (p == node_to_find)
2575             *start = counter;
2576
2577           if (type_field (p->type) == TYPE_CHOICE)
2578             {
2579               p = p->down;
2580               ris =
2581                 _asn1_extract_tag_der (p, der + counter, len - counter,
2582                                        &amp;len2);
2583               if (p == node_to_find)
2584                 *start = counter;
2585             }
2586
2587           if (ris == ASN1_SUCCESS)
2588             ris =
2589               _asn1_extract_tag_der (p, der + counter, len - counter, &amp;len2);
2590           if (ris != ASN1_SUCCESS)
2591             {
2592               if (p->type &amp; CONST_OPTION)
2593                 {
2594                   p->type |= CONST_NOT_USED;
2595                   move = RIGHT;
2596                 }
2597               else if (p->type &amp; CONST_DEFAULT)
2598                 {
2599                   move = RIGHT;
2600                 }
2601               else
2602                 {
2603                   return ASN1_TAG_ERROR;
2604                 }
2605             }
2606           else
2607             counter += len2;
2608         }
2609
2610       if (ris == ASN1_SUCCESS)
2611         {
2612           switch (type_field (p->type))
2613             {
2614             case TYPE_NULL:
2615               if (der[counter])
2616                 return ASN1_DER_ERROR;
2617               counter++;
2618               move = RIGHT;
2619               break;
2620             case TYPE_BOOLEAN:
2621               if (der[counter++] != 1)
2622                 return ASN1_DER_ERROR;
2623               counter++;
2624               move = RIGHT;
2625               break;
2626             case TYPE_INTEGER:
2627             case TYPE_ENUMERATED:
2628               len2 =
2629                 asn1_get_length_der (der + counter, len - counter, &amp;len3);
2630               if (len2 < 0)
2631                 return ASN1_DER_ERROR;
2632               counter += len3 + len2;
2633               move = RIGHT;
2634               break;
2635             case TYPE_OBJECT_ID:
2636               len2 =
2637                 asn1_get_length_der (der + counter, len - counter, &amp;len3);
2638               if (len2 < 0)
2639                 return ASN1_DER_ERROR;
2640               counter += len2 + len3;
2641               move = RIGHT;
2642               break;
2643             case TYPE_TIME:
2644               len2 =
2645                 asn1_get_length_der (der + counter, len - counter, &amp;len3);
2646               if (len2 < 0)
2647                 return ASN1_DER_ERROR;
2648               counter += len2 + len3;
2649               move = RIGHT;
2650               break;
2651             case TYPE_OCTET_STRING:
2652               len3 = len - counter;
2653               ris = _asn1_get_octet_string (der + counter, NULL, &amp;len3);
2654               if (ris != ASN1_SUCCESS)
2655                 return ris;
2656               counter += len3;
2657               move = RIGHT;
2658               break;
2659             case TYPE_GENERALSTRING:
2660               len2 =
2661                 asn1_get_length_der (der + counter, len - counter, &amp;len3);
2662               if (len2 < 0)
2663                 return ASN1_DER_ERROR;
2664               counter += len3 + len2;
2665               move = RIGHT;
2666               break;
2667             case TYPE_BIT_STRING:
2668               len2 =
2669                 asn1_get_length_der (der + counter, len - counter, &amp;len3);
2670               if (len2 < 0)
2671                 return ASN1_DER_ERROR;
2672               counter += len3 + len2;
2673               move = RIGHT;
2674               break;
2675             case TYPE_SEQUENCE:
2676             case TYPE_SET:
2677               if (move != UP)
2678                 {
2679                   len3 =
2680                     asn1_get_length_der (der + counter, len - counter, &amp;len2);
2681                   if (len3 < -1)
2682                     return ASN1_DER_ERROR;
2683                   counter += len2;
2684                   if (len3 == 0)
2685                     move = RIGHT;
2686                   else
2687                     move = DOWN;
2688                 }
2689               else
2690                 {
2691                   if (!der[counter] &amp;& !der[counter + 1])   /* indefinite length method */
2692                     counter += 2;
2693                   move = RIGHT;
2694                 }
2695               break;
2696             case TYPE_SEQUENCE_OF:
2697             case TYPE_SET_OF:
2698               if (move != UP)
2699                 {
2700                   len3 =
2701                     asn1_get_length_der (der + counter, len - counter, &amp;len2);
2702                   if (len3 < -1)
2703                     return ASN1_DER_ERROR;
2704                   counter += len2;
2705                   if ((len3 == -1) &amp;& !der[counter] && !der[counter + 1])
2706                     counter += 2;
2707                   else if (len3)
2708                     {
2709                       p2 = p->down;
2710                       while ((type_field (p2->type) == TYPE_TAG) ||
2711                              (type_field (p2->type) == TYPE_SIZE))
2712                         p2 = p2->right;
2713                       p = p2;
2714                     }
2715                 }
2716               else
2717                 {
2718                   if (!der[counter] &amp;& !der[counter + 1])   /* indefinite length method */
2719                     counter += 2;
2720                 }
2721               move = RIGHT;
2722               break;
2723             case TYPE_ANY:
2724               if (asn1_get_tag_der
2725                   (der + counter, len - counter, &amp;class, &len2,
2726                    &amp;tag) != ASN1_SUCCESS)
2727                 return ASN1_DER_ERROR;
2728               if (counter + len2 > len)
2729                 return ASN1_DER_ERROR;
2730
2731               len4 =
2732                 asn1_get_length_der (der + counter + len2,
2733                                      len - counter - len2, &amp;len3);
2734               if (len4 < -1)
2735                 return ASN1_DER_ERROR;
2736
2737               if (len4 != -1)
2738                 {
2739                   counter += len2 + len4 + len3;
2740                 }
2741               else
2742                 {               /* indefinite length */
2743                   /* Check indefinite lenth method in an EXPLICIT TAG */
2744                   if ((p->type &amp; CONST_TAG) && (der[counter - 1] == 0x80))
2745                     indefinite = 1;
2746                   else
2747                     indefinite = 0;
2748
2749                   len2 = len - counter;
2750                   ris =
2751                     _asn1_get_indefinite_length_string (der + counter, &amp;len2);
2752                   if (ris != ASN1_SUCCESS)
2753                     return ris;
2754                   counter += len2;
2755
2756                   /* Check if a couple of 0x00 are present due to an EXPLICIT TAG with
2757                      an indefinite length method. */
2758                   if (indefinite)
2759                     {
2760                       if (!der[counter] &amp;& !der[counter + 1])
2761                         counter += 2;
2762                       else
2763                         return ASN1_DER_ERROR;
2764                     }
2765                 }
2766               move = RIGHT;
2767               break;
2768             default:
2769               move = (move == UP) ? RIGHT : DOWN;
2770               break;
2771             }
2772         }
2773
2774       if ((p == node_to_find) &amp;& (move == RIGHT))
2775         {
2776           *end = counter - 1;
2777           return ASN1_SUCCESS;
2778         }
2779
2780       if (p == node &amp;& move != DOWN)
2781         break;
2782
2783       if (move == DOWN)
2784         {
2785           if (p->down)
2786             p = p->down;
2787           else
2788             move = RIGHT;
2789         }
2790       if ((move == RIGHT) &amp;& !(p->type & CONST_SET))
2791         {
2792           if (p->right)
2793             p = p->right;
2794           else
2795             move = UP;
2796         }
2797       if (move == UP)
2798         p = _asn1_find_up (p);
2799     }
2800
2801   return ASN1_ELEMENT_NOT_FOUND;
2802 }
2803 </pre>
2804 </div>
2805 </td>
2806 </tr>
2807 <tr class="function_entry_untestable">
2808 <td class="function_entry_filename">
2809 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('asn1_der_coding_src', 'asn1_der_coding_button')"><span id="asn1_der_coding_button">&darr;</span></a>
2810 </td>
2811 <td class="function_entry_name">
2812 asn1_der_coding
2813 </td>
2814 <td class="function_entry_cyclo">
2815 83
2816 </td>
2817 <td class="function_entry_number">
2818 226
2819 </td>
2820 <td class="function_entry_number">
2821 357
2822 </td>
2823 <td class="function_entry_filename">
2824 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/coding.c;hb=HEAD">lib/coding.c</a>
2825 </td>
2826 </tr>
2827 <tr>
2828 <td colspan="6" height="0">
2829 <div id="asn1_der_coding_src" class="function_src" style="position: relative; display: none;">
2830 <pre class="function_src">
2831 asn1_retCode
2832 asn1_der_coding (ASN1_TYPE element, const char *name, void *ider, int *len,
2833                  char *ErrorDescription)
2834 {
2835   ASN1_TYPE node, p, p2;
2836   char temp[SIZEOF_UNSIGNED_LONG_INT * 3 + 1];
2837   int counter, counter_old, len2, len3, tlen, move, max_len, max_len_old;
2838   asn1_retCode err;
2839   unsigned char *der = ider;
2840
2841   node = asn1_find_node (element, name);
2842   if (node == NULL)
2843     return ASN1_ELEMENT_NOT_FOUND;
2844
2845   /* Node is now a locally allocated variable.
2846    * That is because in some point we modify the
2847    * structure, and I don't know why! --nmav
2848    */
2849   node = _asn1_copy_structure3 (node);
2850   if (node == NULL)
2851     return ASN1_ELEMENT_NOT_FOUND;
2852
2853   max_len = *len;
2854
2855   counter = 0;
2856   move = DOWN;
2857   p = node;
2858   while (1)
2859     {
2860
2861       counter_old = counter;
2862       max_len_old = max_len;
2863       if (move != UP)
2864         {
2865           err = _asn1_insert_tag_der (p, der, &amp;counter, &max_len);
2866           if (err != ASN1_SUCCESS &amp;& err != ASN1_MEM_ERROR)
2867             goto error;
2868         }
2869       switch (type_field (p->type))
2870         {
2871         case TYPE_NULL:
2872           max_len--;
2873           if (max_len >= 0)
2874             der[counter] = 0;
2875           counter++;
2876           move = RIGHT;
2877           break;
2878         case TYPE_BOOLEAN:
2879           if ((p->type &amp; CONST_DEFAULT) && (p->value == NULL))
2880             {
2881               counter = counter_old;
2882               max_len = max_len_old;
2883             }
2884           else
2885             {
2886               if (p->value == NULL)
2887                 {
2888                   _asn1_error_description_value_not_found (p,
2889                                                            ErrorDescription);
2890                   err = ASN1_VALUE_NOT_FOUND;
2891                   goto error;
2892                 }
2893               max_len -= 2;
2894               if (max_len >= 0)
2895                 {
2896                   der[counter++] = 1;
2897                   if (p->value[0] == 'F')
2898                     der[counter++] = 0;
2899                   else
2900                     der[counter++] = 0xFF;
2901                 }
2902               else
2903                 counter += 2;
2904             }
2905           move = RIGHT;
2906           break;
2907         case TYPE_INTEGER:
2908         case TYPE_ENUMERATED:
2909           if ((p->type &amp; CONST_DEFAULT) && (p->value == NULL))
2910             {
2911               counter = counter_old;
2912               max_len = max_len_old;
2913             }
2914           else
2915             {
2916               if (p->value == NULL)
2917                 {
2918                   _asn1_error_description_value_not_found (p,
2919                                                            ErrorDescription);
2920                   err = ASN1_VALUE_NOT_FOUND;
2921                   goto error;
2922                 }
2923               len2 = asn1_get_length_der (p->value, p->value_len, &amp;len3);
2924               if (len2 < 0)
2925                 {
2926                   err = ASN1_DER_ERROR;
2927                   goto error;
2928                 }
2929               max_len -= len2 + len3;
2930               if (max_len >= 0)
2931                 memcpy (der + counter, p->value, len3 + len2);
2932               counter += len3 + len2;
2933             }
2934           move = RIGHT;
2935           break;
2936         case TYPE_OBJECT_ID:
2937           if ((p->type &amp; CONST_DEFAULT) && (p->value == NULL))
2938             {
2939               counter = counter_old;
2940               max_len = max_len_old;
2941             }
2942           else
2943             {
2944               if (p->value == NULL)
2945                 {
2946                   _asn1_error_description_value_not_found (p,
2947                                                            ErrorDescription);
2948                   err = ASN1_VALUE_NOT_FOUND;
2949                   goto error;
2950                 }
2951               len2 = max_len;
2952               err = _asn1_objectid_der (p->value, der + counter, &amp;len2);
2953               if (err != ASN1_SUCCESS &amp;& err != ASN1_MEM_ERROR)
2954                 goto error;
2955
2956               max_len -= len2;
2957               counter += len2;
2958             }
2959           move = RIGHT;
2960           break;
2961         case TYPE_TIME:
2962           if (p->value == NULL)
2963             {
2964               _asn1_error_description_value_not_found (p, ErrorDescription);
2965               err = ASN1_VALUE_NOT_FOUND;
2966               goto error;
2967             }
2968           len2 = max_len;
2969           err = _asn1_time_der (p->value, der + counter, &amp;len2);
2970           if (err != ASN1_SUCCESS &amp;& err != ASN1_MEM_ERROR)
2971             goto error;
2972
2973           max_len -= len2;
2974           counter += len2;
2975           move = RIGHT;
2976           break;
2977         case TYPE_OCTET_STRING:
2978           if (p->value == NULL)
2979             {
2980               _asn1_error_description_value_not_found (p, ErrorDescription);
2981               err = ASN1_VALUE_NOT_FOUND;
2982               goto error;
2983             }
2984           len2 = asn1_get_length_der (p->value, p->value_len, &amp;len3);
2985           if (len2 < 0)
2986             {
2987               err = ASN1_DER_ERROR;
2988               goto error;
2989             }
2990           max_len -= len2 + len3;
2991           if (max_len >= 0)
2992             memcpy (der + counter, p->value, len3 + len2);
2993           counter += len3 + len2;
2994           move = RIGHT;
2995           break;
2996         case TYPE_GENERALSTRING:
2997           if (p->value == NULL)
2998             {
2999               _asn1_error_description_value_not_found (p, ErrorDescription);
3000               err = ASN1_VALUE_NOT_FOUND;
3001               goto error;
3002             }
3003           len2 = asn1_get_length_der (p->value, p->value_len, &amp;len3);
3004           if (len2 < 0)
3005             {
3006               err = ASN1_DER_ERROR;
3007               goto error;
3008             }
3009           max_len -= len2 + len3;
3010           if (max_len >= 0)
3011             memcpy (der + counter, p->value, len3 + len2);
3012           counter += len3 + len2;
3013           move = RIGHT;
3014           break;
3015         case TYPE_BIT_STRING:
3016           if (p->value == NULL)
3017             {
3018               _asn1_error_description_value_not_found (p, ErrorDescription);
3019               err = ASN1_VALUE_NOT_FOUND;
3020               goto error;
3021             }
3022           len2 = asn1_get_length_der (p->value, p->value_len, &amp;len3);
3023           if (len2 < 0)
3024             {
3025               err = ASN1_DER_ERROR;
3026               goto error;
3027             }
3028           max_len -= len2 + len3;
3029           if (max_len >= 0)
3030             memcpy (der + counter, p->value, len3 + len2);
3031           counter += len3 + len2;
3032           move = RIGHT;
3033           break;
3034         case TYPE_SEQUENCE:
3035         case TYPE_SET:
3036           if (move != UP)
3037             {
3038               _asn1_ltostr (counter, temp);
3039               tlen = strlen (temp);
3040               if (tlen > 0)
3041                 _asn1_set_value (p, temp, tlen + 1);
3042               if (p->down == NULL)
3043                 {
3044                   move = UP;
3045                   continue;
3046                 }
3047               else
3048                 {
3049                   p2 = p->down;
3050                   while (p2 &amp;& (type_field (p2->type) == TYPE_TAG))
3051                     p2 = p2->right;
3052                   if (p2)
3053                     {
3054                       p = p2;
3055                       move = RIGHT;
3056                       continue;
3057                     }
3058                   move = UP;
3059                   continue;
3060                 }
3061             }
3062           else
3063             {                   /* move==UP */
3064               len2 = strtol (p->value, NULL, 10);
3065               _asn1_set_value (p, NULL, 0);
3066               if ((type_field (p->type) == TYPE_SET) &amp;& (max_len >= 0))
3067                 _asn1_ordering_set (der + len2, max_len - len2, p);
3068               asn1_length_der (counter - len2, temp, &amp;len3);
3069               max_len -= len3;
3070               if (max_len >= 0)
3071                 {
3072                   memmove (der + len2 + len3, der + len2, counter - len2);
3073                   memcpy (der + len2, temp, len3);
3074                 }
3075               counter += len3;
3076               move = RIGHT;
3077             }
3078           break;
3079         case TYPE_SEQUENCE_OF:
3080         case TYPE_SET_OF:
3081           if (move != UP)
3082             {
3083               _asn1_ltostr (counter, temp);
3084               tlen = strlen (temp);
3085
3086               if (tlen > 0)
3087                 _asn1_set_value (p, temp, tlen + 1);
3088               p = p->down;
3089               while ((type_field (p->type) == TYPE_TAG)
3090                      || (type_field (p->type) == TYPE_SIZE))
3091                 p = p->right;
3092               if (p->right)
3093                 {
3094                   p = p->right;
3095                   move = RIGHT;
3096                   continue;
3097                 }
3098               else
3099                 p = _asn1_find_up (p);
3100               move = UP;
3101             }
3102           if (move == UP)
3103             {
3104               len2 = strtol (p->value, NULL, 10);
3105               _asn1_set_value (p, NULL, 0);
3106               if ((type_field (p->type) == TYPE_SET_OF)
3107                   &amp;& (max_len - len2 > 0))
3108                 {
3109                   _asn1_ordering_set_of (der + len2, max_len - len2, p);
3110                 }
3111               asn1_length_der (counter - len2, temp, &amp;len3);
3112               max_len -= len3;
3113               if (max_len >= 0)
3114                 {
3115                   memmove (der + len2 + len3, der + len2, counter - len2);
3116                   memcpy (der + len2, temp, len3);
3117                 }
3118               counter += len3;
3119               move = RIGHT;
3120             }
3121           break;
3122         case TYPE_ANY:
3123           if (p->value == NULL)
3124             {
3125               _asn1_error_description_value_not_found (p, ErrorDescription);
3126               err = ASN1_VALUE_NOT_FOUND;
3127               goto error;
3128             }
3129           len2 = asn1_get_length_der (p->value, p->value_len, &amp;len3);
3130           if (len2 < 0)
3131             {
3132               err = ASN1_DER_ERROR;
3133               goto error;
3134             }
3135           max_len -= len2;
3136           if (max_len >= 0)
3137             memcpy (der + counter, p->value + len3, len2);
3138           counter += len2;
3139           move = RIGHT;
3140           break;
3141         default:
3142           move = (move == UP) ? RIGHT : DOWN;
3143           break;
3144         }
3145
3146       if ((move != DOWN) &amp;& (counter != counter_old))
3147         {
3148           err = _asn1_complete_explicit_tag (p, der, &amp;counter, &max_len);
3149           if (err != ASN1_SUCCESS &amp;& err != ASN1_MEM_ERROR)
3150             goto error;
3151         }
3152
3153       if (p == node &amp;& move != DOWN)
3154         break;
3155
3156       if (move == DOWN)
3157         {
3158           if (p->down)
3159             p = p->down;
3160           else
3161             move = RIGHT;
3162         }
3163       if (move == RIGHT)
3164         {
3165           if (p->right)
3166             p = p->right;
3167           else
3168             move = UP;
3169         }
3170       if (move == UP)
3171         p = _asn1_find_up (p);
3172     }
3173
3174   *len = counter;
3175
3176   if (max_len < 0)
3177     {
3178       err = ASN1_MEM_ERROR;
3179       goto error;
3180     }
3181
3182   err = ASN1_SUCCESS;
3183
3184 error:
3185   asn1_delete_structure (&amp;node);
3186   return err;
3187 }
3188 </pre>
3189 </div>
3190 </td>
3191 </tr>
3192 <tr class="function_entry_untestable">
3193 <td class="function_entry_filename">
3194 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_extract_tag_der_src', '_asn1_extract_tag_der_button')"><span id="_asn1_extract_tag_der_button">&darr;</span></a>
3195 </td>
3196 <td class="function_entry_name">
3197 _asn1_extract_tag_der
3198 </td>
3199 <td class="function_entry_cyclo">
3200 74
3201 </td>
3202 <td class="function_entry_number">
3203 105
3204 </td>
3205 <td class="function_entry_number">
3206 197
3207 </td>
3208 <td class="function_entry_filename">
3209 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/decoding.c;hb=HEAD">lib/decoding.c</a>
3210 </td>
3211 </tr>
3212 <tr>
3213 <td colspan="6" height="0">
3214 <div id="_asn1_extract_tag_der_src" class="function_src" style="position: relative; display: none;">
3215 <pre class="function_src">
3216 static int
3217 _asn1_extract_tag_der (ASN1_TYPE node, const unsigned char *der, int der_len,
3218                        int *ret_len)
3219 {
3220   ASN1_TYPE p;
3221   int counter, len2, len3, is_tag_implicit;
3222   unsigned long tag, tag_implicit = 0;
3223   unsigned char class, class2, class_implicit = 0;
3224
3225   if (der_len <= 0)
3226     return ASN1_GENERIC_ERROR;
3227
3228   counter = is_tag_implicit = 0;
3229
3230   if (node->type &amp; CONST_TAG)
3231     {
3232       p = node->down;
3233       while (p)
3234         {
3235           if (type_field (p->type) == TYPE_TAG)
3236             {
3237               if (p->type &amp; CONST_APPLICATION)
3238                 class2 = ASN1_CLASS_APPLICATION;
3239               else if (p->type &amp; CONST_UNIVERSAL)
3240                 class2 = ASN1_CLASS_UNIVERSAL;
3241               else if (p->type &amp; CONST_PRIVATE)
3242                 class2 = ASN1_CLASS_PRIVATE;
3243               else
3244                 class2 = ASN1_CLASS_CONTEXT_SPECIFIC;
3245
3246               if (p->type &amp; CONST_EXPLICIT)
3247                 {
3248                   if (asn1_get_tag_der
3249                       (der + counter, der_len - counter, &amp;class, &len2,
3250                        &amp;tag) != ASN1_SUCCESS)
3251                     return ASN1_DER_ERROR;
3252
3253                   if (counter + len2 > der_len)
3254                     return ASN1_DER_ERROR;
3255                   counter += len2;
3256
3257                   len3 =
3258                     asn1_get_length_ber (der + counter, der_len - counter,
3259                                          &amp;len2);
3260                   if (len3 < 0)
3261                     return ASN1_DER_ERROR;
3262
3263                   counter += len2;
3264                   if (counter > der_len)
3265                     return ASN1_DER_ERROR;
3266
3267                   if (!is_tag_implicit)
3268                     {
3269                       if ((class != (class2 | ASN1_CLASS_STRUCTURED)) ||
3270                           (tag != strtoul ((char *) p->value, NULL, 10)))
3271                         return ASN1_TAG_ERROR;
3272                     }
3273                   else
3274                     {           /* ASN1_TAG_IMPLICIT */
3275                       if ((class != class_implicit) || (tag != tag_implicit))
3276                         return ASN1_TAG_ERROR;
3277                     }
3278                   is_tag_implicit = 0;
3279                 }
3280               else
3281                 {               /* ASN1_TAG_IMPLICIT */
3282                   if (!is_tag_implicit)
3283                     {
3284                       if ((type_field (node->type) == TYPE_SEQUENCE) ||
3285                           (type_field (node->type) == TYPE_SEQUENCE_OF) ||
3286                           (type_field (node->type) == TYPE_SET) ||
3287                           (type_field (node->type) == TYPE_SET_OF))
3288                         class2 |= ASN1_CLASS_STRUCTURED;
3289                       class_implicit = class2;
3290                       tag_implicit = strtoul ((char *) p->value, NULL, 10);
3291                       is_tag_implicit = 1;
3292                     }
3293                 }
3294             }
3295           p = p->right;
3296         }
3297     }
3298
3299   if (is_tag_implicit)
3300     {
3301       if (asn1_get_tag_der
3302           (der + counter, der_len - counter, &amp;class, &len2,
3303            &amp;tag) != ASN1_SUCCESS)
3304         return ASN1_DER_ERROR;
3305       if (counter + len2 > der_len)
3306         return ASN1_DER_ERROR;
3307
3308       if ((class != class_implicit) || (tag != tag_implicit))
3309         {
3310           if (type_field (node->type) == TYPE_OCTET_STRING)
3311             {
3312               class_implicit |= ASN1_CLASS_STRUCTURED;
3313               if ((class != class_implicit) || (tag != tag_implicit))
3314                 return ASN1_TAG_ERROR;
3315             }
3316           else
3317             return ASN1_TAG_ERROR;
3318         }
3319     }
3320   else
3321     {
3322       if (type_field (node->type) == TYPE_TAG)
3323         {
3324           counter = 0;
3325           *ret_len = counter;
3326           return ASN1_SUCCESS;
3327         }
3328
3329       if (asn1_get_tag_der
3330           (der + counter, der_len - counter, &amp;class, &len2,
3331            &amp;tag) != ASN1_SUCCESS)
3332         return ASN1_DER_ERROR;
3333
3334       if (counter + len2 > der_len)
3335         return ASN1_DER_ERROR;
3336
3337       switch (type_field (node->type))
3338         {
3339         case TYPE_NULL:
3340           if ((class != ASN1_CLASS_UNIVERSAL) || (tag != ASN1_TAG_NULL))
3341             return ASN1_DER_ERROR;
3342           break;
3343         case TYPE_BOOLEAN:
3344           if ((class != ASN1_CLASS_UNIVERSAL) || (tag != ASN1_TAG_BOOLEAN))
3345             return ASN1_DER_ERROR;
3346           break;
3347         case TYPE_INTEGER:
3348           if ((class != ASN1_CLASS_UNIVERSAL) || (tag != ASN1_TAG_INTEGER))
3349             return ASN1_DER_ERROR;
3350           break;
3351         case TYPE_ENUMERATED:
3352           if ((class != ASN1_CLASS_UNIVERSAL) || (tag != ASN1_TAG_ENUMERATED))
3353             return ASN1_DER_ERROR;
3354           break;
3355         case TYPE_OBJECT_ID:
3356           if ((class != ASN1_CLASS_UNIVERSAL) || (tag != ASN1_TAG_OBJECT_ID))
3357             return ASN1_DER_ERROR;
3358           break;
3359         case TYPE_TIME:
3360           if (node->type &amp; CONST_UTC)
3361             {
3362               if ((class != ASN1_CLASS_UNIVERSAL)
3363                   || (tag != ASN1_TAG_UTCTime))
3364                 return ASN1_DER_ERROR;
3365             }
3366           else
3367             {
3368               if ((class != ASN1_CLASS_UNIVERSAL)
3369                   || (tag != ASN1_TAG_GENERALIZEDTime))
3370                 return ASN1_DER_ERROR;
3371             }
3372           break;
3373         case TYPE_OCTET_STRING:
3374           if (((class != ASN1_CLASS_UNIVERSAL)
3375                &amp;& (class != (ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED)))
3376               || (tag != ASN1_TAG_OCTET_STRING))
3377             return ASN1_DER_ERROR;
3378           break;
3379         case TYPE_GENERALSTRING:
3380           if ((class != ASN1_CLASS_UNIVERSAL)
3381               || (tag != ASN1_TAG_GENERALSTRING))
3382             return ASN1_DER_ERROR;
3383           break;
3384         case TYPE_BIT_STRING:
3385           if ((class != ASN1_CLASS_UNIVERSAL) || (tag != ASN1_TAG_BIT_STRING))
3386             return ASN1_DER_ERROR;
3387           break;
3388         case TYPE_SEQUENCE:
3389         case TYPE_SEQUENCE_OF:
3390           if ((class != (ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED))
3391               || (tag != ASN1_TAG_SEQUENCE))
3392             return ASN1_DER_ERROR;
3393           break;
3394         case TYPE_SET:
3395         case TYPE_SET_OF:
3396           if ((class != (ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED))
3397               || (tag != ASN1_TAG_SET))
3398             return ASN1_DER_ERROR;
3399           break;
3400         case TYPE_ANY:
3401           counter -= len2;
3402           break;
3403         default:
3404           return ASN1_DER_ERROR;
3405           break;
3406         }
3407     }
3408
3409   counter += len2;
3410   *ret_len = counter;
3411   return ASN1_SUCCESS;
3412 }
3413 </pre>
3414 </div>
3415 </td>
3416 </tr>
3417 <tr class="function_entry_high">
3418 <td class="function_entry_filename">
3419 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('yyparse_src', 'yyparse_button')"><span id="yyparse_button">&darr;</span></a>
3420 </td>
3421 <td class="function_entry_name">
3422 yyparse
3423 </td>
3424 <td class="function_entry_cyclo">
3425 142
3426 </td>
3427 <td class="function_entry_number">
3428 432
3429 </td>
3430 <td class="function_entry_number">
3431 1199
3432 </td>
3433 <td class="function_entry_filename">
3434 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/ASN1.c;hb=HEAD">lib/ASN1.c</a>
3435 </td>
3436 </tr>
3437 <tr>
3438 <td colspan="6" height="0">
3439 <div id="yyparse_src" class="function_src" style="position: relative; display: none;">
3440 <pre class="function_src">
3441 int
3442 yyparse (void *YYPARSE_PARAM)
3443 #else
3444 int
3445 yyparse (YYPARSE_PARAM)
3446     void *YYPARSE_PARAM;
3447 #endif
3448 #else /* ! YYPARSE_PARAM */
3449 #if (defined __STDC__ || defined __C99__FUNC__ \
3450      || defined __cplusplus || defined _MSC_VER)
3451 int
3452 yyparse (void)
3453 #else
3454 int
3455 yyparse ()
3456
3457 #endif
3458 #endif
3459 {
3460
3461
3462     int yystate;
3463     /* Number of tokens to shift before error messages enabled.  */
3464     int yyerrstatus;
3465
3466     /* The stacks and their tools:
3467        `yyss': related to states.
3468        `yyvs': related to semantic values.
3469
3470        Refer to the stacks thru separate pointers, to allow yyoverflow
3471        to reallocate them elsewhere.  */
3472
3473     /* The state stack.  */
3474     yytype_int16 yyssa[YYINITDEPTH];
3475     yytype_int16 *yyss;
3476     yytype_int16 *yyssp;
3477
3478     /* The semantic value stack.  */
3479     YYSTYPE yyvsa[YYINITDEPTH];
3480     YYSTYPE *yyvs;
3481     YYSTYPE *yyvsp;
3482
3483     YYSIZE_T yystacksize;
3484
3485   int yyn;
3486   int yyresult;
3487   /* Lookahead token as an internal (translated) token number.  */
3488   int yytoken;
3489   /* The variables used to return semantic value and location from the
3490      action routines.  */
3491   YYSTYPE yyval;
3492
3493 #if YYERROR_VERBOSE
3494   /* Buffer for error messages, and its allocated size.  */
3495   char yymsgbuf[128];
3496   char *yymsg = yymsgbuf;
3497   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3498 #endif
3499
3500 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
3501
3502   /* The number of symbols on the RHS of the reduced rule.
3503      Keep to zero when no symbol should be popped.  */
3504   int yylen = 0;
3505
3506   yytoken = 0;
3507   yyss = yyssa;
3508   yyvs = yyvsa;
3509   yystacksize = YYINITDEPTH;
3510
3511   YYDPRINTF ((stderr, "Starting parse\n"));
3512
3513   yystate = 0;
3514   yyerrstatus = 0;
3515   yynerrs = 0;
3516   yychar = YYEMPTY; /* Cause a token to be read.  */
3517
3518   /* Initialize stack pointers.
3519      Waste one element of value and location stack
3520      so that they stay on the same level as the state stack.
3521      The wasted elements are never initialized.  */
3522   yyssp = yyss;
3523   yyvsp = yyvs;
3524
3525   goto yysetstate;
3526
3527 /*------------------------------------------------------------.
3528 | yynewstate -- Push a new state, which is found in yystate.  |
3529 `------------------------------------------------------------*/
3530  yynewstate:
3531   /* In all cases, when you get here, the value and location stacks
3532      have just been pushed.  So pushing a state here evens the stacks.  */
3533   yyssp++;
3534
3535  yysetstate:
3536   *yyssp = yystate;
3537
3538   if (yyss + yystacksize - 1 <= yyssp)
3539     {
3540       /* Get the current used size of the three stacks, in elements.  */
3541       YYSIZE_T yysize = yyssp - yyss + 1;
3542
3543 #ifdef yyoverflow
3544       {
3545         /* Give user a chance to reallocate the stack.  Use copies of
3546            these so that the &amp;'s don't force the real ones into
3547            memory.  */
3548         YYSTYPE *yyvs1 = yyvs;
3549         yytype_int16 *yyss1 = yyss;
3550
3551         /* Each stack pointer address is followed by the size of the
3552            data in use in that stack, in bytes.  This used to be a
3553            conditional around just the two extra args, but that might
3554            be undefined if yyoverflow is a macro.  */
3555         yyoverflow (YY_("memory exhausted"),
3556                     &amp;yyss1, yysize * sizeof (*yyssp),
3557                     &amp;yyvs1, yysize * sizeof (*yyvsp),
3558                     &amp;yystacksize);
3559
3560         yyss = yyss1;
3561         yyvs = yyvs1;
3562       }
3563 #else /* no yyoverflow */
3564 # ifndef YYSTACK_RELOCATE
3565       goto yyexhaustedlab;
3566 # else
3567       /* Extend the stack our own way.  */
3568       if (YYMAXDEPTH <= yystacksize)
3569         goto yyexhaustedlab;
3570       yystacksize *= 2;
3571       if (YYMAXDEPTH < yystacksize)
3572         yystacksize = YYMAXDEPTH;
3573
3574       {
3575         yytype_int16 *yyss1 = yyss;
3576         union yyalloc *yyptr =
3577           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3578         if (! yyptr)
3579           goto yyexhaustedlab;
3580         YYSTACK_RELOCATE (yyss_alloc, yyss);
3581         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
3582 #  undef YYSTACK_RELOCATE
3583         if (yyss1 != yyssa)
3584           YYSTACK_FREE (yyss1);
3585       }
3586 # endif
3587 #endif /* no yyoverflow */
3588
3589       yyssp = yyss + yysize - 1;
3590       yyvsp = yyvs + yysize - 1;
3591
3592       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3593                   (unsigned long int) yystacksize));
3594
3595       if (yyss + yystacksize - 1 <= yyssp)
3596         YYABORT;
3597     }
3598
3599   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3600
3601   if (yystate == YYFINAL)
3602     YYACCEPT;
3603
3604   goto yybackup;
3605
3606 /*-----------.
3607 | yybackup.  |
3608 `-----------*/
3609 yybackup:
3610
3611   /* Do appropriate processing given the current state.  Read a
3612      lookahead token if we need one and don't already have one.  */
3613
3614   /* First try to decide what to do without reference to lookahead token.  */
3615   yyn = yypact[yystate];
3616   if (yyn == YYPACT_NINF)
3617     goto yydefault;
3618
3619   /* Not known => get a lookahead token if don't already have one.  */
3620
3621   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
3622   if (yychar == YYEMPTY)
3623     {
3624       YYDPRINTF ((stderr, "Reading a token: "));
3625       yychar = YYLEX;
3626     }
3627
3628   if (yychar <= YYEOF)
3629     {
3630       yychar = yytoken = YYEOF;
3631       YYDPRINTF ((stderr, "Now at end of input.\n"));
3632     }
3633   else
3634     {
3635       yytoken = YYTRANSLATE (yychar);
3636       YY_SYMBOL_PRINT ("Next token is", yytoken, &amp;yylval, &yylloc);
3637     }
3638
3639   /* If the proper action on seeing token YYTOKEN is to reduce or to
3640      detect an error, take that action.  */
3641   yyn += yytoken;
3642   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3643     goto yydefault;
3644   yyn = yytable[yyn];
3645   if (yyn <= 0)
3646     {
3647       if (yyn == 0 || yyn == YYTABLE_NINF)
3648         goto yyerrlab;
3649       yyn = -yyn;
3650       goto yyreduce;
3651     }
3652
3653   /* Count tokens shifted since error; after three, turn off error
3654      status.  */
3655   if (yyerrstatus)
3656     yyerrstatus--;
3657
3658   /* Shift the lookahead token.  */
3659   YY_SYMBOL_PRINT ("Shifting", yytoken, &amp;yylval, &yylloc);
3660
3661   /* Discard the shifted token.  */
3662   yychar = YYEMPTY;
3663
3664   yystate = yyn;
3665   *++yyvsp = yylval;
3666
3667   goto yynewstate;
3668
3669
3670 /*-----------------------------------------------------------.
3671 | yydefault -- do the default action for the current state.  |
3672 `-----------------------------------------------------------*/
3673 yydefault:
3674   yyn = yydefact[yystate];
3675   if (yyn == 0)
3676     goto yyerrlab;
3677   goto yyreduce;
3678
3679
3680 /*-----------------------------.
3681 | yyreduce -- Do a reduction.  |
3682 `-----------------------------*/
3683 yyreduce:
3684   /* yyn is the number of a rule to reduce with.  */
3685   yylen = yyr2[yyn];
3686
3687   /* If YYLEN is nonzero, implement the default value of the action:
3688      `$$ = $1'.
3689
3690      Otherwise, the following line sets YYVAL to garbage.
3691      This behavior is undocumented and Bison
3692      users should not rely upon it.  Assigning to YYVAL
3693      unconditionally makes the parser a bit smaller, and it avoids a
3694      GCC warning that YYVAL may be used uninitialized.  */
3695   yyval = yyvsp[1-yylen];
3696
3697
3698   YY_REDUCE_PRINT (yyn);
3699   switch (yyn)
3700     {
3701         case 2:
3702
3703 /* Line 1455 of yacc.c  */
3704 #line 122 "ASN1.y"
3705     {(yyval.node)=_asn1_add_node(TYPE_DEFINITIONS|(yyvsp[(3) - (8)].constant));
3706                     _asn1_set_name((yyval.node),_asn1_get_name((yyvsp[(1) - (8)].node)));
3707                     _asn1_set_name((yyvsp[(1) - (8)].node),"");
3708                     _asn1_set_right((yyvsp[(1) - (8)].node),(yyvsp[(7) - (8)].node));
3709                     _asn1_set_down((yyval.node),(yyvsp[(1) - (8)].node));
3710
3711                     p_tree=(yyval.node);
3712                     }
3713     break;
3714
3715   case 3:
3716
3717 /* Line 1455 of yacc.c  */
3718 #line 132 "ASN1.y"
3719     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
3720     break;
3721
3722   case 4:
3723
3724 /* Line 1455 of yacc.c  */
3725 #line 133 "ASN1.y"
3726     {strcpy((yyval.str),(yyvsp[(2) - (2)].str));}
3727     break;
3728
3729   case 5:
3730
3731 /* Line 1455 of yacc.c  */
3732 #line 136 "ASN1.y"
3733     {strcpy((yyval.str),"-");
3734                        strcat((yyval.str),(yyvsp[(2) - (2)].str));}
3735     break;
3736
3737   case 6:
3738
3739 /* Line 1455 of yacc.c  */
3740 #line 140 "ASN1.y"
3741     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
3742     break;
3743
3744   case 7:
3745
3746 /* Line 1455 of yacc.c  */
3747 #line 141 "ASN1.y"
3748     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
3749     break;
3750
3751   case 8:
3752
3753 /* Line 1455 of yacc.c  */
3754 #line 144 "ASN1.y"
3755     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
3756     break;
3757
3758   case 9:
3759
3760 /* Line 1455 of yacc.c  */
3761 #line 145 "ASN1.y"
3762     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
3763     break;
3764
3765   case 10:
3766
3767 /* Line 1455 of yacc.c  */
3768 #line 148 "ASN1.y"
3769     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
3770     break;
3771
3772   case 11:
3773
3774 /* Line 1455 of yacc.c  */
3775 #line 149 "ASN1.y"
3776     {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
3777     break;
3778
3779   case 12:
3780
3781 /* Line 1455 of yacc.c  */
3782 #line 152 "ASN1.y"
3783     {(yyval.node)=_asn1_add_node(TYPE_CONSTANT);
3784                                        _asn1_set_value((yyval.node),(yyvsp[(2) - (3)].str),strlen((yyvsp[(2) - (3)].str))+1);}
3785     break;
3786
3787   case 13:
3788
3789 /* Line 1455 of yacc.c  */
3790 #line 154 "ASN1.y"
3791     {(yyval.node)=_asn1_add_node(TYPE_CONSTANT);
3792                                        _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str));
3793                                        _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);}
3794     break;
3795
3796   case 14:
3797
3798 /* Line 1455 of yacc.c  */
3799 #line 159 "ASN1.y"
3800     {(yyval.node)=(yyvsp[(1) - (1)].node);}
3801     break;
3802
3803   case 15:
3804
3805 /* Line 1455 of yacc.c  */
3806 #line 160 "ASN1.y"
3807     {(yyval.node)=(yyvsp[(1) - (3)].node);
3808                                             _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (3)].node)),(yyvsp[(3) - (3)].node));}
3809     break;
3810
3811   case 16:
3812
3813 /* Line 1455 of yacc.c  */
3814 #line 164 "ASN1.y"
3815     {(yyval.node)=_asn1_add_node(TYPE_CONSTANT);
3816                                    _asn1_set_value((yyval.node),(yyvsp[(1) - (1)].str),strlen((yyvsp[(1) - (1)].str))+1);}
3817     break;
3818
3819   case 17:
3820
3821 /* Line 1455 of yacc.c  */
3822 #line 166 "ASN1.y"
3823     {(yyval.node)=_asn1_add_node(TYPE_CONSTANT);
3824                                     _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str));
3825                                     _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);}
3826     break;
3827
3828   case 18:
3829
3830 /* Line 1455 of yacc.c  */
3831 #line 171 "ASN1.y"
3832     {(yyval.node)=(yyvsp[(1) - (1)].node);}
3833     break;
3834
3835   case 19:
3836
3837 /* Line 1455 of yacc.c  */
3838 #line 172 "ASN1.y"
3839     {(yyval.node)=(yyvsp[(1) - (2)].node);
3840                                                     _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (2)].node)),(yyvsp[(2) - (2)].node));}
3841     break;
3842
3843   case 20:
3844
3845 /* Line 1455 of yacc.c  */
3846 #line 176 "ASN1.y"
3847     {(yyval.constant)=CONST_UNIVERSAL;}
3848     break;
3849
3850   case 21:
3851
3852 /* Line 1455 of yacc.c  */
3853 #line 177 "ASN1.y"
3854     {(yyval.constant)=CONST_PRIVATE;}
3855     break;
3856
3857   case 22:
3858
3859 /* Line 1455 of yacc.c  */
3860 #line 178 "ASN1.y"
3861     {(yyval.constant)=CONST_APPLICATION;}
3862     break;
3863
3864   case 23:
3865
3866 /* Line 1455 of yacc.c  */
3867 #line 181 "ASN1.y"
3868     {(yyval.node)=_asn1_add_node(TYPE_TAG);
3869                             _asn1_set_value((yyval.node),(yyvsp[(2) - (3)].str),strlen((yyvsp[(2) - (3)].str))+1);}
3870     break;
3871
3872   case 24:
3873
3874 /* Line 1455 of yacc.c  */
3875 #line 183 "ASN1.y"
3876     {(yyval.node)=_asn1_add_node(TYPE_TAG | (yyvsp[(2) - (4)].constant));
3877                                 _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);}
3878     break;
3879
3880   case 25:
3881
3882 /* Line 1455 of yacc.c  */
3883 #line 187 "ASN1.y"
3884     {(yyval.node)=(yyvsp[(1) - (1)].node);}
3885     break;
3886
3887   case 26:
3888
3889 /* Line 1455 of yacc.c  */
3890 #line 188 "ASN1.y"
3891     {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_EXPLICIT);}
3892     break;
3893
3894   case 27:
3895
3896 /* Line 1455 of yacc.c  */
3897 #line 189 "ASN1.y"
3898     {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_IMPLICIT);}
3899     break;
3900
3901   case 28:
3902
3903 /* Line 1455 of yacc.c  */
3904 #line 192 "ASN1.y"
3905     {(yyval.node)=_asn1_add_node(TYPE_DEFAULT);
3906                                        _asn1_set_value((yyval.node),(yyvsp[(2) - (2)].str),strlen((yyvsp[(2) - (2)].str))+1);}
3907     break;
3908
3909   case 29:
3910
3911 /* Line 1455 of yacc.c  */
3912 #line 194 "ASN1.y"
3913     {(yyval.node)=_asn1_add_node(TYPE_DEFAULT|CONST_TRUE);}
3914     break;
3915
3916   case 30:
3917
3918 /* Line 1455 of yacc.c  */
3919 #line 195 "ASN1.y"
3920     {(yyval.node)=_asn1_add_node(TYPE_DEFAULT|CONST_FALSE);}
3921     break;
3922
3923   case 33:
3924
3925 /* Line 1455 of yacc.c  */
3926 #line 204 "ASN1.y"
3927     {(yyval.node)=_asn1_add_node(TYPE_INTEGER);}
3928     break;
3929
3930   case 34:
3931
3932 /* Line 1455 of yacc.c  */
3933 #line 205 "ASN1.y"
3934     {(yyval.node)=_asn1_add_node(TYPE_INTEGER|CONST_LIST);
3935                                          _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
3936     break;
3937
3938   case 35:
3939
3940 /* Line 1455 of yacc.c  */
3941 #line 207 "ASN1.y"
3942     {(yyval.node)=_asn1_add_node(TYPE_INTEGER);}
3943     break;
3944
3945   case 36:
3946
3947 /* Line 1455 of yacc.c  */
3948 #line 209 "ASN1.y"
3949     {(yyval.node)=_asn1_add_node(TYPE_INTEGER|CONST_MIN_MAX);
3950                                          _asn1_set_down((yyval.node),_asn1_add_node(TYPE_SIZE));
3951                                          _asn1_set_value(_asn1_get_down((yyval.node)),(yyvsp[(6) - (7)].str),strlen((yyvsp[(6) - (7)].str))+1);
3952                                          _asn1_set_name(_asn1_get_down((yyval.node)),(yyvsp[(3) - (7)].str));}
3953     break;
3954
3955   case 37:
3956
3957 /* Line 1455 of yacc.c  */
3958 #line 215 "ASN1.y"
3959     {(yyval.node)=_asn1_add_node(TYPE_BOOLEAN);}
3960     break;
3961
3962   case 38:
3963
3964 /* Line 1455 of yacc.c  */
3965 #line 218 "ASN1.y"
3966     {(yyval.node)=_asn1_add_node(TYPE_TIME|CONST_UTC);}
3967     break;
3968
3969   case 39:
3970
3971 /* Line 1455 of yacc.c  */
3972 #line 219 "ASN1.y"
3973     {(yyval.node)=_asn1_add_node(TYPE_TIME|CONST_GENERALIZED);}
3974     break;
3975
3976   case 40:
3977
3978 /* Line 1455 of yacc.c  */
3979 #line 222 "ASN1.y"
3980     {(yyval.node)=_asn1_add_node(TYPE_SIZE|CONST_1_PARAM);
3981                                       _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);}
3982     break;
3983
3984   case 41:
3985
3986 /* Line 1455 of yacc.c  */
3987 #line 225 "ASN1.y"
3988     {(yyval.node)=_asn1_add_node(TYPE_SIZE|CONST_MIN_MAX);
3989                                       _asn1_set_value((yyval.node),(yyvsp[(3) - (7)].str),strlen((yyvsp[(3) - (7)].str))+1);
3990                                       _asn1_set_name((yyval.node),(yyvsp[(6) - (7)].str));}
3991     break;
3992
3993   case 42:
3994
3995 /* Line 1455 of yacc.c  */
3996 #line 230 "ASN1.y"
3997     {(yyval.node)=(yyvsp[(1) - (1)].node);}
3998     break;
3999
4000   case 43:
4001
4002 /* Line 1455 of yacc.c  */
4003 #line 231 "ASN1.y"
4004     {(yyval.node)=(yyvsp[(2) - (3)].node);}
4005     break;
4006
4007   case 44:
4008
4009 /* Line 1455 of yacc.c  */
4010 #line 234 "ASN1.y"
4011     {(yyval.node)=_asn1_add_node(TYPE_GENERALSTRING);}
4012     break;
4013
4014   case 45:
4015
4016 /* Line 1455 of yacc.c  */
4017 #line 235 "ASN1.y"
4018     {(yyval.node)=_asn1_add_node(TYPE_GENERALSTRING|CONST_SIZE);
4019                                           _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
4020     break;
4021
4022   case 46:
4023
4024 /* Line 1455 of yacc.c  */
4025 #line 239 "ASN1.y"
4026     {(yyval.node)=_asn1_add_node(TYPE_OCTET_STRING);}
4027     break;
4028
4029   case 47:
4030
4031 /* Line 1455 of yacc.c  */
4032 #line 240 "ASN1.y"
4033     {(yyval.node)=_asn1_add_node(TYPE_OCTET_STRING|CONST_SIZE);
4034                                            _asn1_set_down((yyval.node),(yyvsp[(3) - (3)].node));}
4035     break;
4036
4037   case 48:
4038
4039 /* Line 1455 of yacc.c  */
4040 #line 244 "ASN1.y"
4041     {(yyval.node)=_asn1_add_node(TYPE_CONSTANT);
4042                                    _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str));
4043                                     _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);}
4044     break;
4045
4046   case 49:
4047
4048 /* Line 1455 of yacc.c  */
4049 #line 249 "ASN1.y"
4050     {(yyval.node)=(yyvsp[(1) - (1)].node);}
4051     break;
4052
4053   case 50:
4054
4055 /* Line 1455 of yacc.c  */
4056 #line 250 "ASN1.y"
4057     {(yyval.node)=(yyvsp[(1) - (3)].node);
4058                                                        _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (3)].node)),(yyvsp[(3) - (3)].node));}
4059     break;
4060
4061   case 51:
4062
4063 /* Line 1455 of yacc.c  */
4064 #line 254 "ASN1.y"
4065     {(yyval.node)=_asn1_add_node(TYPE_BIT_STRING);}
4066     break;
4067
4068   case 52:
4069
4070 /* Line 1455 of yacc.c  */
4071 #line 255 "ASN1.y"
4072     {(yyval.node)=_asn1_add_node(TYPE_BIT_STRING|CONST_SIZE);}
4073     break;
4074
4075   case 53:
4076
4077 /* Line 1455 of yacc.c  */
4078 #line 257 "ASN1.y"
4079     {(yyval.node)=_asn1_add_node(TYPE_BIT_STRING|CONST_LIST);
4080                                 _asn1_set_down((yyval.node),(yyvsp[(4) - (5)].node));}
4081     break;
4082
4083   case 54:
4084
4085 /* Line 1455 of yacc.c  */
4086 #line 262 "ASN1.y"
4087     {(yyval.node)=_asn1_add_node(TYPE_ENUMERATED|CONST_LIST);
4088                                 _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
4089     break;
4090
4091   case 55:
4092
4093 /* Line 1455 of yacc.c  */
4094 #line 267 "ASN1.y"
4095     {(yyval.node)=_asn1_add_node(TYPE_OBJECT_ID);}
4096     break;
4097
4098   case 56:
4099
4100 /* Line 1455 of yacc.c  */
4101 #line 270 "ASN1.y"
4102     {(yyval.node)=_asn1_add_node(TYPE_IDENTIFIER);
4103                                        _asn1_set_value((yyval.node),(yyvsp[(1) - (1)].str),strlen((yyvsp[(1) - (1)].str))+1);}
4104     break;
4105
4106   case 57:
4107
4108 /* Line 1455 of yacc.c  */
4109 #line 272 "ASN1.y"
4110     {(yyval.node)=_asn1_add_node(TYPE_IDENTIFIER|CONST_SIZE);
4111                                        _asn1_set_value((yyval.node),(yyvsp[(1) - (2)].str),strlen((yyvsp[(1) - (2)].str))+1);
4112                                        _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
4113     break;
4114
4115   case 58:
4116
4117 /* Line 1455 of yacc.c  */
4118 #line 275 "ASN1.y"
4119     {(yyval.node)=(yyvsp[(1) - (1)].node);}
4120     break;
4121
4122   case 59:
4123
4124 /* Line 1455 of yacc.c  */
4125 #line 276 "ASN1.y"
4126     {(yyval.node)=(yyvsp[(1) - (1)].node);}
4127     break;
4128
4129   case 60:
4130
4131 /* Line 1455 of yacc.c  */
4132 #line 277 "ASN1.y"
4133     {(yyval.node)=(yyvsp[(1) - (1)].node);}
4134     break;
4135
4136   case 62:
4137
4138 /* Line 1455 of yacc.c  */
4139 #line 279 "ASN1.y"
4140     {(yyval.node)=(yyvsp[(1) - (1)].node);}
4141     break;
4142
4143   case 63:
4144
4145 /* Line 1455 of yacc.c  */
4146 #line 280 "ASN1.y"
4147     {(yyval.node)=(yyvsp[(1) - (1)].node);}
4148     break;
4149
4150   case 64:
4151
4152 /* Line 1455 of yacc.c  */
4153 #line 281 "ASN1.y"
4154     {(yyval.node)=(yyvsp[(1) - (1)].node);}
4155     break;
4156
4157   case 65:
4158
4159 /* Line 1455 of yacc.c  */
4160 #line 282 "ASN1.y"
4161     {(yyval.node)=(yyvsp[(1) - (1)].node);}
4162     break;
4163
4164   case 66:
4165
4166 /* Line 1455 of yacc.c  */
4167 #line 283 "ASN1.y"
4168     {(yyval.node)=(yyvsp[(1) - (1)].node);}
4169     break;
4170
4171   case 67:
4172
4173 /* Line 1455 of yacc.c  */
4174 #line 284 "ASN1.y"
4175     {(yyval.node)=(yyvsp[(1) - (1)].node);}
4176     break;
4177
4178   case 68:
4179
4180 /* Line 1455 of yacc.c  */
4181 #line 285 "ASN1.y"
4182     {(yyval.node)=(yyvsp[(1) - (1)].node);}
4183     break;
4184
4185   case 69:
4186
4187 /* Line 1455 of yacc.c  */
4188 #line 286 "ASN1.y"
4189     {(yyval.node)=(yyvsp[(1) - (1)].node);}
4190     break;
4191
4192   case 70:
4193
4194 /* Line 1455 of yacc.c  */
4195 #line 287 "ASN1.y"
4196     {(yyval.node)=_asn1_add_node(TYPE_NULL);}
4197     break;
4198
4199   case 71:
4200
4201 /* Line 1455 of yacc.c  */
4202 #line 290 "ASN1.y"
4203     {(yyval.node)=(yyvsp[(1) - (1)].node);}
4204     break;
4205
4206   case 72:
4207
4208 /* Line 1455 of yacc.c  */
4209 #line 291 "ASN1.y"
4210     {(yyval.node)=_asn1_mod_type((yyvsp[(2) - (2)].node),CONST_TAG);
4211                                                _asn1_set_right((yyvsp[(1) - (2)].node),_asn1_get_down((yyval.node)));
4212                                                _asn1_set_down((yyval.node),(yyvsp[(1) - (2)].node));}
4213     break;
4214
4215   case 73:
4216
4217 /* Line 1455 of yacc.c  */
4218 #line 296 "ASN1.y"
4219     {(yyval.node)=(yyvsp[(1) - (1)].node);}
4220     break;
4221
4222   case 74:
4223
4224 /* Line 1455 of yacc.c  */
4225 #line 297 "ASN1.y"
4226     {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_DEFAULT);
4227                                                        _asn1_set_right((yyvsp[(2) - (2)].node),_asn1_get_down((yyval.node)));
4228                                                        _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
4229     break;
4230
4231   case 75:
4232
4233 /* Line 1455 of yacc.c  */
4234 #line 300 "ASN1.y"
4235     {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_OPTION);}
4236     break;
4237
4238   case 76:
4239
4240 /* Line 1455 of yacc.c  */
4241 #line 303 "ASN1.y"
4242     {(yyval.node)=_asn1_set_name((yyvsp[(2) - (2)].node),(yyvsp[(1) - (2)].str));}
4243     break;
4244
4245   case 77:
4246
4247 /* Line 1455 of yacc.c  */
4248 #line 306 "ASN1.y"
4249     {(yyval.node)=(yyvsp[(1) - (1)].node);}
4250     break;
4251
4252   case 78:
4253
4254 /* Line 1455 of yacc.c  */
4255 #line 307 "ASN1.y"
4256     {(yyval.node)=(yyvsp[(1) - (3)].node);
4257                                                 _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (3)].node)),(yyvsp[(3) - (3)].node));}
4258     break;
4259
4260   case 79:
4261
4262 /* Line 1455 of yacc.c  */
4263 #line 311 "ASN1.y"
4264     {(yyval.node)=_asn1_add_node(TYPE_SEQUENCE);
4265                                               _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
4266     break;
4267
4268   case 80:
4269
4270 /* Line 1455 of yacc.c  */
4271 #line 313 "ASN1.y"
4272     {(yyval.node)=_asn1_add_node(TYPE_SEQUENCE_OF);
4273                                               _asn1_set_down((yyval.node),(yyvsp[(3) - (3)].node));}
4274     break;
4275
4276   case 81:
4277
4278 /* Line 1455 of yacc.c  */
4279 #line 315 "ASN1.y"
4280     {(yyval.node)=_asn1_add_node(TYPE_SEQUENCE_OF|CONST_SIZE);
4281                                             _asn1_set_right((yyvsp[(2) - (4)].node),(yyvsp[(4) - (4)].node));
4282                                             _asn1_set_down((yyval.node),(yyvsp[(2) - (4)].node));}
4283     break;
4284
4285   case 82:
4286
4287 /* Line 1455 of yacc.c  */
4288 #line 320 "ASN1.y"
4289     {(yyval.node)=_asn1_add_node(TYPE_SET);
4290                                      _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
4291     break;
4292
4293   case 83:
4294
4295 /* Line 1455 of yacc.c  */
4296 #line 322 "ASN1.y"
4297     {(yyval.node)=_asn1_add_node(TYPE_SET_OF);
4298                                      _asn1_set_down((yyval.node),(yyvsp[(3) - (3)].node));}
4299     break;
4300
4301   case 84:
4302
4303 /* Line 1455 of yacc.c  */
4304 #line 324 "ASN1.y"
4305     {(yyval.node)=_asn1_add_node(TYPE_SET_OF|CONST_SIZE);
4306                                        _asn1_set_right((yyvsp[(2) - (4)].node),(yyvsp[(4) - (4)].node));
4307                                        _asn1_set_down((yyval.node),(yyvsp[(2) - (4)].node));}
4308     break;
4309
4310   case 85:
4311
4312 /* Line 1455 of yacc.c  */
4313 #line 329 "ASN1.y"
4314     {(yyval.node)=_asn1_add_node(TYPE_CHOICE);
4315                                              _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
4316     break;
4317
4318   case 86:
4319
4320 /* Line 1455 of yacc.c  */
4321 #line 333 "ASN1.y"
4322     {(yyval.node)=_asn1_add_node(TYPE_ANY);}
4323     break;
4324
4325   case 87:
4326
4327 /* Line 1455 of yacc.c  */
4328 #line 334 "ASN1.y"
4329     {(yyval.node)=_asn1_add_node(TYPE_ANY|CONST_DEFINED_BY);
4330                                         _asn1_set_down((yyval.node),_asn1_add_node(TYPE_CONSTANT));
4331                                         _asn1_set_name(_asn1_get_down((yyval.node)),(yyvsp[(4) - (4)].str));}
4332     break;
4333
4334   case 88:
4335
4336 /* Line 1455 of yacc.c  */
4337 #line 339 "ASN1.y"
4338     {(yyval.node)=_asn1_set_name((yyvsp[(3) - (3)].node),(yyvsp[(1) - (3)].str));}
4339     break;
4340
4341   case 89:
4342
4343 /* Line 1455 of yacc.c  */
4344 #line 343 "ASN1.y"
4345     {(yyval.node)=_asn1_add_node(TYPE_OBJECT_ID|CONST_ASSIGN);
4346                          _asn1_set_name((yyval.node),(yyvsp[(1) - (7)].str));
4347                          _asn1_set_down((yyval.node),(yyvsp[(6) - (7)].node));}
4348     break;
4349
4350   case 90:
4351
4352 /* Line 1455 of yacc.c  */
4353 #line 347 "ASN1.y"
4354     {(yyval.node)=_asn1_add_node(TYPE_OBJECT_ID|CONST_ASSIGN|CONST_1_PARAM);
4355                          _asn1_set_name((yyval.node),(yyvsp[(1) - (6)].str));
4356                          _asn1_set_value((yyval.node),(yyvsp[(2) - (6)].str),strlen((yyvsp[(2) - (6)].str))+1);
4357                          _asn1_set_down((yyval.node),(yyvsp[(5) - (6)].node));}
4358     break;
4359
4360   case 91:
4361
4362 /* Line 1455 of yacc.c  */
4363 #line 352 "ASN1.y"
4364     {(yyval.node)=_asn1_add_node(TYPE_INTEGER|CONST_ASSIGN);
4365                          _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str));
4366                          _asn1_set_value((yyval.node),(yyvsp[(4) - (4)].str),strlen((yyvsp[(4) - (4)].str))+1);}
4367     break;
4368
4369   case 92:
4370
4371 /* Line 1455 of yacc.c  */
4372 #line 357 "ASN1.y"
4373     {(yyval.node)=(yyvsp[(1) - (1)].node);}
4374     break;
4375
4376   case 93:
4377
4378 /* Line 1455 of yacc.c  */
4379 #line 358 "ASN1.y"
4380     {(yyval.node)=(yyvsp[(1) - (1)].node);}
4381     break;
4382
4383   case 94:
4384
4385 /* Line 1455 of yacc.c  */
4386 #line 361 "ASN1.y"
4387     {(yyval.node)=(yyvsp[(1) - (1)].node);}
4388     break;
4389
4390   case 95:
4391
4392 /* Line 1455 of yacc.c  */
4393 #line 362 "ASN1.y"
4394     {(yyval.node)=(yyvsp[(1) - (2)].node);
4395                                                           _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (2)].node)),(yyvsp[(2) - (2)].node));}
4396     break;
4397
4398   case 96:
4399
4400 /* Line 1455 of yacc.c  */
4401 #line 366 "ASN1.y"
4402     {(yyval.node)=_asn1_add_node(TYPE_OBJECT_ID);
4403                                                           _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));
4404                                                           _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str));}
4405     break;
4406
4407   case 97:
4408
4409 /* Line 1455 of yacc.c  */
4410 #line 369 "ASN1.y"
4411     {(yyval.node)=_asn1_add_node(TYPE_OBJECT_ID);
4412                                                           _asn1_set_name((yyval.node),(yyvsp[(1) - (3)].str));}
4413     break;
4414
4415   case 98:
4416
4417 /* Line 1455 of yacc.c  */
4418 #line 393 "ASN1.y"
4419     {(yyval.constant)=CONST_EXPLICIT;}
4420     break;
4421
4422   case 99:
4423
4424 /* Line 1455 of yacc.c  */
4425 #line 394 "ASN1.y"
4426     {(yyval.constant)=CONST_IMPLICIT;}
4427     break;
4428
4429
4430
4431 /* Line 1455 of yacc.c  */
4432 #line 2371 "ASN1.c"
4433       default: break;
4434     }
4435   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &amp;yyval, &yyloc);
4436
4437   YYPOPSTACK (yylen);
4438   yylen = 0;
4439   YY_STACK_PRINT (yyss, yyssp);
4440
4441   *++yyvsp = yyval;
4442
4443   /* Now `shift' the result of the reduction.  Determine what state
4444      that goes to, based on the state we popped back to and the rule
4445      number reduced by.  */
4446
4447   yyn = yyr1[yyn];
4448
4449   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4450   if (0 <= yystate &amp;& yystate <= YYLAST && yycheck[yystate] == *yyssp)
4451     yystate = yytable[yystate];
4452   else
4453     yystate = yydefgoto[yyn - YYNTOKENS];
4454
4455   goto yynewstate;
4456
4457
4458 /*------------------------------------.
4459 | yyerrlab -- here on detecting error |
4460 `------------------------------------*/
4461 yyerrlab:
4462   /* If not already recovering from an error, report this error.  */
4463   if (!yyerrstatus)
4464     {
4465       ++yynerrs;
4466 #if ! YYERROR_VERBOSE
4467       yyerror (YY_("syntax error"));
4468 #else
4469       {
4470         YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
4471         if (yymsg_alloc < yysize &amp;& yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
4472           {
4473             YYSIZE_T yyalloc = 2 * yysize;
4474             if (! (yysize <= yyalloc &amp;& yyalloc <= YYSTACK_ALLOC_MAXIMUM))
4475               yyalloc = YYSTACK_ALLOC_MAXIMUM;
4476             if (yymsg != yymsgbuf)
4477               YYSTACK_FREE (yymsg);
4478             yymsg = (char *) YYSTACK_ALLOC (yyalloc);
4479             if (yymsg)
4480               yymsg_alloc = yyalloc;
4481             else
4482               {
4483                 yymsg = yymsgbuf;
4484                 yymsg_alloc = sizeof yymsgbuf;
4485               }
4486           }
4487
4488         if (0 < yysize &amp;& yysize <= yymsg_alloc)
4489           {
4490             (void) yysyntax_error (yymsg, yystate, yychar);
4491             yyerror (yymsg);
4492           }
4493         else
4494           {
4495             yyerror (YY_("syntax error"));
4496             if (yysize != 0)
4497               goto yyexhaustedlab;
4498           }
4499       }
4500 #endif
4501     }
4502
4503
4504
4505   if (yyerrstatus == 3)
4506     {
4507       /* If just tried and failed to reuse lookahead token after an
4508          error, discard it.  */
4509
4510       if (yychar <= YYEOF)
4511         {
4512           /* Return failure if at end of input.  */
4513           if (yychar == YYEOF)
4514             YYABORT;
4515         }
4516       else
4517         {
4518           yydestruct ("Error: discarding",
4519                       yytoken, &amp;yylval);
4520           yychar = YYEMPTY;
4521         }
4522     }
4523
4524   /* Else will try to reuse lookahead token after shifting the error
4525      token.  */
4526   goto yyerrlab1;
4527
4528
4529 /*---------------------------------------------------.
4530 | yyerrorlab -- error raised explicitly by YYERROR.  |
4531 `---------------------------------------------------*/
4532 yyerrorlab:
4533
4534   /* Pacify compilers like GCC when the user code never invokes
4535      YYERROR and the label yyerrorlab therefore never appears in user
4536      code.  */
4537   if (/*CONSTCOND*/ 0)
4538      goto yyerrorlab;
4539
4540   /* Do not reclaim the symbols of the rule which action triggered
4541      this YYERROR.  */
4542   YYPOPSTACK (yylen);
4543   yylen = 0;
4544   YY_STACK_PRINT (yyss, yyssp);
4545   yystate = *yyssp;
4546   goto yyerrlab1;
4547
4548
4549 /*-------------------------------------------------------------.
4550 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
4551 `-------------------------------------------------------------*/
4552 yyerrlab1:
4553   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
4554
4555   for (;;)
4556     {
4557       yyn = yypact[yystate];
4558       if (yyn != YYPACT_NINF)
4559         {
4560           yyn += YYTERROR;
4561           if (0 <= yyn &amp;& yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4562             {
4563               yyn = yytable[yyn];
4564               if (0 < yyn)
4565                 break;
4566             }
4567         }
4568
4569       /* Pop the current state because it cannot handle the error token.  */
4570       if (yyssp == yyss)
4571         YYABORT;
4572
4573
4574       yydestruct ("Error: popping",
4575                   yystos[yystate], yyvsp);
4576       YYPOPSTACK (1);
4577       yystate = *yyssp;
4578       YY_STACK_PRINT (yyss, yyssp);
4579     }
4580
4581   *++yyvsp = yylval;
4582
4583
4584   /* Shift the error token.  */
4585   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4586
4587   yystate = yyn;
4588   goto yynewstate;
4589
4590
4591 /*-------------------------------------.
4592 | yyacceptlab -- YYACCEPT comes here.  |
4593 `-------------------------------------*/
4594 yyacceptlab:
4595   yyresult = 0;
4596   goto yyreturn;
4597
4598 /*-----------------------------------.
4599 | yyabortlab -- YYABORT comes here.  |
4600 `-----------------------------------*/
4601 yyabortlab:
4602   yyresult = 1;
4603   goto yyreturn;
4604
4605 #if !defined(yyoverflow) || YYERROR_VERBOSE
4606 /*-------------------------------------------------.
4607 | yyexhaustedlab -- memory exhaustion comes here.  |
4608 `-------------------------------------------------*/
4609 yyexhaustedlab:
4610   yyerror (YY_("memory exhausted"));
4611   yyresult = 2;
4612   /* Fall through.  */
4613 #endif
4614
4615 yyreturn:
4616   if (yychar != YYEMPTY)
4617      yydestruct ("Cleanup: discarding lookahead",
4618                  yytoken, &amp;yylval);
4619   /* Do not reclaim the symbols of the rule which action triggered
4620      this YYABORT or YYACCEPT.  */
4621   YYPOPSTACK (yylen);
4622   YY_STACK_PRINT (yyss, yyssp);
4623   while (yyssp != yyss)
4624     {
4625       yydestruct ("Cleanup: popping",
4626                   yystos[*yyssp], yyvsp);
4627       YYPOPSTACK (1);
4628     }
4629 #ifndef yyoverflow
4630   if (yyss != yyssa)
4631     YYSTACK_FREE (yyss);
4632 #endif
4633 #if YYERROR_VERBOSE
4634   if (yymsg != yymsgbuf)
4635     YYSTACK_FREE (yymsg);
4636 #endif
4637   /* Make sure YYID is used.  */
4638   return YYID (yyresult);
4639 }
4640 </pre>
4641 </div>
4642 </td>
4643 </tr>
4644 <tr class="function_entry_high">
4645 <td class="function_entry_filename">
4646 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_expand_object_id_src', '_asn1_expand_object_id_button')"><span id="_asn1_expand_object_id_button">&darr;</span></a>
4647 </td>
4648 <td class="function_entry_name">
4649 _asn1_expand_object_id
4650 </td>
4651 <td class="function_entry_cyclo">
4652 44
4653 </td>
4654 <td class="function_entry_number">
4655 95
4656 </td>
4657 <td class="function_entry_number">
4658 169
4659 </td>
4660 <td class="function_entry_filename">
4661 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
4662 </td>
4663 </tr>
4664 <tr>
4665 <td colspan="6" height="0">
4666 <div id="_asn1_expand_object_id_src" class="function_src" style="position: relative; display: none;">
4667 <pre class="function_src">
4668 asn1_retCode
4669 _asn1_expand_object_id (ASN1_TYPE node)
4670 {
4671   ASN1_TYPE p, p2, p3, p4, p5;
4672   char name_root[ASN1_MAX_NAME_SIZE], name2[2 * ASN1_MAX_NAME_SIZE + 1];
4673   int move, tlen;
4674
4675   if (node == NULL)
4676     return ASN1_ELEMENT_NOT_FOUND;
4677
4678   _asn1_str_cpy (name_root, sizeof (name_root), node->name);
4679
4680   p = node;
4681   move = DOWN;
4682
4683   while (!((p == node) &amp;& (move == UP)))
4684     {
4685       if (move != UP)
4686         {
4687           if ((type_field (p->type) == TYPE_OBJECT_ID)
4688               &amp;& (p->type & CONST_ASSIGN))
4689             {
4690               p2 = p->down;
4691               if (p2 &amp;& (type_field (p2->type) == TYPE_CONSTANT))
4692                 {
4693                   if (p2->value &amp;& !isdigit (p2->value[0]))
4694                     {
4695                       _asn1_str_cpy (name2, sizeof (name2), name_root);
4696                       _asn1_str_cat (name2, sizeof (name2), ".");
4697                       _asn1_str_cat (name2, sizeof (name2), p2->value);
4698                       p3 = asn1_find_node (node, name2);
4699                       if (!p3 || (type_field (p3->type) != TYPE_OBJECT_ID) ||
4700                           !(p3->type &amp; CONST_ASSIGN))
4701                         return ASN1_ELEMENT_NOT_FOUND;
4702                       _asn1_set_down (p, p2->right);
4703                       _asn1_remove_node (p2);
4704                       p2 = p;
4705                       p4 = p3->down;
4706                       while (p4)
4707                         {
4708                           if (type_field (p4->type) == TYPE_CONSTANT)
4709                             {
4710                               p5 = _asn1_add_node_only (TYPE_CONSTANT);
4711                               _asn1_set_name (p5, p4->name);
4712                               tlen = strlen (p4->value);
4713                               if (tlen > 0)
4714                                 _asn1_set_value (p5, p4->value, tlen + 1);
4715                               if (p2 == p)
4716                                 {
4717                                   _asn1_set_right (p5, p->down);
4718                                   _asn1_set_down (p, p5);
4719                                 }
4720                               else
4721                                 {
4722                                   _asn1_set_right (p5, p2->right);
4723                                   _asn1_set_right (p2, p5);
4724                                 }
4725                               p2 = p5;
4726                             }
4727                           p4 = p4->right;
4728                         }
4729                       move = DOWN;
4730                       continue;
4731                     }
4732                 }
4733             }
4734           move = DOWN;
4735         }
4736       else
4737         move = RIGHT;
4738
4739       if (move == DOWN)
4740         {
4741           if (p->down)
4742             p = p->down;
4743           else
4744             move = RIGHT;
4745         }
4746
4747       if (p == node)
4748         {
4749           move = UP;
4750           continue;
4751         }
4752
4753       if (move == RIGHT)
4754         {
4755           if (p->right)
4756             p = p->right;
4757           else
4758             move = UP;
4759         }
4760       if (move == UP)
4761         p = _asn1_find_up (p);
4762     }
4763
4764
4765   /*******************************/
4766   /*       expand DEFAULT        */
4767   /*******************************/
4768   p = node;
4769   move = DOWN;
4770
4771   while (!((p == node) &amp;& (move == UP)))
4772     {
4773       if (move != UP)
4774         {
4775           if ((type_field (p->type) == TYPE_OBJECT_ID) &amp;&
4776               (p->type &amp; CONST_DEFAULT))
4777             {
4778               p2 = p->down;
4779               if (p2 &amp;& (type_field (p2->type) == TYPE_DEFAULT))
4780                 {
4781                   _asn1_str_cpy (name2, sizeof (name2), name_root);
4782                   _asn1_str_cat (name2, sizeof (name2), ".");
4783                   _asn1_str_cat (name2, sizeof (name2), p2->value);
4784                   p3 = asn1_find_node (node, name2);
4785                   if (!p3 || (type_field (p3->type) != TYPE_OBJECT_ID) ||
4786                       !(p3->type &amp; CONST_ASSIGN))
4787                     return ASN1_ELEMENT_NOT_FOUND;
4788                   p4 = p3->down;
4789                   name2[0] = 0;
4790                   while (p4)
4791                     {
4792                       if (type_field (p4->type) == TYPE_CONSTANT)
4793                         {
4794                           if (name2[0])
4795                             _asn1_str_cat (name2, sizeof (name2), ".");
4796                           _asn1_str_cat (name2, sizeof (name2), p4->value);
4797                         }
4798                       p4 = p4->right;
4799                     }
4800                   tlen = strlen (name2);
4801                   if (tlen > 0)
4802                     _asn1_set_value (p2, name2, tlen + 1);
4803                 }
4804             }
4805           move = DOWN;
4806         }
4807       else
4808         move = RIGHT;
4809
4810       if (move == DOWN)
4811         {
4812           if (p->down)
4813             p = p->down;
4814           else
4815             move = RIGHT;
4816         }
4817
4818       if (p == node)
4819         {
4820           move = UP;
4821           continue;
4822         }
4823
4824       if (move == RIGHT)
4825         {
4826           if (p->right)
4827             p = p->right;
4828           else
4829             move = UP;
4830         }
4831       if (move == UP)
4832         p = _asn1_find_up (p);
4833     }
4834
4835   return ASN1_SUCCESS;
4836 }
4837 </pre>
4838 </div>
4839 </td>
4840 </tr>
4841 <tr class="function_entry_high">
4842 <td class="function_entry_filename">
4843 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_yylex_src', '_asn1_yylex_button')"><span id="_asn1_yylex_button">&darr;</span></a>
4844 </td>
4845 <td class="function_entry_name">
4846 _asn1_yylex
4847 </td>
4848 <td class="function_entry_cyclo">
4849 44
4850 </td>
4851 <td class="function_entry_number">
4852 54
4853 </td>
4854 <td class="function_entry_number">
4855 80
4856 </td>
4857 <td class="function_entry_filename">
4858 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/ASN1.c;hb=HEAD">lib/ASN1.c</a>
4859 </td>
4860 </tr>
4861 <tr>
4862 <td colspan="6" height="0">
4863 <div id="_asn1_yylex_src" class="function_src" style="position: relative; display: none;">
4864 <pre class="function_src">
4865 static int
4866 _asn1_yylex()
4867 {
4868   int c,counter=0,k,lastc;
4869   char string[ASN1_MAX_NAME_SIZE+1]; /* will contain the next token */
4870   size_t i;
4871
4872   while(1)
4873     {
4874     while((c=fgetc(file_asn1))==' ' || c=='\t' || c=='\n')
4875       if(c=='\n') lineNumber++;
4876
4877     if(c==EOF){
4878       strcpy(lastToken,"End Of File");
4879       return 0;
4880     }
4881
4882     if(c=='(' || c==')' || c=='[' || c==']' ||
4883        c=='{' || c=='}' || c==',' || c=='.' ||
4884        c=='+' || c=='|'){
4885       lastToken[0]=c;lastToken[1]=0;
4886       return c;
4887     }
4888     if(c=='-'){  /* Maybe the first '-' of a comment */
4889       if((c=fgetc(file_asn1))!='-'){
4890         ungetc(c,file_asn1);
4891         lastToken[0]='-';lastToken[1]=0;
4892         return '-';
4893       }
4894       else{ /* Comments */
4895         lastc=0;
4896         counter=0;
4897         /* A comment finishes at the next double hypen or the end of line */
4898         while((c=fgetc(file_asn1))!=EOF &amp;& c!='\n' &&
4899               (lastc!='-' || (lastc=='-' &amp;& c!='-')))
4900           lastc=c;
4901         if(c==EOF){
4902           strcpy(lastToken,"End Of File");
4903           return 0;
4904         }
4905         else{
4906           if(c=='\n') lineNumber++;
4907           continue; /* next char, please! (repeat the search) */
4908         }
4909       }
4910     }
4911     string[counter++]=c;
4912     /* Till the end of the token */
4913     while(!((c=fgetc(file_asn1))==EOF || c==' '|| c=='\t' || c=='\n' ||
4914              c=='(' || c==')' || c=='[' || c==']' ||
4915              c=='{' || c=='}' || c==',' || c=='.'))
4916       {
4917         if(counter>=ASN1_MAX_NAME_SIZE){
4918           result_parse=ASN1_NAME_TOO_LONG;
4919           return 0;
4920         }
4921         string[counter++]=c;
4922       }
4923     ungetc(c,file_asn1);
4924     string[counter]=0;
4925     strcpy(lastToken,string);
4926
4927     /* Is STRING a number? */
4928     for(k=0;k<counter;k++)
4929       if(!isdigit(string[k])) break;
4930     if(k>=counter)
4931       {
4932       strcpy(yylval.str,string);
4933       return NUM; /* return the number */
4934       }
4935
4936     /* Is STRING a keyword? */
4937     for(i=0;i<(sizeof(key_word)/sizeof(char*));i++)
4938       if(!strcmp(string,key_word[i])) return key_word_token[i];
4939
4940     /* STRING is an IDENTIFIER */
4941     strcpy(yylval.str,string);
4942     return IDENTIFIER;
4943     }
4944 }
4945 </pre>
4946 </div>
4947 </td>
4948 </tr>
4949 <tr class="function_entry_high">
4950 <td class="function_entry_filename">
4951 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('asn1_expand_any_defined_by_src', 'asn1_expand_any_defined_by_button')"><span id="asn1_expand_any_defined_by_button">&darr;</span></a>
4952 </td>
4953 <td class="function_entry_name">
4954 asn1_expand_any_defined_by
4955 </td>
4956 <td class="function_entry_cyclo">
4957 43
4958 </td>
4959 <td class="function_entry_number">
4960 101
4961 </td>
4962 <td class="function_entry_number">
4963 211
4964 </td>
4965 <td class="function_entry_filename">
4966 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/decoding.c;hb=HEAD">lib/decoding.c</a>
4967 </td>
4968 </tr>
4969 <tr>
4970 <td colspan="6" height="0">
4971 <div id="asn1_expand_any_defined_by_src" class="function_src" style="position: relative; display: none;">
4972 <pre class="function_src">
4973 asn1_retCode
4974 asn1_expand_any_defined_by (ASN1_TYPE definitions, ASN1_TYPE * element)
4975 {
4976   char definitionsName[ASN1_MAX_NAME_SIZE], name[2 * ASN1_MAX_NAME_SIZE + 1],
4977     value[ASN1_MAX_NAME_SIZE];
4978   asn1_retCode retCode = ASN1_SUCCESS, result;
4979   int len, len2, len3;
4980   ASN1_TYPE p, p2, p3, aux = ASN1_TYPE_EMPTY;
4981   char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
4982
4983   if ((definitions == ASN1_TYPE_EMPTY) || (*element == ASN1_TYPE_EMPTY))
4984     return ASN1_ELEMENT_NOT_FOUND;
4985
4986   strcpy (definitionsName, definitions->name);
4987   strcat (definitionsName, ".");
4988
4989   p = *element;
4990   while (p)
4991     {
4992
4993       switch (type_field (p->type))
4994         {
4995         case TYPE_ANY:
4996           if ((p->type &amp; CONST_DEFINED_BY) && (p->value))
4997             {
4998               /* search the "DEF_BY" element */
4999               p2 = p->down;
5000               while ((p2) &amp;& (type_field (p2->type) != TYPE_CONSTANT))
5001                 p2 = p2->right;
5002
5003               if (!p2)
5004                 {
5005                   retCode = ASN1_ERROR_TYPE_ANY;
5006                   break;
5007                 }
5008
5009               p3 = _asn1_find_up (p);
5010
5011               if (!p3)
5012                 {
5013                   retCode = ASN1_ERROR_TYPE_ANY;
5014                   break;
5015                 }
5016
5017               p3 = p3->down;
5018               while (p3)
5019                 {
5020                   if ((p3->name) &amp;& !(strcmp (p3->name, p2->name)))
5021                     break;
5022                   p3 = p3->right;
5023                 }
5024
5025               if ((!p3) || (type_field (p3->type) != TYPE_OBJECT_ID) ||
5026                   (p3->value == NULL))
5027                 {
5028
5029                   p3 = _asn1_find_up (p);
5030                   p3 = _asn1_find_up (p3);
5031
5032                   if (!p3)
5033                     {
5034                       retCode = ASN1_ERROR_TYPE_ANY;
5035                       break;
5036                     }
5037
5038                   p3 = p3->down;
5039
5040                   while (p3)
5041                     {
5042                       if ((p3->name) &amp;& !(strcmp (p3->name, p2->name)))
5043                         break;
5044                       p3 = p3->right;
5045                     }
5046
5047                   if ((!p3) || (type_field (p3->type) != TYPE_OBJECT_ID) ||
5048                       (p3->value == NULL))
5049                     {
5050                       retCode = ASN1_ERROR_TYPE_ANY;
5051                       break;
5052                     }
5053                 }
5054
5055               /* search the OBJECT_ID into definitions */
5056               p2 = definitions->down;
5057               while (p2)
5058                 {
5059                   if ((type_field (p2->type) == TYPE_OBJECT_ID) &amp;&
5060                       (p2->type &amp; CONST_ASSIGN))
5061                     {
5062                       strcpy (name, definitionsName);
5063                       strcat (name, p2->name);
5064
5065                       len = ASN1_MAX_NAME_SIZE;
5066                       result =
5067                         asn1_read_value (definitions, name, value, &amp;len);
5068
5069                       if ((result == ASN1_SUCCESS)
5070                           &amp;& (!strcmp (p3->value, value)))
5071                         {
5072                           p2 = p2->right;       /* pointer to the structure to
5073                                                    use for expansion */
5074                           while ((p2) &amp;& (p2->type & CONST_ASSIGN))
5075                             p2 = p2->right;
5076
5077                           if (p2)
5078                             {
5079                               strcpy (name, definitionsName);
5080                               strcat (name, p2->name);
5081
5082                               result =
5083                                 asn1_create_element (definitions, name, &amp;aux);
5084                               if (result == ASN1_SUCCESS)
5085                                 {
5086                                   _asn1_set_name (aux, p->name);
5087                                   len2 =
5088                                     asn1_get_length_der (p->value,
5089                                                          p->value_len, &amp;len3);
5090                                   if (len2 < 0)
5091                                     return ASN1_DER_ERROR;
5092
5093                                   result =
5094                                     asn1_der_decoding (&amp;aux, p->value + len3,
5095                                                        len2,
5096                                                        errorDescription);
5097                                   if (result == ASN1_SUCCESS)
5098                                     {
5099
5100                                       _asn1_set_right (aux, p->right);
5101                                       _asn1_set_right (p, aux);
5102
5103                                       result = asn1_delete_structure (&amp;p);
5104                                       if (result == ASN1_SUCCESS)
5105                                         {
5106                                           p = aux;
5107                                           aux = ASN1_TYPE_EMPTY;
5108                                           break;
5109                                         }
5110                                       else
5111                                         {       /* error with asn1_delete_structure */
5112                                           asn1_delete_structure (&amp;aux);
5113                                           retCode = result;
5114                                           break;
5115                                         }
5116                                     }
5117                                   else
5118                                     {   /* error with asn1_der_decoding */
5119                                       retCode = result;
5120                                       break;
5121                                     }
5122                                 }
5123                               else
5124                                 {       /* error with asn1_create_element */
5125                                   retCode = result;
5126                                   break;
5127                                 }
5128                             }
5129                           else
5130                             {   /* error with the pointer to the structure to exapand */
5131                               retCode = ASN1_ERROR_TYPE_ANY;
5132                               break;
5133                             }
5134                         }
5135                     }
5136                   p2 = p2->right;
5137                 }               /* end while */
5138
5139               if (!p2)
5140                 {
5141                   retCode = ASN1_ERROR_TYPE_ANY;
5142                   break;
5143                 }
5144
5145             }
5146           break;
5147         default:
5148           break;
5149         }
5150
5151
5152       if (p->down)
5153         {
5154           p = p->down;
5155         }
5156       else if (p == *element)
5157         {
5158           p = NULL;
5159           break;
5160         }
5161       else if (p->right)
5162         p = p->right;
5163       else
5164         {
5165           while (1)
5166             {
5167               p = _asn1_find_up (p);
5168               if (p == *element)
5169                 {
5170                   p = NULL;
5171                   break;
5172                 }
5173               if (p->right)
5174                 {
5175                   p = p->right;
5176                   break;
5177                 }
5178             }
5179         }
5180     }
5181
5182   return retCode;
5183 }
5184 </pre>
5185 </div>
5186 </td>
5187 </tr>
5188 <tr class="function_entry_high">
5189 <td class="function_entry_filename">
5190 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('asn1_read_value_src', 'asn1_read_value_button')"><span id="asn1_read_value_button">&darr;</span></a>
5191 </td>
5192 <td class="function_entry_name">
5193 asn1_read_value
5194 </td>
5195 <td class="function_entry_cyclo">
5196 47
5197 </td>
5198 <td class="function_entry_number">
5199 83
5200 </td>
5201 <td class="function_entry_number">
5202 161
5203 </td>
5204 <td class="function_entry_filename">
5205 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/element.c;hb=HEAD">lib/element.c</a>
5206 </td>
5207 </tr>
5208 <tr>
5209 <td colspan="6" height="0">
5210 <div id="asn1_read_value_src" class="function_src" style="position: relative; display: none;">
5211 <pre class="function_src">
5212 asn1_retCode
5213 asn1_read_value (ASN1_TYPE root, const char *name, void *ivalue, int *len)
5214 {
5215   ASN1_TYPE node, p, p2;
5216   int len2, len3;
5217   int value_size = *len;
5218   unsigned char *value = ivalue;
5219
5220   node = asn1_find_node (root, name);
5221   if (node == NULL)
5222     return ASN1_ELEMENT_NOT_FOUND;
5223
5224   if ((type_field (node->type) != TYPE_NULL) &amp;&
5225       (type_field (node->type) != TYPE_CHOICE) &amp;&
5226       !(node->type &amp; CONST_DEFAULT) && !(node->type & CONST_ASSIGN) &&
5227       (node->value == NULL))
5228     return ASN1_VALUE_NOT_FOUND;
5229
5230   switch (type_field (node->type))
5231     {
5232     case TYPE_NULL:
5233       PUT_STR_VALUE (value, value_size, "NULL");
5234       break;
5235     case TYPE_BOOLEAN:
5236       if ((node->type &amp; CONST_DEFAULT) && (node->value == NULL))
5237         {
5238           p = node->down;
5239           while (type_field (p->type) != TYPE_DEFAULT)
5240             p = p->right;
5241           if (p->type &amp; CONST_TRUE)
5242             {
5243               PUT_STR_VALUE (value, value_size, "TRUE");
5244             }
5245           else
5246             {
5247               PUT_STR_VALUE (value, value_size, "FALSE");
5248             }
5249         }
5250       else if (node->value[0] == 'T')
5251         {
5252           PUT_STR_VALUE (value, value_size, "TRUE");
5253         }
5254       else
5255         {
5256           PUT_STR_VALUE (value, value_size, "FALSE");
5257         }
5258       break;
5259     case TYPE_INTEGER:
5260     case TYPE_ENUMERATED:
5261       if ((node->type &amp; CONST_DEFAULT) && (node->value == NULL))
5262         {
5263           p = node->down;
5264           while (type_field (p->type) != TYPE_DEFAULT)
5265             p = p->right;
5266           if ((isdigit (p->value[0])) || (p->value[0] == '-')
5267               || (p->value[0] == '+'))
5268             {
5269               if (_asn1_convert_integer
5270                   (p->value, value, value_size, len) != ASN1_SUCCESS)
5271                 return ASN1_MEM_ERROR;
5272             }
5273           else
5274             {                   /* is an identifier like v1 */
5275               p2 = node->down;
5276               while (p2)
5277                 {
5278                   if (type_field (p2->type) == TYPE_CONSTANT)
5279                     {
5280                       if ((p2->name) &amp;& (!strcmp (p2->name, p->value)))
5281                         {
5282                           if (_asn1_convert_integer
5283                               (p2->value, value, value_size,
5284                                len) != ASN1_SUCCESS)
5285                             return ASN1_MEM_ERROR;
5286                           break;
5287                         }
5288                     }
5289                   p2 = p2->right;
5290                 }
5291             }
5292         }
5293       else
5294         {
5295           len2 = -1;
5296           if (asn1_get_octet_der
5297               (node->value, node->value_len, &amp;len2, value, value_size,
5298                len) != ASN1_SUCCESS)
5299             return ASN1_MEM_ERROR;
5300         }
5301       break;
5302     case TYPE_OBJECT_ID:
5303       if (node->type &amp; CONST_ASSIGN)
5304         {
5305           value[0] = 0;
5306           p = node->down;
5307           while (p)
5308             {
5309               if (type_field (p->type) == TYPE_CONSTANT)
5310                 {
5311                   ADD_STR_VALUE (value, value_size, p->value);
5312                   if (p->right)
5313                     {
5314                       ADD_STR_VALUE (value, value_size, ".");
5315                     }
5316                 }
5317               p = p->right;
5318             }
5319           *len = strlen (value) + 1;
5320         }
5321       else if ((node->type &amp; CONST_DEFAULT) && (node->value == NULL))
5322         {
5323           p = node->down;
5324           while (type_field (p->type) != TYPE_DEFAULT)
5325             p = p->right;
5326           PUT_STR_VALUE (value, value_size, p->value);
5327         }
5328       else
5329         {
5330           PUT_STR_VALUE (value, value_size, node->value);
5331         }
5332       break;
5333     case TYPE_TIME:
5334       PUT_STR_VALUE (value, value_size, node->value);
5335       break;
5336     case TYPE_OCTET_STRING:
5337       len2 = -1;
5338       if (asn1_get_octet_der
5339           (node->value, node->value_len, &amp;len2, value, value_size,
5340            len) != ASN1_SUCCESS)
5341         return ASN1_MEM_ERROR;
5342       break;
5343     case TYPE_GENERALSTRING:
5344       len2 = -1;
5345       if (asn1_get_octet_der
5346           (node->value, node->value_len, &amp;len2, value, value_size,
5347            len) != ASN1_SUCCESS)
5348         return ASN1_MEM_ERROR;
5349       break;
5350     case TYPE_BIT_STRING:
5351       len2 = -1;
5352       if (asn1_get_bit_der
5353           (node->value, node->value_len, &amp;len2, value, value_size,
5354            len) != ASN1_SUCCESS)
5355         return ASN1_MEM_ERROR;
5356       break;
5357     case TYPE_CHOICE:
5358       PUT_STR_VALUE (value, value_size, node->down->name);
5359       break;
5360     case TYPE_ANY:
5361       len3 = -1;
5362       len2 = asn1_get_length_der (node->value, node->value_len, &amp;len3);
5363       if (len2 < 0)
5364         return ASN1_DER_ERROR;
5365       PUT_VALUE (value, value_size, node->value + len3, len2);
5366       break;
5367     default:
5368       return ASN1_ELEMENT_NOT_FOUND;
5369       break;
5370     }
5371   return ASN1_SUCCESS;
5372 }
5373 </pre>
5374 </div>
5375 </td>
5376 </tr>
5377 <tr class="function_entry_high">
5378 <td class="function_entry_filename">
5379 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_check_identifier_src', '_asn1_check_identifier_button')"><span id="_asn1_check_identifier_button">&darr;</span></a>
5380 </td>
5381 <td class="function_entry_name">
5382 _asn1_check_identifier
5383 </td>
5384 <td class="function_entry_cyclo">
5385 26
5386 </td>
5387 <td class="function_entry_number">
5388 50
5389 </td>
5390 <td class="function_entry_number">
5391 91
5392 </td>
5393 <td class="function_entry_filename">
5394 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
5395 </td>
5396 </tr>
5397 <tr>
5398 <td colspan="6" height="0">
5399 <div id="_asn1_check_identifier_src" class="function_src" style="position: relative; display: none;">
5400 <pre class="function_src">
5401 asn1_retCode
5402 _asn1_check_identifier (ASN1_TYPE node)
5403 {
5404   ASN1_TYPE p, p2;
5405   char name2[ASN1_MAX_NAME_SIZE * 2 + 2];
5406
5407   if (node == NULL)
5408     return ASN1_ELEMENT_NOT_FOUND;
5409
5410   p = node;
5411   while (p)
5412     {
5413       if (type_field (p->type) == TYPE_IDENTIFIER)
5414         {
5415           _asn1_str_cpy (name2, sizeof (name2), node->name);
5416           _asn1_str_cat (name2, sizeof (name2), ".");
5417           _asn1_str_cat (name2, sizeof (name2), p->value);
5418           p2 = asn1_find_node (node, name2);
5419           if (p2 == NULL)
5420             {
5421               strcpy (_asn1_identifierMissing, p->value);
5422               return ASN1_IDENTIFIER_NOT_FOUND;
5423             }
5424         }
5425       else if ((type_field (p->type) == TYPE_OBJECT_ID) &amp;&
5426                (p->type &amp; CONST_DEFAULT))
5427         {
5428           p2 = p->down;
5429           if (p2 &amp;& (type_field (p2->type) == TYPE_DEFAULT))
5430             {
5431               _asn1_str_cpy (name2, sizeof (name2), node->name);
5432               _asn1_str_cat (name2, sizeof (name2), ".");
5433               _asn1_str_cat (name2, sizeof (name2), p2->value);
5434               strcpy (_asn1_identifierMissing, p2->value);
5435               p2 = asn1_find_node (node, name2);
5436               if (!p2 || (type_field (p2->type) != TYPE_OBJECT_ID) ||
5437                   !(p2->type &amp; CONST_ASSIGN))
5438                 return ASN1_IDENTIFIER_NOT_FOUND;
5439               else
5440                 _asn1_identifierMissing[0] = 0;
5441             }
5442         }
5443       else if ((type_field (p->type) == TYPE_OBJECT_ID) &amp;&
5444                (p->type &amp; CONST_ASSIGN))
5445         {
5446           p2 = p->down;
5447           if (p2 &amp;& (type_field (p2->type) == TYPE_CONSTANT))
5448             {
5449               if (p2->value &amp;& !isdigit (p2->value[0]))
5450                 {
5451                   _asn1_str_cpy (name2, sizeof (name2), node->name);
5452                   _asn1_str_cat (name2, sizeof (name2), ".");
5453                   _asn1_str_cat (name2, sizeof (name2), p2->value);
5454                   strcpy (_asn1_identifierMissing, p2->value);
5455                   p2 = asn1_find_node (node, name2);
5456                   if (!p2 || (type_field (p2->type) != TYPE_OBJECT_ID) ||
5457                       !(p2->type &amp; CONST_ASSIGN))
5458                     return ASN1_IDENTIFIER_NOT_FOUND;
5459                   else
5460                     _asn1_identifierMissing[0] = 0;
5461                 }
5462             }
5463         }
5464
5465       if (p->down)
5466         {
5467           p = p->down;
5468         }
5469       else if (p->right)
5470         p = p->right;
5471       else
5472         {
5473           while (1)
5474             {
5475               p = _asn1_find_up (p);
5476               if (p == node)
5477                 {
5478                   p = NULL;
5479                   break;
5480                 }
5481               if (p->right)
5482                 {
5483                   p = p->right;
5484                   break;
5485                 }
5486             }
5487         }
5488     }
5489
5490   return ASN1_SUCCESS;
5491 }
5492 </pre>
5493 </div>
5494 </td>
5495 </tr>
5496 <tr class="function_entry_high">
5497 <td class="function_entry_filename">
5498 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_expand_identifier_src', '_asn1_expand_identifier_button')"><span id="_asn1_expand_identifier_button">&darr;</span></a>
5499 </td>
5500 <td class="function_entry_name">
5501 _asn1_expand_identifier
5502 </td>
5503 <td class="function_entry_cyclo">
5504 25
5505 </td>
5506 <td class="function_entry_number">
5507 68
5508 </td>
5509 <td class="function_entry_number">
5510 107
5511 </td>
5512 <td class="function_entry_filename">
5513 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/structure.c;hb=HEAD">lib/structure.c</a>
5514 </td>
5515 </tr>
5516 <tr>
5517 <td colspan="6" height="0">
5518 <div id="_asn1_expand_identifier_src" class="function_src" style="position: relative; display: none;">
5519 <pre class="function_src">
5520 static asn1_retCode
5521 _asn1_expand_identifier (ASN1_TYPE * node, ASN1_TYPE root)
5522 {
5523   ASN1_TYPE p, p2, p3;
5524   char name2[ASN1_MAX_NAME_SIZE + 2];
5525   int move;
5526
5527   if (node == NULL)
5528     return ASN1_ELEMENT_NOT_FOUND;
5529
5530   p = *node;
5531   move = DOWN;
5532
5533   while (!((p == *node) &amp;& (move == UP)))
5534     {
5535       if (move != UP)
5536         {
5537           if (type_field (p->type) == TYPE_IDENTIFIER)
5538             {
5539               _asn1_str_cpy (name2, sizeof (name2), root->name);
5540               _asn1_str_cat (name2, sizeof (name2), ".");
5541               _asn1_str_cat (name2, sizeof (name2), p->value);
5542               p2 = _asn1_copy_structure2 (root, name2);
5543               if (p2 == NULL)
5544                 {
5545                   return ASN1_IDENTIFIER_NOT_FOUND;
5546                 }
5547               _asn1_set_name (p2, p->name);
5548               p2->right = p->right;
5549               p2->left = p->left;
5550               if (p->right)
5551                 p->right->left = p2;
5552               p3 = p->down;
5553               if (p3)
5554                 {
5555                   while (p3->right)
5556                     p3 = p3->right;
5557                   _asn1_set_right (p3, p2->down);
5558                   _asn1_set_down (p2, p->down);
5559                 }
5560
5561               p3 = _asn1_find_left (p);
5562               if (p3)
5563                 _asn1_set_right (p3, p2);
5564               else
5565                 {
5566                   p3 = _asn1_find_up (p);
5567                   if (p3)
5568                     _asn1_set_down (p3, p2);
5569                   else
5570                     {
5571                       p2->left = NULL;
5572                     }
5573                 }
5574
5575               if (p->type &amp; CONST_SIZE)
5576                 p2->type |= CONST_SIZE;
5577               if (p->type &amp; CONST_TAG)
5578                 p2->type |= CONST_TAG;
5579               if (p->type &amp; CONST_OPTION)
5580                 p2->type |= CONST_OPTION;
5581               if (p->type &amp; CONST_DEFAULT)
5582                 p2->type |= CONST_DEFAULT;
5583               if (p->type &amp; CONST_SET)
5584                 p2->type |= CONST_SET;
5585               if (p->type &amp; CONST_NOT_USED)
5586                 p2->type |= CONST_NOT_USED;
5587
5588               if (p == *node)
5589                 *node = p2;
5590               _asn1_remove_node (p);
5591               p = p2;
5592               move = DOWN;
5593               continue;
5594             }
5595           move = DOWN;
5596         }
5597       else
5598         move = RIGHT;
5599
5600       if (move == DOWN)
5601         {
5602           if (p->down)
5603             p = p->down;
5604           else
5605             move = RIGHT;
5606         }
5607
5608       if (p == *node)
5609         {
5610           move = UP;
5611           continue;
5612         }
5613
5614       if (move == RIGHT)
5615         {
5616           if (p->right)
5617             p = p->right;
5618           else
5619             move = UP;
5620         }
5621       if (move == UP)
5622         p = _asn1_find_up (p);
5623     }
5624
5625   return ASN1_SUCCESS;
5626 }
5627 </pre>
5628 </div>
5629 </td>
5630 </tr>
5631 <tr class="function_entry_high">
5632 <td class="function_entry_filename">
5633 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_ordering_set_of_src', '_asn1_ordering_set_of_button')"><span id="_asn1_ordering_set_of_button">&darr;</span></a>
5634 </td>
5635 <td class="function_entry_name">
5636 _asn1_ordering_set_of
5637 </td>
5638 <td class="function_entry_cyclo">
5639 23
5640 </td>
5641 <td class="function_entry_number">
5642 72
5643 </td>
5644 <td class="function_entry_number">
5645 124
5646 </td>
5647 <td class="function_entry_filename">
5648 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/coding.c;hb=HEAD">lib/coding.c</a>
5649 </td>
5650 </tr>
5651 <tr>
5652 <td colspan="6" height="0">
5653 <div id="_asn1_ordering_set_of_src" class="function_src" style="position: relative; display: none;">
5654 <pre class="function_src">
5655 static void
5656 _asn1_ordering_set_of (unsigned char *der, int der_len, ASN1_TYPE node)
5657 {
5658   struct vet
5659   {
5660     int end;
5661     struct vet *next, *prev;
5662   };
5663
5664   int counter, len, len2, change;
5665   struct vet *first, *last, *p_vet, *p2_vet;
5666   ASN1_TYPE p;
5667   unsigned char *temp, class;
5668   unsigned long k, max;
5669
5670   counter = 0;
5671
5672   if (type_field (node->type) != TYPE_SET_OF)
5673     return;
5674
5675   p = node->down;
5676   while ((type_field (p->type) == TYPE_TAG)
5677          || (type_field (p->type) == TYPE_SIZE))
5678     p = p->right;
5679   p = p->right;
5680
5681   if ((p == NULL) || (p->right == NULL))
5682     return;
5683
5684   first = last = NULL;
5685   while (p)
5686     {
5687       p_vet = (struct vet *) _asn1_malloc (sizeof (struct vet));
5688       if (p_vet == NULL)
5689         return;
5690
5691       p_vet->next = NULL;
5692       p_vet->prev = last;
5693       if (first == NULL)
5694         first = p_vet;
5695       else
5696         last->next = p_vet;
5697       last = p_vet;
5698
5699       /* extraction of tag and length */
5700       if (der_len - counter > 0)
5701         {
5702
5703           if (asn1_get_tag_der
5704               (der + counter, der_len - counter, &amp;class, &len,
5705                NULL) != ASN1_SUCCESS)
5706             return;
5707           counter += len;
5708
5709           len2 = asn1_get_length_der (der + counter, der_len - counter, &amp;len);
5710           if (len2 < 0)
5711             return;
5712           counter += len + len2;
5713         }
5714
5715       p_vet->end = counter;
5716       p = p->right;
5717     }
5718
5719   p_vet = first;
5720
5721   while (p_vet)
5722     {
5723       p2_vet = p_vet->next;
5724       counter = 0;
5725       while (p2_vet)
5726         {
5727           if ((p_vet->end - counter) > (p2_vet->end - p_vet->end))
5728             max = p_vet->end - counter;
5729           else
5730             max = p2_vet->end - p_vet->end;
5731
5732           change = -1;
5733           for (k = 0; k < max; k++)
5734             if (der[counter + k] > der[p_vet->end + k])
5735               {
5736                 change = 1;
5737                 break;
5738               }
5739             else if (der[counter + k] < der[p_vet->end + k])
5740               {
5741                 change = 0;
5742                 break;
5743               }
5744
5745           if ((change == -1)
5746               &amp;& ((p_vet->end - counter) > (p2_vet->end - p_vet->end)))
5747             change = 1;
5748
5749           if (change == 1)
5750             {
5751               /* change position */
5752               temp = (unsigned char *) _asn1_malloc (p_vet->end - counter);
5753               if (temp == NULL)
5754                 return;
5755
5756               memcpy (temp, der + counter, (p_vet->end) - counter);
5757               memcpy (der + counter, der + (p_vet->end),
5758                       (p2_vet->end) - (p_vet->end));
5759               memcpy (der + counter + (p2_vet->end) - (p_vet->end), temp,
5760                       (p_vet->end) - counter);
5761               _asn1_free (temp);
5762
5763               p_vet->end = counter + (p2_vet->end - p_vet->end);
5764             }
5765           counter = p_vet->end;
5766
5767           p2_vet = p2_vet->next;
5768           p_vet = p_vet->next;
5769         }
5770
5771       if (p_vet != first)
5772         p_vet->prev->next = NULL;
5773       else
5774         first = NULL;
5775       _asn1_free (p_vet);
5776       p_vet = first;
5777     }
5778 }
5779 </pre>
5780 </div>
5781 </td>
5782 </tr>
5783 <tr class="function_entry_high">
5784 <td class="function_entry_filename">
5785 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('asn1_expand_octet_string_src', 'asn1_expand_octet_string_button')"><span id="asn1_expand_octet_string_button">&darr;</span></a>
5786 </td>
5787 <td class="function_entry_name">
5788 asn1_expand_octet_string
5789 </td>
5790 <td class="function_entry_cyclo">
5791 22
5792 </td>
5793 <td class="function_entry_number">
5794 65
5795 </td>
5796 <td class="function_entry_number">
5797 123
5798 </td>
5799 <td class="function_entry_filename">
5800 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/decoding.c;hb=HEAD">lib/decoding.c</a>
5801 </td>
5802 </tr>
5803 <tr>
5804 <td colspan="6" height="0">
5805 <div id="asn1_expand_octet_string_src" class="function_src" style="position: relative; display: none;">
5806 <pre class="function_src">
5807 asn1_retCode
5808 asn1_expand_octet_string (ASN1_TYPE definitions, ASN1_TYPE * element,
5809                           const char *octetName, const char *objectName)
5810 {
5811   char name[2 * ASN1_MAX_NAME_SIZE + 1], value[ASN1_MAX_NAME_SIZE];
5812   asn1_retCode retCode = ASN1_SUCCESS, result;
5813   int len, len2, len3;
5814   ASN1_TYPE p2, aux = ASN1_TYPE_EMPTY;
5815   ASN1_TYPE octetNode = ASN1_TYPE_EMPTY, objectNode = ASN1_TYPE_EMPTY;
5816   char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE];
5817
5818   if ((definitions == ASN1_TYPE_EMPTY) || (*element == ASN1_TYPE_EMPTY))
5819     return ASN1_ELEMENT_NOT_FOUND;
5820
5821   octetNode = asn1_find_node (*element, octetName);
5822   if (octetNode == ASN1_TYPE_EMPTY)
5823     return ASN1_ELEMENT_NOT_FOUND;
5824   if (type_field (octetNode->type) != TYPE_OCTET_STRING)
5825     return ASN1_ELEMENT_NOT_FOUND;
5826   if (octetNode->value == NULL)
5827     return ASN1_VALUE_NOT_FOUND;
5828
5829   objectNode = asn1_find_node (*element, objectName);
5830   if (objectNode == ASN1_TYPE_EMPTY)
5831     return ASN1_ELEMENT_NOT_FOUND;
5832
5833   if (type_field (objectNode->type) != TYPE_OBJECT_ID)
5834     return ASN1_ELEMENT_NOT_FOUND;
5835
5836   if (objectNode->value == NULL)
5837     return ASN1_VALUE_NOT_FOUND;
5838
5839
5840   /* search the OBJECT_ID into definitions */
5841   p2 = definitions->down;
5842   while (p2)
5843     {
5844       if ((type_field (p2->type) == TYPE_OBJECT_ID) &amp;&
5845           (p2->type &amp; CONST_ASSIGN))
5846         {
5847           strcpy (name, definitions->name);
5848           strcat (name, ".");
5849           strcat (name, p2->name);
5850
5851           len = sizeof (value);
5852           result = asn1_read_value (definitions, name, value, &amp;len);
5853
5854           if ((result == ASN1_SUCCESS)
5855               &amp;& (!strcmp (objectNode->value, value)))
5856             {
5857
5858               p2 = p2->right;   /* pointer to the structure to
5859                                    use for expansion */
5860               while ((p2) &amp;& (p2->type & CONST_ASSIGN))
5861                 p2 = p2->right;
5862
5863               if (p2)
5864                 {
5865                   strcpy (name, definitions->name);
5866                   strcat (name, ".");
5867                   strcat (name, p2->name);
5868
5869                   result = asn1_create_element (definitions, name, &amp;aux);
5870                   if (result == ASN1_SUCCESS)
5871                     {
5872                       _asn1_set_name (aux, octetNode->name);
5873                       len2 =
5874                         asn1_get_length_der (octetNode->value,
5875                                              octetNode->value_len, &amp;len3);
5876                       if (len2 < 0)
5877                         return ASN1_DER_ERROR;
5878
5879                       result =
5880                         asn1_der_decoding (&amp;aux, octetNode->value + len3,
5881                                            len2, errorDescription);
5882                       if (result == ASN1_SUCCESS)
5883                         {
5884
5885                           _asn1_set_right (aux, octetNode->right);
5886                           _asn1_set_right (octetNode, aux);
5887
5888                           result = asn1_delete_structure (&amp;octetNode);
5889                           if (result == ASN1_SUCCESS)
5890                             {
5891                               aux = ASN1_TYPE_EMPTY;
5892                               break;
5893                             }
5894                           else
5895                             {   /* error with asn1_delete_structure */
5896                               asn1_delete_structure (&amp;aux);
5897                               retCode = result;
5898                               break;
5899                             }
5900                         }
5901                       else
5902                         {       /* error with asn1_der_decoding */
5903                           retCode = result;
5904                           break;
5905                         }
5906                     }
5907                   else
5908                     {           /* error with asn1_create_element */
5909                       retCode = result;
5910                       break;
5911                     }
5912                 }
5913               else
5914                 {               /* error with the pointer to the structure to exapand */
5915                   retCode = ASN1_VALUE_NOT_VALID;
5916                   break;
5917                 }
5918             }
5919         }
5920
5921       p2 = p2->right;
5922
5923     }
5924
5925   if (!p2)
5926     retCode = ASN1_VALUE_NOT_VALID;
5927
5928   return retCode;
5929 }
5930 </pre>
5931 </div>
5932 </td>
5933 </tr>
5934 <tr class="function_entry_high">
5935 <td class="function_entry_filename">
5936 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('asn1_array2tree_src', 'asn1_array2tree_button')"><span id="asn1_array2tree_button">&darr;</span></a>
5937 </td>
5938 <td class="function_entry_name">
5939 asn1_array2tree
5940 </td>
5941 <td class="function_entry_cyclo">
5942 21
5943 </td>
5944 <td class="function_entry_number">
5945 53
5946 </td>
5947 <td class="function_entry_number">
5948 97
5949 </td>
5950 <td class="function_entry_filename">
5951 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/structure.c;hb=HEAD">lib/structure.c</a>
5952 </td>
5953 </tr>
5954 <tr>
5955 <td colspan="6" height="0">
5956 <div id="asn1_array2tree_src" class="function_src" style="position: relative; display: none;">
5957 <pre class="function_src">
5958 asn1_retCode
5959 asn1_array2tree (const ASN1_ARRAY_TYPE * array, ASN1_TYPE * definitions,
5960                  char *errorDescription)
5961 {
5962   ASN1_TYPE p, p_last = NULL;
5963   unsigned long k;
5964   int move;
5965   asn1_retCode result;
5966
5967
5968   if (*definitions != ASN1_TYPE_EMPTY)
5969     return ASN1_ELEMENT_NOT_EMPTY;
5970
5971   move = UP;
5972
5973   k = 0;
5974   while (array[k].value || array[k].type || array[k].name)
5975     {
5976       p = _asn1_add_node (array[k].type &amp; (~CONST_DOWN));
5977       if (array[k].name)
5978         _asn1_set_name (p, array[k].name);
5979       if (array[k].value)
5980         _asn1_set_value (p, array[k].value, strlen (array[k].value) + 1);
5981
5982       if (*definitions == NULL)
5983         *definitions = p;
5984
5985       if (move == DOWN)
5986         _asn1_set_down (p_last, p);
5987       else if (move == RIGHT)
5988         _asn1_set_right (p_last, p);
5989
5990       p_last = p;
5991
5992       if (array[k].type &amp; CONST_DOWN)
5993         move = DOWN;
5994       else if (array[k].type &amp; CONST_RIGHT)
5995         move = RIGHT;
5996       else
5997         {
5998           while (1)
5999             {
6000               if (p_last == *definitions)
6001                 break;
6002
6003               p_last = _asn1_find_up (p_last);
6004
6005               if (p_last == NULL)
6006                 break;
6007
6008               if (p_last->type &amp; CONST_RIGHT)
6009                 {
6010                   p_last->type &amp;= ~CONST_RIGHT;
6011                   move = RIGHT;
6012                   break;
6013                 }
6014             }                   /* while */
6015         }
6016       k++;
6017     }                           /* while */
6018
6019   if (p_last == *definitions)
6020     {
6021       result = _asn1_check_identifier (*definitions);
6022       if (result == ASN1_SUCCESS)
6023         {
6024           _asn1_change_integer_value (*definitions);
6025           _asn1_expand_object_id (*definitions);
6026         }
6027     }
6028   else
6029     {
6030       result = ASN1_ARRAY_ERROR;
6031     }
6032
6033   if (errorDescription != NULL)
6034     {
6035       if (result == ASN1_IDENTIFIER_NOT_FOUND)
6036         {
6037           Estrcpy (errorDescription, ":: identifier '");
6038           Estrcat (errorDescription, _asn1_identifierMissing);
6039           Estrcat (errorDescription, "' not found");
6040         }
6041       else
6042         errorDescription[0] = 0;
6043     }
6044
6045   if (result != ASN1_SUCCESS)
6046     {
6047       _asn1_delete_list_and_nodes ();
6048       *definitions = ASN1_TYPE_EMPTY;
6049     }
6050   else
6051     _asn1_delete_list ();
6052
6053   return result;
6054 }
6055 </pre>
6056 </div>
6057 </td>
6058 </tr>
6059 <tr class="function_entry_moderate">
6060 <td class="function_entry_filename">
6061 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_insert_tag_der_src', '_asn1_insert_tag_der_button')"><span id="_asn1_insert_tag_der_button">&darr;</span></a>
6062 </td>
6063 <td class="function_entry_name">
6064 _asn1_insert_tag_der
6065 </td>
6066 <td class="function_entry_cyclo">
6067 35
6068 </td>
6069 <td class="function_entry_number">
6070 75
6071 </td>
6072 <td class="function_entry_number">
6073 151
6074 </td>
6075 <td class="function_entry_filename">
6076 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/coding.c;hb=HEAD">lib/coding.c</a>
6077 </td>
6078 </tr>
6079 <tr>
6080 <td colspan="6" height="0">
6081 <div id="_asn1_insert_tag_der_src" class="function_src" style="position: relative; display: none;">
6082 <pre class="function_src">
6083 static asn1_retCode
6084 _asn1_insert_tag_der (ASN1_TYPE node, unsigned char *der, int *counter,
6085                       int *max_len)
6086 {
6087   ASN1_TYPE p;
6088   int tag_len, is_tag_implicit;
6089   unsigned char class, class_implicit = 0, temp[SIZEOF_UNSIGNED_INT * 3 + 1];
6090   unsigned long tag_implicit = 0;
6091   char tag_der[MAX_TAG_LEN];
6092
6093   is_tag_implicit = 0;
6094
6095   if (node->type &amp; CONST_TAG)
6096     {
6097       p = node->down;
6098       while (p)
6099         {
6100           if (type_field (p->type) == TYPE_TAG)
6101             {
6102               if (p->type &amp; CONST_APPLICATION)
6103                 class = ASN1_CLASS_APPLICATION;
6104               else if (p->type &amp; CONST_UNIVERSAL)
6105                 class = ASN1_CLASS_UNIVERSAL;
6106               else if (p->type &amp; CONST_PRIVATE)
6107                 class = ASN1_CLASS_PRIVATE;
6108               else
6109                 class = ASN1_CLASS_CONTEXT_SPECIFIC;
6110
6111               if (p->type &amp; CONST_EXPLICIT)
6112                 {
6113                   if (is_tag_implicit)
6114                     _asn1_tag_der (class_implicit, tag_implicit, tag_der,
6115                                    &amp;tag_len);
6116                   else
6117                     _asn1_tag_der (class | ASN1_CLASS_STRUCTURED,
6118                                    strtoul (p->value, NULL, 10), tag_der,
6119                                    &amp;tag_len);
6120
6121                   *max_len -= tag_len;
6122                   if (*max_len >= 0)
6123                     memcpy (der + *counter, tag_der, tag_len);
6124                   *counter += tag_len;
6125
6126                   _asn1_ltostr (*counter, temp);
6127                   _asn1_set_name (p, temp);
6128
6129                   is_tag_implicit = 0;
6130                 }
6131               else
6132                 {               /* CONST_IMPLICIT */
6133                   if (!is_tag_implicit)
6134                     {
6135                       if ((type_field (node->type) == TYPE_SEQUENCE) ||
6136                           (type_field (node->type) == TYPE_SEQUENCE_OF) ||
6137                           (type_field (node->type) == TYPE_SET) ||
6138                           (type_field (node->type) == TYPE_SET_OF))
6139                         class |= ASN1_CLASS_STRUCTURED;
6140                       class_implicit = class;
6141                       tag_implicit = strtoul (p->value, NULL, 10);
6142                       is_tag_implicit = 1;
6143                     }
6144                 }
6145             }
6146           p = p->right;
6147         }
6148     }
6149
6150   if (is_tag_implicit)
6151     {
6152       _asn1_tag_der (class_implicit, tag_implicit, tag_der, &amp;tag_len);
6153     }
6154   else
6155     {
6156       switch (type_field (node->type))
6157         {
6158         case TYPE_NULL:
6159           _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_NULL, tag_der,
6160                          &amp;tag_len);
6161           break;
6162         case TYPE_BOOLEAN:
6163           _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_BOOLEAN, tag_der,
6164                          &amp;tag_len);
6165           break;
6166         case TYPE_INTEGER:
6167           _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_INTEGER, tag_der,
6168                          &amp;tag_len);
6169           break;
6170         case TYPE_ENUMERATED:
6171           _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_ENUMERATED, tag_der,
6172                          &amp;tag_len);
6173           break;
6174         case TYPE_OBJECT_ID:
6175           _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_OBJECT_ID, tag_der,
6176                          &amp;tag_len);
6177           break;
6178         case TYPE_TIME:
6179           if (node->type &amp; CONST_UTC)
6180             {
6181               _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_UTCTime, tag_der,
6182                              &amp;tag_len);
6183             }
6184           else
6185             _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_GENERALIZEDTime,
6186                            tag_der, &amp;tag_len);
6187           break;
6188         case TYPE_OCTET_STRING:
6189           _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_OCTET_STRING, tag_der,
6190                          &amp;tag_len);
6191           break;
6192         case TYPE_GENERALSTRING:
6193           _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_GENERALSTRING,
6194                          tag_der, &amp;tag_len);
6195           break;
6196         case TYPE_BIT_STRING:
6197           _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_BIT_STRING, tag_der,
6198                          &amp;tag_len);
6199           break;
6200         case TYPE_SEQUENCE:
6201         case TYPE_SEQUENCE_OF:
6202           _asn1_tag_der (ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED,
6203                          ASN1_TAG_SEQUENCE, tag_der, &amp;tag_len);
6204           break;
6205         case TYPE_SET:
6206         case TYPE_SET_OF:
6207           _asn1_tag_der (ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED,
6208                          ASN1_TAG_SET, tag_der, &amp;tag_len);
6209           break;
6210         case TYPE_TAG:
6211           tag_len = 0;
6212           break;
6213         case TYPE_CHOICE:
6214           tag_len = 0;
6215           break;
6216         case TYPE_ANY:
6217           tag_len = 0;
6218           break;
6219         default:
6220           return ASN1_GENERIC_ERROR;
6221         }
6222     }
6223
6224   *max_len -= tag_len;
6225   if (*max_len >= 0)
6226     memcpy (der + *counter, tag_der, tag_len);
6227   *counter += tag_len;
6228
6229   if (*max_len < 0)
6230     return ASN1_MEM_ERROR;
6231
6232   return ASN1_SUCCESS;
6233 }
6234 </pre>
6235 </div>
6236 </td>
6237 </tr>
6238 <tr class="function_entry_moderate">
6239 <td class="function_entry_filename">
6240 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('asn1_find_node_src', 'asn1_find_node_button')"><span id="asn1_find_node_button">&darr;</span></a>
6241 </td>
6242 <td class="function_entry_name">
6243 asn1_find_node
6244 </td>
6245 <td class="function_entry_cyclo">
6246 20
6247 </td>
6248 <td class="function_entry_number">
6249 50
6250 </td>
6251 <td class="function_entry_number">
6252 95
6253 </td>
6254 <td class="function_entry_filename">
6255 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
6256 </td>
6257 </tr>
6258 <tr>
6259 <td colspan="6" height="0">
6260 <div id="asn1_find_node_src" class="function_src" style="position: relative; display: none;">
6261 <pre class="function_src">
6262 ASN1_TYPE
6263 asn1_find_node (ASN1_TYPE pointer, const char *name)
6264 {
6265   ASN1_TYPE p;
6266   char *n_end, n[ASN1_MAX_NAME_SIZE + 1];
6267   const char *n_start;
6268
6269   if (pointer == NULL)
6270     return NULL;
6271
6272   if (name == NULL)
6273     return NULL;
6274
6275   p = pointer;
6276   n_start = name;
6277
6278   if (p->name != NULL)
6279     {                           /* has *pointer got a name ? */
6280       n_end = strchr (n_start, '.');    /* search the first dot */
6281       if (n_end)
6282         {
6283           memcpy (n, n_start, n_end - n_start);
6284           n[n_end - n_start] = 0;
6285           n_start = n_end;
6286           n_start++;
6287         }
6288       else
6289         {
6290           _asn1_str_cpy (n, sizeof (n), n_start);
6291           n_start = NULL;
6292         }
6293
6294       while (p)
6295         {
6296           if ((p->name) &amp;& (!strcmp (p->name, n)))
6297             break;
6298           else
6299             p = p->right;
6300         }                       /* while */
6301
6302       if (p == NULL)
6303         return NULL;
6304     }
6305   else
6306     {                           /* *pointer doesn't have a name */
6307       if (n_start[0] == 0)
6308         return p;
6309     }
6310
6311   while (n_start)
6312     {                           /* Has the end of NAME been reached? */
6313       n_end = strchr (n_start, '.');    /* search the next dot */
6314       if (n_end)
6315         {
6316           memcpy (n, n_start, n_end - n_start);
6317           n[n_end - n_start] = 0;
6318           n_start = n_end;
6319           n_start++;
6320         }
6321       else
6322         {
6323           _asn1_str_cpy (n, sizeof (n), n_start);
6324           n_start = NULL;
6325         }
6326
6327       if (p->down == NULL)
6328         return NULL;
6329
6330       p = p->down;
6331
6332       /* The identifier "?LAST" indicates the last element
6333          in the right chain. */
6334       if (!strcmp (n, "?LAST"))
6335         {
6336           if (p == NULL)
6337             return NULL;
6338           while (p->right)
6339             p = p->right;
6340         }
6341       else
6342         {                       /* no "?LAST" */
6343           while (p)
6344             {
6345               if ((p->name) &amp;& (!strcmp (p->name, n)))
6346                 break;
6347               else
6348                 p = p->right;
6349             }
6350           if (p == NULL)
6351             return NULL;
6352         }
6353     }                           /* while */
6354
6355   return p;
6356 }
6357 </pre>
6358 </div>
6359 </td>
6360 </tr>
6361 <tr class="function_entry_moderate">
6362 <td class="function_entry_filename">
6363 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_type_choice_config_src', '_asn1_type_choice_config_button')"><span id="_asn1_type_choice_config_button">&darr;</span></a>
6364 </td>
6365 <td class="function_entry_name">
6366 _asn1_type_choice_config
6367 </td>
6368 <td class="function_entry_cyclo">
6369 20
6370 </td>
6371 <td class="function_entry_number">
6372 47
6373 </td>
6374 <td class="function_entry_number">
6375 83
6376 </td>
6377 <td class="function_entry_filename">
6378 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/structure.c;hb=HEAD">lib/structure.c</a>
6379 </td>
6380 </tr>
6381 <tr>
6382 <td colspan="6" height="0">
6383 <div id="_asn1_type_choice_config_src" class="function_src" style="position: relative; display: none;">
6384 <pre class="function_src">
6385 static asn1_retCode
6386 _asn1_type_choice_config (ASN1_TYPE node)
6387 {
6388   ASN1_TYPE p, p2, p3, p4;
6389   int move, tlen;
6390
6391   if (node == NULL)
6392     return ASN1_ELEMENT_NOT_FOUND;
6393
6394   p = node;
6395   move = DOWN;
6396
6397   while (!((p == node) &amp;& (move == UP)))
6398     {
6399       if (move != UP)
6400         {
6401           if ((type_field (p->type) == TYPE_CHOICE) &amp;& (p->type & CONST_TAG))
6402             {
6403               p2 = p->down;
6404               while (p2)
6405                 {
6406                   if (type_field (p2->type) != TYPE_TAG)
6407                     {
6408                       p2->type |= CONST_TAG;
6409                       p3 = _asn1_find_left (p2);
6410                       while (p3)
6411                         {
6412                           if (type_field (p3->type) == TYPE_TAG)
6413                             {
6414                               p4 = _asn1_add_node_only (p3->type);
6415                               tlen = strlen (p3->value);
6416                               if (tlen > 0)
6417                                 _asn1_set_value (p4, p3->value, tlen + 1);
6418                               _asn1_set_right (p4, p2->down);
6419                               _asn1_set_down (p2, p4);
6420                             }
6421                           p3 = _asn1_find_left (p3);
6422                         }
6423                     }
6424                   p2 = p2->right;
6425                 }
6426               p->type &amp;= ~(CONST_TAG);
6427               p2 = p->down;
6428               while (p2)
6429                 {
6430                   p3 = p2->right;
6431                   if (type_field (p2->type) == TYPE_TAG)
6432                     asn1_delete_structure (&amp;p2);
6433                   p2 = p3;
6434                 }
6435             }
6436           move = DOWN;
6437         }
6438       else
6439         move = RIGHT;
6440
6441       if (move == DOWN)
6442         {
6443           if (p->down)
6444             p = p->down;
6445           else
6446             move = RIGHT;
6447         }
6448
6449       if (p == node)
6450         {
6451           move = UP;
6452           continue;
6453         }
6454
6455       if (move == RIGHT)
6456         {
6457           if (p->right)
6458             p = p->right;
6459           else
6460             move = UP;
6461         }
6462       if (move == UP)
6463         p = _asn1_find_up (p);
6464     }
6465
6466   return ASN1_SUCCESS;
6467 }
6468 </pre>
6469 </div>
6470 </td>
6471 </tr>
6472 <tr class="function_entry_moderate">
6473 <td class="function_entry_filename">
6474 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_get_octet_string_src', '_asn1_get_octet_string_button')"><span id="_asn1_get_octet_string_button">&darr;</span></a>
6475 </td>
6476 <td class="function_entry_name">
6477 _asn1_get_octet_string
6478 </td>
6479 <td class="function_entry_cyclo">
6480 17
6481 </td>
6482 <td class="function_entry_number">
6483 47
6484 </td>
6485 <td class="function_entry_number">
6486 82
6487 </td>
6488 <td class="function_entry_filename">
6489 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/decoding.c;hb=HEAD">lib/decoding.c</a>
6490 </td>
6491 </tr>
6492 <tr>
6493 <td colspan="6" height="0">
6494 <div id="_asn1_get_octet_string_src" class="function_src" style="position: relative; display: none;">
6495 <pre class="function_src">
6496 static asn1_retCode
6497 _asn1_get_octet_string (const unsigned char *der, ASN1_TYPE node, int *len)
6498 {
6499   int len2, len3, counter, tot_len, indefinite;
6500
6501   counter = 0;
6502
6503   if (*(der - 1) &amp; ASN1_CLASS_STRUCTURED)
6504     {
6505       tot_len = 0;
6506       indefinite = asn1_get_length_der (der, *len, &amp;len3);
6507       if (indefinite < -1)
6508         return ASN1_DER_ERROR;
6509
6510       counter += len3;
6511       if (indefinite >= 0)
6512         indefinite += len3;
6513
6514       while (1)
6515         {
6516           if (counter > (*len))
6517             return ASN1_DER_ERROR;
6518
6519           if (indefinite == -1)
6520             {
6521               if ((der[counter] == 0) &amp;& (der[counter + 1] == 0))
6522                 {
6523                   counter += 2;
6524                   break;
6525                 }
6526             }
6527           else if (counter >= indefinite)
6528             break;
6529
6530           if (der[counter] != ASN1_TAG_OCTET_STRING)
6531             return ASN1_DER_ERROR;
6532
6533           counter++;
6534
6535           len2 = asn1_get_length_der (der + counter, *len - counter, &amp;len3);
6536           if (len2 <= 0)
6537             return ASN1_DER_ERROR;
6538
6539           counter += len3 + len2;
6540           tot_len += len2;
6541         }
6542
6543       /* copy */
6544       if (node)
6545         {
6546           unsigned char temp[DER_LEN];
6547           int ret;
6548
6549           len2 = sizeof (temp);
6550
6551           asn1_length_der (tot_len, temp, &amp;len2);
6552           _asn1_set_value (node, temp, len2);
6553
6554           tot_len += len2;
6555
6556           ret = _asn1_extract_der_octet (node, der, *len);
6557           if (ret != ASN1_SUCCESS)
6558             return ret;
6559
6560         }
6561     }
6562   else
6563     {                           /* NOT STRUCTURED */
6564       len2 = asn1_get_length_der (der, *len, &amp;len3);
6565       if (len2 < 0)
6566         return ASN1_DER_ERROR;
6567       if (len3 + len2 > *len)
6568         return ASN1_DER_ERROR;
6569       if (node)
6570         _asn1_set_value (node, der, len3 + len2);
6571       counter = len3 + len2;
6572     }
6573
6574   *len = counter;
6575   return ASN1_SUCCESS;
6576
6577 }
6578 </pre>
6579 </div>
6580 </td>
6581 </tr>
6582 <tr class="function_entry_moderate">
6583 <td class="function_entry_filename">
6584 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_ordering_set_src', '_asn1_ordering_set_button')"><span id="_asn1_ordering_set_button">&darr;</span></a>
6585 </td>
6586 <td class="function_entry_name">
6587 _asn1_ordering_set
6588 </td>
6589 <td class="function_entry_cyclo">
6590 16
6591 </td>
6592 <td class="function_entry_number">
6593 59
6594 </td>
6595 <td class="function_entry_number">
6596 104
6597 </td>
6598 <td class="function_entry_filename">
6599 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/coding.c;hb=HEAD">lib/coding.c</a>
6600 </td>
6601 </tr>
6602 <tr>
6603 <td colspan="6" height="0">
6604 <div id="_asn1_ordering_set_src" class="function_src" style="position: relative; display: none;">
6605 <pre class="function_src">
6606 static void
6607 _asn1_ordering_set (unsigned char *der, int der_len, ASN1_TYPE node)
6608 {
6609   struct vet
6610   {
6611     int end;
6612     unsigned long value;
6613     struct vet *next, *prev;
6614   };
6615
6616   int counter, len, len2;
6617   struct vet *first, *last, *p_vet, *p2_vet;
6618   ASN1_TYPE p;
6619   unsigned char class, *temp;
6620   unsigned long tag;
6621
6622   counter = 0;
6623
6624   if (type_field (node->type) != TYPE_SET)
6625     return;
6626
6627   p = node->down;
6628   while ((type_field (p->type) == TYPE_TAG)
6629          || (type_field (p->type) == TYPE_SIZE))
6630     p = p->right;
6631
6632   if ((p == NULL) || (p->right == NULL))
6633     return;
6634
6635   first = last = NULL;
6636   while (p)
6637     {
6638       p_vet = (struct vet *) _asn1_malloc (sizeof (struct vet));
6639       if (p_vet == NULL)
6640         return;
6641
6642       p_vet->next = NULL;
6643       p_vet->prev = last;
6644       if (first == NULL)
6645         first = p_vet;
6646       else
6647         last->next = p_vet;
6648       last = p_vet;
6649
6650       /* tag value calculation */
6651       if (asn1_get_tag_der
6652           (der + counter, der_len - counter, &amp;class, &len2,
6653            &amp;tag) != ASN1_SUCCESS)
6654         return;
6655       p_vet->value = (class << 24) | tag;
6656       counter += len2;
6657
6658       /* extraction and length */
6659       len2 = asn1_get_length_der (der + counter, der_len - counter, &amp;len);
6660       if (len2 < 0)
6661         return;
6662       counter += len + len2;
6663
6664       p_vet->end = counter;
6665       p = p->right;
6666     }
6667
6668   p_vet = first;
6669
6670   while (p_vet)
6671     {
6672       p2_vet = p_vet->next;
6673       counter = 0;
6674       while (p2_vet)
6675         {
6676           if (p_vet->value > p2_vet->value)
6677             {
6678               /* change position */
6679               temp = (unsigned char *) _asn1_malloc (p_vet->end - counter);
6680               if (temp == NULL)
6681                 return;
6682
6683               memcpy (temp, der + counter, p_vet->end - counter);
6684               memcpy (der + counter, der + p_vet->end,
6685                       p2_vet->end - p_vet->end);
6686               memcpy (der + counter + p2_vet->end - p_vet->end, temp,
6687                       p_vet->end - counter);
6688               _asn1_free (temp);
6689
6690               tag = p_vet->value;
6691               p_vet->value = p2_vet->value;
6692               p2_vet->value = tag;
6693
6694               p_vet->end = counter + (p2_vet->end - p_vet->end);
6695             }
6696           counter = p_vet->end;
6697
6698           p2_vet = p2_vet->next;
6699           p_vet = p_vet->next;
6700         }
6701
6702       if (p_vet != first)
6703         p_vet->prev->next = NULL;
6704       else
6705         first = NULL;
6706       _asn1_free (p_vet);
6707       p_vet = first;
6708     }
6709 }
6710 </pre>
6711 </div>
6712 </td>
6713 </tr>
6714 <tr class="function_entry_moderate">
6715 <td class="function_entry_filename">
6716 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('yysyntax_error_src', 'yysyntax_error_button')"><span id="yysyntax_error_button">&darr;</span></a>
6717 </td>
6718 <td class="function_entry_name">
6719 yysyntax_error
6720 </td>
6721 <td class="function_entry_cyclo">
6722 15
6723 </td>
6724 <td class="function_entry_number">
6725 62
6726 </td>
6727 <td class="function_entry_number">
6728 100
6729 </td>
6730 <td class="function_entry_filename">
6731 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/ASN1.c;hb=HEAD">lib/ASN1.c</a>
6732 </td>
6733 </tr>
6734 <tr>
6735 <td colspan="6" height="0">
6736 <div id="yysyntax_error_src" class="function_src" style="position: relative; display: none;">
6737 <pre class="function_src">
6738 static YYSIZE_T
6739 yysyntax_error (char *yyresult, int yystate, int yychar)
6740 {
6741   int yyn = yypact[yystate];
6742
6743   if (! (YYPACT_NINF < yyn &amp;& yyn <= YYLAST))
6744     return 0;
6745   else
6746     {
6747       int yytype = YYTRANSLATE (yychar);
6748       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
6749       YYSIZE_T yysize = yysize0;
6750       YYSIZE_T yysize1;
6751       int yysize_overflow = 0;
6752       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
6753       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
6754       int yyx;
6755
6756 # if 0
6757       /* This is so xgettext sees the translatable formats that are
6758          constructed on the fly.  */
6759       YY_("syntax error, unexpected %s");
6760       YY_("syntax error, unexpected %s, expecting %s");
6761       YY_("syntax error, unexpected %s, expecting %s or %s");
6762       YY_("syntax error, unexpected %s, expecting %s or %s or %s");
6763       YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
6764 # endif
6765       char *yyfmt;
6766       char const *yyf;
6767       static char const yyunexpected[] = "syntax error, unexpected %s";
6768       static char const yyexpecting[] = ", expecting %s";
6769       static char const yyor[] = " or %s";
6770       char yyformat[sizeof yyunexpected
6771                     + sizeof yyexpecting - 1
6772                     + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
6773                        * (sizeof yyor - 1))];
6774       char const *yyprefix = yyexpecting;
6775
6776       /* Start YYX at -YYN if negative to avoid negative indexes in
6777          YYCHECK.  */
6778       int yyxbegin = yyn < 0 ? -yyn : 0;
6779
6780       /* Stay within bounds of both yycheck and yytname.  */
6781       int yychecklim = YYLAST - yyn + 1;
6782       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
6783       int yycount = 1;
6784
6785       yyarg[0] = yytname[yytype];
6786       yyfmt = yystpcpy (yyformat, yyunexpected);
6787
6788       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
6789         if (yycheck[yyx + yyn] == yyx &amp;& yyx != YYTERROR)
6790           {
6791             if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
6792               {
6793                 yycount = 1;
6794                 yysize = yysize0;
6795                 yyformat[sizeof yyunexpected - 1] = '\0';
6796                 break;
6797               }
6798             yyarg[yycount++] = yytname[yyx];
6799             yysize1 = yysize + yytnamerr (0, yytname[yyx]);
6800             yysize_overflow |= (yysize1 < yysize);
6801             yysize = yysize1;
6802             yyfmt = yystpcpy (yyfmt, yyprefix);
6803             yyprefix = yyor;
6804           }
6805
6806       yyf = YY_(yyformat);
6807       yysize1 = yysize + yystrlen (yyf);
6808       yysize_overflow |= (yysize1 < yysize);
6809       yysize = yysize1;
6810
6811       if (yysize_overflow)
6812         return YYSIZE_MAXIMUM;
6813
6814       if (yyresult)
6815         {
6816           /* Avoid sprintf, as that infringes on the user's name space.
6817              Don't have undefined behavior even if the translation
6818              produced a string with the wrong number of "%s"s.  */
6819           char *yyp = yyresult;
6820           int yyi = 0;
6821           while ((*yyp = *yyf) != '\0')
6822             {
6823               if (*yyp == '%' &amp;& yyf[1] == 's' && yyi < yycount)
6824                 {
6825                   yyp += yytnamerr (yyp, yyarg[yyi++]);
6826                   yyf += 2;
6827                 }
6828               else
6829                 {
6830                   yyp++;
6831                   yyf++;
6832                 }
6833             }
6834         }
6835       return yysize;
6836     }
6837 }
6838 </pre>
6839 </div>
6840 </td>
6841 </tr>
6842 <tr class="function_entry_moderate">
6843 <td class="function_entry_filename">
6844 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_convert_integer_src', '_asn1_convert_integer_button')"><span id="_asn1_convert_integer_button">&darr;</span></a>
6845 </td>
6846 <td class="function_entry_name">
6847 _asn1_convert_integer
6848 </td>
6849 <td class="function_entry_cyclo">
6850 15
6851 </td>
6852 <td class="function_entry_number">
6853 35
6854 </td>
6855 <td class="function_entry_number">
6856 50
6857 </td>
6858 <td class="function_entry_filename">
6859 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/element.c;hb=HEAD">lib/element.c</a>
6860 </td>
6861 </tr>
6862 <tr>
6863 <td colspan="6" height="0">
6864 <div id="_asn1_convert_integer_src" class="function_src" style="position: relative; display: none;">
6865 <pre class="function_src">
6866 asn1_retCode
6867 _asn1_convert_integer (const char *value, unsigned char *value_out,
6868                        int value_out_size, int *len)
6869 {
6870   char negative;
6871   unsigned char val[SIZEOF_UNSIGNED_LONG_INT];
6872   long valtmp;
6873   int k, k2;
6874
6875   valtmp = strtol (value, NULL, 10);
6876
6877   for (k = 0; k < SIZEOF_UNSIGNED_LONG_INT; k++)
6878     {
6879       val[SIZEOF_UNSIGNED_LONG_INT - k - 1] = (valtmp >> (8 * k)) &amp; 0xFF;
6880     }
6881
6882   if (val[0] &amp; 0x80)
6883     negative = 1;
6884   else
6885     negative = 0;
6886
6887   for (k = 0; k < SIZEOF_UNSIGNED_LONG_INT - 1; k++)
6888     {
6889       if (negative &amp;& (val[k] != 0xFF))
6890         break;
6891       else if (!negative &amp;& val[k])
6892         break;
6893     }
6894
6895   if ((negative &amp;& !(val[k] & 0x80)) || (!negative && (val[k] & 0x80)))
6896     k--;
6897
6898   *len = SIZEOF_UNSIGNED_LONG_INT - k;
6899
6900   if (SIZEOF_UNSIGNED_LONG_INT - k > value_out_size)
6901     /* VALUE_OUT is too short to contain the value conversion */
6902     return ASN1_MEM_ERROR;
6903
6904   for (k2 = k; k2 < SIZEOF_UNSIGNED_LONG_INT; k2++)
6905     value_out[k2 - k] = val[k2];
6906
6907 #if 0
6908   printf ("_asn1_convert_integer: valueIn=%s, lenOut=%d", value, *len);
6909   for (k = 0; k < SIZEOF_UNSIGNED_LONG_INT; k++)
6910     printf (", vOut[%d]=%d", k, value_out[k]);
6911   printf ("\n");
6912 #endif
6913
6914   return ASN1_SUCCESS;
6915 }
6916 </pre>
6917 </div>
6918 </td>
6919 </tr>
6920 <tr class="function_entry_moderate">
6921 <td class="function_entry_filename">
6922 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('asn1_read_tag_src', 'asn1_read_tag_button')"><span id="asn1_read_tag_button">&darr;</span></a>
6923 </td>
6924 <td class="function_entry_name">
6925 asn1_read_tag
6926 </td>
6927 <td class="function_entry_cyclo">
6928 29
6929 </td>
6930 <td class="function_entry_number">
6931 51
6932 </td>
6933 <td class="function_entry_number">
6934 101
6935 </td>
6936 <td class="function_entry_filename">
6937 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/element.c;hb=HEAD">lib/element.c</a>
6938 </td>
6939 </tr>
6940 <tr>
6941 <td colspan="6" height="0">
6942 <div id="asn1_read_tag_src" class="function_src" style="position: relative; display: none;">
6943 <pre class="function_src">
6944 asn1_retCode
6945 asn1_read_tag (ASN1_TYPE root, const char *name, int *tagValue,
6946                int *classValue)
6947 {
6948   ASN1_TYPE node, p, pTag;
6949
6950   node = asn1_find_node (root, name);
6951   if (node == NULL)
6952     return ASN1_ELEMENT_NOT_FOUND;
6953
6954   p = node->down;
6955
6956   /* pTag will points to the IMPLICIT TAG */
6957   pTag = NULL;
6958   if (node->type &amp; CONST_TAG)
6959     {
6960       while (p)
6961         {
6962           if (type_field (p->type) == TYPE_TAG)
6963             {
6964               if ((p->type &amp; CONST_IMPLICIT) && (pTag == NULL))
6965                 pTag = p;
6966               else if (p->type &amp; CONST_EXPLICIT)
6967                 pTag = NULL;
6968             }
6969           p = p->right;
6970         }
6971     }
6972
6973   if (pTag)
6974     {
6975       *tagValue = strtoul (pTag->value, NULL, 10);
6976
6977       if (pTag->type &amp; CONST_APPLICATION)
6978         *classValue = ASN1_CLASS_APPLICATION;
6979       else if (pTag->type &amp; CONST_UNIVERSAL)
6980         *classValue = ASN1_CLASS_UNIVERSAL;
6981       else if (pTag->type &amp; CONST_PRIVATE)
6982         *classValue = ASN1_CLASS_PRIVATE;
6983       else
6984         *classValue = ASN1_CLASS_CONTEXT_SPECIFIC;
6985     }
6986   else
6987     {
6988       *classValue = ASN1_CLASS_UNIVERSAL;
6989
6990       switch (type_field (node->type))
6991         {
6992         case TYPE_NULL:
6993           *tagValue = ASN1_TAG_NULL;
6994           break;
6995         case TYPE_BOOLEAN:
6996           *tagValue = ASN1_TAG_BOOLEAN;
6997           break;
6998         case TYPE_INTEGER:
6999           *tagValue = ASN1_TAG_INTEGER;
7000           break;
7001         case TYPE_ENUMERATED:
7002           *tagValue = ASN1_TAG_ENUMERATED;
7003           break;
7004         case TYPE_OBJECT_ID:
7005           *tagValue = ASN1_TAG_OBJECT_ID;
7006           break;
7007         case TYPE_TIME:
7008           if (node->type &amp; CONST_UTC)
7009             {
7010               *tagValue = ASN1_TAG_UTCTime;
7011             }
7012           else
7013             *tagValue = ASN1_TAG_GENERALIZEDTime;
7014           break;
7015         case TYPE_OCTET_STRING:
7016           *tagValue = ASN1_TAG_OCTET_STRING;
7017           break;
7018         case TYPE_GENERALSTRING:
7019           *tagValue = ASN1_TAG_GENERALSTRING;
7020           break;
7021         case TYPE_BIT_STRING:
7022           *tagValue = ASN1_TAG_BIT_STRING;
7023           break;
7024         case TYPE_SEQUENCE:
7025         case TYPE_SEQUENCE_OF:
7026           *tagValue = ASN1_TAG_SEQUENCE;
7027           break;
7028         case TYPE_SET:
7029         case TYPE_SET_OF:
7030           *tagValue = ASN1_TAG_SET;
7031           break;
7032         case TYPE_TAG:
7033         case TYPE_CHOICE:
7034         case TYPE_ANY:
7035           break;
7036         default:
7037           break;
7038         }
7039     }
7040
7041
7042   return ASN1_SUCCESS;
7043
7044 }
7045 </pre>
7046 </div>
7047 </td>
7048 </tr>
7049 <tr class="function_entry_moderate">
7050 <td class="function_entry_filename">
7051 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_objectid_der_src', '_asn1_objectid_der_button')"><span id="_asn1_objectid_der_button">&darr;</span></a>
7052 </td>
7053 <td class="function_entry_name">
7054 _asn1_objectid_der
7055 </td>
7056 <td class="function_entry_cyclo">
7057 14
7058 </td>
7059 <td class="function_entry_number">
7060 44
7061 </td>
7062 <td class="function_entry_number">
7063 69
7064 </td>
7065 <td class="function_entry_filename">
7066 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/coding.c;hb=HEAD">lib/coding.c</a>
7067 </td>
7068 </tr>
7069 <tr>
7070 <td colspan="6" height="0">
7071 <div id="_asn1_objectid_der_src" class="function_src" style="position: relative; display: none;">
7072 <pre class="function_src">
7073 static asn1_retCode
7074 _asn1_objectid_der (unsigned char *str, unsigned char *der, int *der_len)
7075 {
7076   int len_len, counter, k, first, max_len;
7077   char *temp, *n_end, *n_start;
7078   unsigned char bit7;
7079   unsigned long val, val1 = 0;
7080
7081   max_len = *der_len;
7082
7083   temp = (char *) _asn1_malloc (strlen (str) + 2);
7084   if (temp == NULL)
7085     return ASN1_MEM_ALLOC_ERROR;
7086
7087   strcpy (temp, str);
7088   strcat (temp, ".");
7089
7090   counter = 0;
7091   n_start = temp;
7092   while ((n_end = strchr (n_start, '.')))
7093     {
7094       *n_end = 0;
7095       val = strtoul (n_start, NULL, 10);
7096       counter++;
7097
7098       if (counter == 1)
7099         val1 = val;
7100       else if (counter == 2)
7101         {
7102           if (max_len > 0)
7103             der[0] = 40 * val1 + val;
7104           *der_len = 1;
7105         }
7106       else
7107         {
7108           first = 0;
7109           for (k = 4; k >= 0; k--)
7110             {
7111               bit7 = (val >> (k * 7)) &amp; 0x7F;
7112               if (bit7 || first || !k)
7113                 {
7114                   if (k)
7115                     bit7 |= 0x80;
7116                   if (max_len > (*der_len))
7117                     der[*der_len] = bit7;
7118                   (*der_len)++;
7119                   first = 1;
7120                 }
7121             }
7122
7123         }
7124       n_start = n_end + 1;
7125     }
7126
7127   asn1_length_der (*der_len, NULL, &amp;len_len);
7128   if (max_len >= (*der_len + len_len))
7129     {
7130       memmove (der + len_len, der, *der_len);
7131       asn1_length_der (*der_len, der, &amp;len_len);
7132     }
7133   *der_len += len_len;
7134
7135   _asn1_free (temp);
7136
7137   if (max_len < (*der_len))
7138     return ASN1_MEM_ERROR;
7139
7140   return ASN1_SUCCESS;
7141 }
7142 </pre>
7143 </div>
7144 </td>
7145 </tr>
7146 <tr class="function_entry_moderate">
7147 <td class="function_entry_filename">
7148 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_type_set_config_src', '_asn1_type_set_config_button')"><span id="_asn1_type_set_config_button">&darr;</span></a>
7149 </td>
7150 <td class="function_entry_name">
7151 _asn1_type_set_config
7152 </td>
7153 <td class="function_entry_cyclo">
7154 14
7155 </td>
7156 <td class="function_entry_number">
7157 30
7158 </td>
7159 <td class="function_entry_number">
7160 58
7161 </td>
7162 <td class="function_entry_filename">
7163 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
7164 </td>
7165 </tr>
7166 <tr>
7167 <td colspan="6" height="0">
7168 <div id="_asn1_type_set_config_src" class="function_src" style="position: relative; display: none;">
7169 <pre class="function_src">
7170 asn1_retCode
7171 _asn1_type_set_config (ASN1_TYPE node)
7172 {
7173   ASN1_TYPE p, p2;
7174   int move;
7175
7176   if (node == NULL)
7177     return ASN1_ELEMENT_NOT_FOUND;
7178
7179   p = node;
7180   move = DOWN;
7181
7182   while (!((p == node) &amp;& (move == UP)))
7183     {
7184       if (move != UP)
7185         {
7186           if (type_field (p->type) == TYPE_SET)
7187             {
7188               p2 = p->down;
7189               while (p2)
7190                 {
7191                   if (type_field (p2->type) != TYPE_TAG)
7192                     p2->type |= CONST_SET | CONST_NOT_USED;
7193                   p2 = p2->right;
7194                 }
7195             }
7196           move = DOWN;
7197         }
7198       else
7199         move = RIGHT;
7200
7201       if (move == DOWN)
7202         {
7203           if (p->down)
7204             p = p->down;
7205           else
7206             move = RIGHT;
7207         }
7208
7209       if (p == node)
7210         {
7211           move = UP;
7212           continue;
7213         }
7214
7215       if (move == RIGHT)
7216         {
7217           if (p->right)
7218             p = p->right;
7219           else
7220             move = UP;
7221         }
7222       if (move == UP)
7223         p = _asn1_find_up (p);
7224     }
7225
7226   return ASN1_SUCCESS;
7227 }
7228 </pre>
7229 </div>
7230 </td>
7231 </tr>
7232 <tr class="function_entry_moderate">
7233 <td class="function_entry_filename">
7234 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_get_objectid_der_src', '_asn1_get_objectid_der_button')"><span id="_asn1_get_objectid_der_button">&darr;</span></a>
7235 </td>
7236 <td class="function_entry_name">
7237 _asn1_get_objectid_der
7238 </td>
7239 <td class="function_entry_cyclo">
7240 13
7241 </td>
7242 <td class="function_entry_number">
7243 39
7244 </td>
7245 <td class="function_entry_number">
7246 60
7247 </td>
7248 <td class="function_entry_filename">
7249 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/decoding.c;hb=HEAD">lib/decoding.c</a>
7250 </td>
7251 </tr>
7252 <tr>
7253 <td colspan="6" height="0">
7254 <div id="_asn1_get_objectid_der_src" class="function_src" style="position: relative; display: none;">
7255 <pre class="function_src">
7256 static int
7257 _asn1_get_objectid_der (const unsigned char *der, int der_len, int *ret_len,
7258                         char *str, int str_size)
7259 {
7260   int len_len, len, k;
7261   int leading;
7262   char temp[20];
7263   unsigned long val, val1, prev_val;
7264
7265   *ret_len = 0;
7266   if (str &amp;& str_size > 0)
7267     str[0] = 0;                 /* no oid */
7268
7269   if (str == NULL || der_len <= 0)
7270     return ASN1_GENERIC_ERROR;
7271   len = asn1_get_length_der (der, der_len, &amp;len_len);
7272
7273   if (len < 0 || len > der_len || len_len > der_len)
7274     return ASN1_DER_ERROR;
7275
7276   val1 = der[len_len] / 40;
7277   val = der[len_len] - val1 * 40;
7278
7279   _asn1_str_cpy (str, str_size, _asn1_ltostr (val1, temp));
7280   _asn1_str_cat (str, str_size, ".");
7281   _asn1_str_cat (str, str_size, _asn1_ltostr (val, temp));
7282
7283   prev_val = 0;
7284   val = 0;
7285   leading = 1;
7286   for (k = 1; k < len; k++)
7287     {
7288       /* X.690 mandates that the leading byte must never be 0x80
7289        */
7290       if (leading != 0 &amp;& der[len_len + k] == 0x80)
7291         return ASN1_DER_ERROR;
7292       leading = 0;
7293
7294       /* check for wrap around */
7295       val = val << 7;
7296       val |= der[len_len + k] &amp; 0x7F;
7297
7298       if (val < prev_val)
7299         return ASN1_DER_ERROR;
7300
7301       prev_val = val;
7302
7303       if (!(der[len_len + k] &amp; 0x80))
7304         {
7305           _asn1_str_cat (str, str_size, ".");
7306           _asn1_str_cat (str, str_size, _asn1_ltostr (val, temp));
7307           val = 0;
7308           prev_val = 0;
7309           leading = 1;
7310         }
7311     }
7312   *ret_len = len + len_len;
7313
7314   return ASN1_SUCCESS;
7315 }
7316 </pre>
7317 </div>
7318 </td>
7319 </tr>
7320 <tr class="function_entry_moderate">
7321 <td class="function_entry_filename">
7322 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_delete_not_used_src', '_asn1_delete_not_used_button')"><span id="_asn1_delete_not_used_button">&darr;</span></a>
7323 </td>
7324 <td class="function_entry_name">
7325 _asn1_delete_not_used
7326 </td>
7327 <td class="function_entry_cyclo">
7328 13
7329 </td>
7330 <td class="function_entry_number">
7331 30
7332 </td>
7333 <td class="function_entry_number">
7334 58
7335 </td>
7336 <td class="function_entry_filename">
7337 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/decoding.c;hb=HEAD">lib/decoding.c</a>
7338 </td>
7339 </tr>
7340 <tr>
7341 <td colspan="6" height="0">
7342 <div id="_asn1_delete_not_used_src" class="function_src" style="position: relative; display: none;">
7343 <pre class="function_src">
7344 static int
7345 _asn1_delete_not_used (ASN1_TYPE node)
7346 {
7347   ASN1_TYPE p, p2;
7348
7349   if (node == NULL)
7350     return ASN1_ELEMENT_NOT_FOUND;
7351
7352   p = node;
7353   while (p)
7354     {
7355       if (p->type &amp; CONST_NOT_USED)
7356         {
7357           p2 = NULL;
7358           if (p != node)
7359             {
7360               p2 = _asn1_find_left (p);
7361               if (!p2)
7362                 p2 = _asn1_find_up (p);
7363             }
7364           asn1_delete_structure (&amp;p);
7365           p = p2;
7366         }
7367
7368       if (!p)
7369         break;                  /* reach node */
7370
7371       if (p->down)
7372         {
7373           p = p->down;
7374         }
7375       else
7376         {
7377           if (p == node)
7378             p = NULL;
7379           else if (p->right)
7380             p = p->right;
7381           else
7382             {
7383               while (1)
7384                 {
7385                   p = _asn1_find_up (p);
7386                   if (p == node)
7387                     {
7388                       p = NULL;
7389                       break;
7390                     }
7391                   if (p->right)
7392                     {
7393                       p = p->right;
7394                       break;
7395                     }
7396                 }
7397             }
7398         }
7399     }
7400   return ASN1_SUCCESS;
7401 }
7402 </pre>
7403 </div>
7404 </td>
7405 </tr>
7406 <tr class="function_entry_moderate">
7407 <td class="function_entry_filename">
7408 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_set_default_tag_src', '_asn1_set_default_tag_button')"><span id="_asn1_set_default_tag_button">&darr;</span></a>
7409 </td>
7410 <td class="function_entry_name">
7411 _asn1_set_default_tag
7412 </td>
7413 <td class="function_entry_cyclo">
7414 13
7415 </td>
7416 <td class="function_entry_number">
7417 22
7418 </td>
7419 <td class="function_entry_number">
7420 47
7421 </td>
7422 <td class="function_entry_filename">
7423 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
7424 </td>
7425 </tr>
7426 <tr>
7427 <td colspan="6" height="0">
7428 <div id="_asn1_set_default_tag_src" class="function_src" style="position: relative; display: none;">
7429 <pre class="function_src">
7430 asn1_retCode
7431 _asn1_set_default_tag (ASN1_TYPE node)
7432 {
7433   ASN1_TYPE p;
7434
7435   if ((node == NULL) || (type_field (node->type) != TYPE_DEFINITIONS))
7436     return ASN1_ELEMENT_NOT_FOUND;
7437
7438   p = node;
7439   while (p)
7440     {
7441       if ((type_field (p->type) == TYPE_TAG) &amp;&
7442           !(p->type &amp; CONST_EXPLICIT) && !(p->type & CONST_IMPLICIT))
7443         {
7444           if (node->type &amp; CONST_EXPLICIT)
7445             p->type |= CONST_EXPLICIT;
7446           else
7447             p->type |= CONST_IMPLICIT;
7448         }
7449
7450       if (p->down)
7451         {
7452           p = p->down;
7453         }
7454       else if (p->right)
7455         p = p->right;
7456       else
7457         {
7458           while (1)
7459             {
7460               p = _asn1_find_up (p);
7461               if (p == node)
7462                 {
7463                   p = NULL;
7464                   break;
7465                 }
7466               if (p->right)
7467                 {
7468                   p = p->right;
7469                   break;
7470                 }
7471             }
7472         }
7473     }
7474
7475   return ASN1_SUCCESS;
7476 }
7477 </pre>
7478 </div>
7479 </td>
7480 </tr>
7481 <tr class="function_entry_moderate">
7482 <td class="function_entry_filename">
7483 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_create_static_structure_src', '_asn1_create_static_structure_button')"><span id="_asn1_create_static_structure_button">&darr;</span></a>
7484 </td>
7485 <td class="function_entry_name">
7486 _asn1_create_static_structure
7487 </td>
7488 <td class="function_entry_cyclo">
7489 12
7490 </td>
7491 <td class="function_entry_number">
7492 41
7493 </td>
7494 <td class="function_entry_number">
7495 78
7496 </td>
7497 <td class="function_entry_filename">
7498 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/structure.c;hb=HEAD">lib/structure.c</a>
7499 </td>
7500 </tr>
7501 <tr>
7502 <td colspan="6" height="0">
7503 <div id="_asn1_create_static_structure_src" class="function_src" style="position: relative; display: none;">
7504 <pre class="function_src">
7505 asn1_retCode
7506 _asn1_create_static_structure (ASN1_TYPE pointer, char *output_file_name,
7507                                char *vector_name)
7508 {
7509   FILE *file;
7510   ASN1_TYPE p;
7511   unsigned long t;
7512
7513   file = fopen (output_file_name, "w");
7514
7515   if (file == NULL)
7516     return ASN1_FILE_NOT_FOUND;
7517
7518   fprintf (file, "#if HAVE_CONFIG_H\n");
7519   fprintf (file, "# include \"config.h\"\n");
7520   fprintf (file, "#endif\n\n");
7521
7522   fprintf (file, "#include <libtasn1.h>\n\n");
7523
7524   fprintf (file, "const ASN1_ARRAY_TYPE %s[] = {\n", vector_name);
7525
7526   p = pointer;
7527
7528   while (p)
7529     {
7530       fprintf (file, "  { ");
7531
7532       if (p->name)
7533         fprintf (file, "\"%s\", ", p->name);
7534       else
7535         fprintf (file, "NULL, ");
7536
7537       t = p->type;
7538       if (p->down)
7539         t |= CONST_DOWN;
7540       if (p->right)
7541         t |= CONST_RIGHT;
7542
7543       fprintf (file, "%lu, ", t);
7544
7545       if (p->value)
7546         fprintf (file, "\"%s\"},\n", p->value);
7547       else
7548         fprintf (file, "NULL },\n");
7549
7550       if (p->down)
7551         {
7552           p = p->down;
7553         }
7554       else if (p->right)
7555         {
7556           p = p->right;
7557         }
7558       else
7559         {
7560           while (1)
7561             {
7562               p = _asn1_find_up (p);
7563               if (p == pointer)
7564                 {
7565                   p = NULL;
7566                   break;
7567                 }
7568               if (p->right)
7569                 {
7570                   p = p->right;
7571                   break;
7572                 }
7573             }
7574         }
7575     }
7576
7577   fprintf (file, "  { NULL, 0, NULL }\n};\n");
7578
7579   fclose (file);
7580
7581   return ASN1_SUCCESS;
7582 }
7583 </pre>
7584 </div>
7585 </td>
7586 </tr>
7587 <tr class="function_entry_moderate">
7588 <td class="function_entry_filename">
7589 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_copy_structure3_src', '_asn1_copy_structure3_button')"><span id="_asn1_copy_structure3_button">&darr;</span></a>
7590 </td>
7591 <td class="function_entry_name">
7592 _asn1_copy_structure3
7593 </td>
7594 <td class="function_entry_cyclo">
7595 12
7596 </td>
7597 <td class="function_entry_number">
7598 37
7599 </td>
7600 <td class="function_entry_number">
7601 67
7602 </td>
7603 <td class="function_entry_filename">
7604 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/structure.c;hb=HEAD">lib/structure.c</a>
7605 </td>
7606 </tr>
7607 <tr>
7608 <td colspan="6" height="0">
7609 <div id="_asn1_copy_structure3_src" class="function_src" style="position: relative; display: none;">
7610 <pre class="function_src">
7611 ASN1_TYPE
7612 _asn1_copy_structure3 (ASN1_TYPE source_node)
7613 {
7614   ASN1_TYPE dest_node, p_s, p_d, p_d_prev;
7615   int move;
7616
7617   if (source_node == NULL)
7618     return NULL;
7619
7620   dest_node = _asn1_add_node_only (source_node->type);
7621
7622   p_s = source_node;
7623   p_d = dest_node;
7624
7625   move = DOWN;
7626
7627   do
7628     {
7629       if (move != UP)
7630         {
7631           if (p_s->name)
7632             _asn1_set_name (p_d, p_s->name);
7633           if (p_s->value)
7634             _asn1_set_value (p_d, p_s->value, p_s->value_len);
7635           move = DOWN;
7636         }
7637       else
7638         move = RIGHT;
7639
7640       if (move == DOWN)
7641         {
7642           if (p_s->down)
7643             {
7644               p_s = p_s->down;
7645               p_d_prev = p_d;
7646               p_d = _asn1_add_node_only (p_s->type);
7647               _asn1_set_down (p_d_prev, p_d);
7648             }
7649           else
7650             move = RIGHT;
7651         }
7652
7653       if (p_s == source_node)
7654         break;
7655
7656       if (move == RIGHT)
7657         {
7658           if (p_s->right)
7659             {
7660               p_s = p_s->right;
7661               p_d_prev = p_d;
7662               p_d = _asn1_add_node_only (p_s->type);
7663               _asn1_set_right (p_d_prev, p_d);
7664             }
7665           else
7666             move = UP;
7667         }
7668       if (move == UP)
7669         {
7670           p_s = _asn1_find_up (p_s);
7671           p_d = _asn1_find_up (p_d);
7672         }
7673     }
7674   while (p_s != source_node);
7675
7676   return dest_node;
7677 }
7678 </pre>
7679 </div>
7680 </td>
7681 </tr>
7682 <tr class="function_entry_moderate">
7683 <td class="function_entry_filename">
7684 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('_asn1_change_integer_value_src', '_asn1_change_integer_value_button')"><span id="_asn1_change_integer_value_button">&darr;</span></a>
7685 </td>
7686 <td class="function_entry_name">
7687 _asn1_change_integer_value
7688 </td>
7689 <td class="function_entry_cyclo">
7690 12
7691 </td>
7692 <td class="function_entry_number">
7693 28
7694 </td>
7695 <td class="function_entry_number">
7696 56
7697 </td>
7698 <td class="function_entry_filename">
7699 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
7700 </td>
7701 </tr>
7702 <tr>
7703 <td colspan="6" height="0">
7704 <div id="_asn1_change_integer_value_src" class="function_src" style="position: relative; display: none;">
7705 <pre class="function_src">
7706 asn1_retCode
7707 _asn1_change_integer_value (ASN1_TYPE node)
7708 {
7709   ASN1_TYPE p;
7710   unsigned char val[SIZEOF_UNSIGNED_LONG_INT];
7711   unsigned char val2[SIZEOF_UNSIGNED_LONG_INT + 1];
7712   int len;
7713
7714   if (node == NULL)
7715     return ASN1_ELEMENT_NOT_FOUND;
7716
7717   p = node;
7718   while (p)
7719     {
7720       if ((type_field (p->type) == TYPE_INTEGER) &amp;& (p->type & CONST_ASSIGN))
7721         {
7722           if (p->value)
7723             {
7724               _asn1_convert_integer (p->value, val, sizeof (val), &amp;len);
7725               asn1_octet_der (val, len, val2, &amp;len);
7726               _asn1_set_value (p, val2, len);
7727             }
7728         }
7729
7730       if (p->down)
7731         {
7732           p = p->down;
7733         }
7734       else
7735         {
7736           if (p == node)
7737             p = NULL;
7738           else if (p->right)
7739             p = p->right;
7740           else
7741             {
7742               while (1)
7743                 {
7744                   p = _asn1_find_up (p);
7745                   if (p == node)
7746                     {
7747                       p = NULL;
7748                       break;
7749                     }
7750                   if (p->right)
7751                     {
7752                       p = p->right;
7753                       break;
7754                     }
7755                 }
7756             }
7757         }
7758     }
7759
7760   return ASN1_SUCCESS;
7761 }
7762 </pre>
7763 </div>
7764 </td>
7765 </tr>
7766 <tr class="function_entry_moderate">
7767 <td class="function_entry_filename">
7768 <a href="javascript:void(0);" title="show/hide function source" onClick="javascript:show_hide('asn1_get_tag_der_src', 'asn1_get_tag_der_button')"><span id="asn1_get_tag_der_button">&darr;</span></a>
7769 </td>
7770 <td class="function_entry_name">
7771 asn1_get_tag_der
7772 </td>
7773 <td class="function_entry_cyclo">
7774 11
7775 </td>
7776 <td class="function_entry_number">
7777 24
7778 </td>
7779 <td class="function_entry_number">
7780 44
7781 </td>
7782 <td class="function_entry_filename">
7783 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/decoding.c;hb=HEAD">lib/decoding.c</a>
7784 </td>
7785 </tr>
7786 <tr>
7787 <td colspan="6" height="0">
7788 <div id="asn1_get_tag_der_src" class="function_src" style="position: relative; display: none;">
7789 <pre class="function_src">
7790 int
7791 asn1_get_tag_der (const unsigned char *der, int der_len,
7792                   unsigned char *cls, int *len, unsigned long *tag)
7793 {
7794   int punt, ris;
7795
7796   if (der == NULL || der_len < 2 || len == NULL)
7797     return ASN1_DER_ERROR;
7798
7799   *cls = der[0] &amp; 0xE0;
7800   if ((der[0] &amp; 0x1F) != 0x1F)
7801     {
7802       /* short form */
7803       *len = 1;
7804       ris = der[0] &amp; 0x1F;
7805     }
7806   else
7807     {
7808       /* Long form */
7809       punt = 1;
7810       ris = 0;
7811       while (punt <= der_len &amp;& der[punt] & 128)
7812         {
7813           int last = ris;
7814           ris = ris * 128 + (der[punt++] &amp; 0x7F);
7815           if (ris < last)
7816             /* wrapper around, and no bignums... */
7817             return ASN1_DER_ERROR;
7818         }
7819       if (punt >= der_len)
7820         return ASN1_DER_ERROR;
7821       {
7822         int last = ris;
7823         ris = ris * 128 + (der[punt++] &amp; 0x7F);
7824         if (ris < last)
7825           /* wrapper around, and no bignums... */
7826           return ASN1_DER_ERROR;
7827       }
7828       *len = punt;
7829     }
7830   if (tag)
7831     *tag = ris;
7832   return ASN1_SUCCESS;
7833 }
7834 </pre>
7835 </div>
7836 </td>
7837 </tr>
7838 <tr class="function_entry_simple">
7839 <td class="function_entry_filename">
7840 &nbsp;
7841 </td>
7842 <td class="function_entry_name">
7843 _asn1_get_indefinite_length_string
7844 </td>
7845 <td class="function_entry_cyclo">
7846 10
7847 </td>
7848 <td class="function_entry_number">
7849 27
7850 </td>
7851 <td class="function_entry_number">
7852 49
7853 </td>
7854 <td class="function_entry_filename">
7855 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/decoding.c;hb=HEAD">lib/decoding.c</a>
7856 </td>
7857 </tr>
7858 <tr class="function_entry_simple">
7859 <td class="function_entry_filename">
7860 &nbsp;
7861 </td>
7862 <td class="function_entry_name">
7863 _asn1_complete_explicit_tag
7864 </td>
7865 <td class="function_entry_cyclo">
7866 10
7867 </td>
7868 <td class="function_entry_number">
7869 26
7870 </td>
7871 <td class="function_entry_number">
7872 56
7873 </td>
7874 <td class="function_entry_filename">
7875 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/coding.c;hb=HEAD">lib/coding.c</a>
7876 </td>
7877 </tr>
7878 <tr class="function_entry_simple">
7879 <td class="function_entry_filename">
7880 &nbsp;
7881 </td>
7882 <td class="function_entry_name">
7883 asn1_parser2array
7884 </td>
7885 <td class="function_entry_cyclo">
7886 9
7887 </td>
7888 <td class="function_entry_number">
7889 48
7890 </td>
7891 <td class="function_entry_number">
7892 95
7893 </td>
7894 <td class="function_entry_filename">
7895 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/ASN1.c;hb=HEAD">lib/ASN1.c</a>
7896 </td>
7897 </tr>
7898 <tr class="function_entry_simple">
7899 <td class="function_entry_filename">
7900 &nbsp;
7901 </td>
7902 <td class="function_entry_name">
7903 asn1_find_structure_from_oid
7904 </td>
7905 <td class="function_entry_cyclo">
7906 9
7907 </td>
7908 <td class="function_entry_number">
7909 23
7910 </td>
7911 <td class="function_entry_number">
7912 43
7913 </td>
7914 <td class="function_entry_filename">
7915 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/structure.c;hb=HEAD">lib/structure.c</a>
7916 </td>
7917 </tr>
7918 <tr class="function_entry_simple">
7919 <td class="function_entry_filename">
7920 &nbsp;
7921 </td>
7922 <td class="function_entry_name">
7923 asn1_delete_structure
7924 </td>
7925 <td class="function_entry_cyclo">
7926 8
7927 </td>
7928 <td class="function_entry_number">
7929 25
7930 </td>
7931 <td class="function_entry_number">
7932 50
7933 </td>
7934 <td class="function_entry_filename">
7935 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/structure.c;hb=HEAD">lib/structure.c</a>
7936 </td>
7937 </tr>
7938 <tr class="function_entry_simple">
7939 <td class="function_entry_filename">
7940 &nbsp;
7941 </td>
7942 <td class="function_entry_name">
7943 yytnamerr
7944 </td>
7945 <td class="function_entry_cyclo">
7946 11
7947 </td>
7948 <td class="function_entry_number">
7949 20
7950 </td>
7951 <td class="function_entry_number">
7952 38
7953 </td>
7954 <td class="function_entry_filename">
7955 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/ASN1.c;hb=HEAD">lib/ASN1.c</a>
7956 </td>
7957 </tr>
7958 <tr class="function_entry_simple">
7959 <td class="function_entry_filename">
7960 &nbsp;
7961 </td>
7962 <td class="function_entry_name">
7963 _asn1_append_value
7964 </td>
7965 <td class="function_entry_cyclo">
7966 7
7967 </td>
7968 <td class="function_entry_number">
7969 22
7970 </td>
7971 <td class="function_entry_number">
7972 39
7973 </td>
7974 <td class="function_entry_filename">
7975 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
7976 </td>
7977 </tr>
7978 <tr class="function_entry_simple">
7979 <td class="function_entry_filename">
7980 &nbsp;
7981 </td>
7982 <td class="function_entry_name">
7983 _asn1_extract_der_octet
7984 </td>
7985 <td class="function_entry_cyclo">
7986 7
7987 </td>
7988 <td class="function_entry_number">
7989 20
7990 </td>
7991 <td class="function_entry_number">
7992 44
7993 </td>
7994 <td class="function_entry_filename">
7995 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/decoding.c;hb=HEAD">lib/decoding.c</a>
7996 </td>
7997 </tr>
7998 <tr class="function_entry_simple">
7999 <td class="function_entry_filename">
8000 &nbsp;
8001 </td>
8002 <td class="function_entry_name">
8003 asn1_get_length_der
8004 </td>
8005 <td class="function_entry_cyclo">
8006 7
8007 </td>
8008 <td class="function_entry_number">
8009 20
8010 </td>
8011 <td class="function_entry_number">
8012 43
8013 </td>
8014 <td class="function_entry_filename">
8015 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/decoding.c;hb=HEAD">lib/decoding.c</a>
8016 </td>
8017 </tr>
8018 <tr class="function_entry_simple">
8019 <td class="function_entry_filename">
8020 &nbsp;
8021 </td>
8022 <td class="function_entry_name">
8023 _asn1_append_sequence_set
8024 </td>
8025 <td class="function_entry_cyclo">
8026 7
8027 </td>
8028 <td class="function_entry_number">
8029 20
8030 </td>
8031 <td class="function_entry_number">
8032 33
8033 </td>
8034 <td class="function_entry_filename">
8035 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/element.c;hb=HEAD">lib/element.c</a>
8036 </td>
8037 </tr>
8038 <tr class="function_entry_simple">
8039 <td class="function_entry_filename">
8040 &nbsp;
8041 </td>
8042 <td class="function_entry_name">
8043 _asn1_set_value
8044 </td>
8045 <td class="function_entry_cyclo">
8046 7
8047 </td>
8048 <td class="function_entry_number">
8049 17
8050 </td>
8051 <td class="function_entry_number">
8052 31
8053 </td>
8054 <td class="function_entry_filename">
8055 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
8056 </td>
8057 </tr>
8058 <tr class="function_entry_simple">
8059 <td class="function_entry_filename">
8060 &nbsp;
8061 </td>
8062 <td class="function_entry_name">
8063 _asn1_create_errorDescription
8064 </td>
8065 <td class="function_entry_cyclo">
8066 11
8067 </td>
8068 <td class="function_entry_number">
8069 29
8070 </td>
8071 <td class="function_entry_number">
8072 42
8073 </td>
8074 <td class="function_entry_filename">
8075 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/ASN1.c;hb=HEAD">lib/ASN1.c</a>
8076 </td>
8077 </tr>
8078 <tr class="function_entry_simple">
8079 <td class="function_entry_filename">
8080 &nbsp;
8081 </td>
8082 <td class="function_entry_name">
8083 asn1_parser2tree
8084 </td>
8085 <td class="function_entry_cyclo">
8086 6
8087 </td>
8088 <td class="function_entry_number">
8089 26
8090 </td>
8091 <td class="function_entry_number">
8092 58
8093 </td>
8094 <td class="function_entry_filename">
8095 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/ASN1.c;hb=HEAD">lib/ASN1.c</a>
8096 </td>
8097 </tr>
8098 <tr class="function_entry_simple">
8099 <td class="function_entry_filename">
8100 &nbsp;
8101 </td>
8102 <td class="function_entry_name">
8103 asn1_length_der
8104 </td>
8105 <td class="function_entry_cyclo">
8106 6
8107 </td>
8108 <td class="function_entry_number">
8109 15
8110 </td>
8111 <td class="function_entry_number">
8112 31
8113 </td>
8114 <td class="function_entry_filename">
8115 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/coding.c;hb=HEAD">lib/coding.c</a>
8116 </td>
8117 </tr>
8118 <tr class="function_entry_simple">
8119 <td class="function_entry_filename">
8120 &nbsp;
8121 </td>
8122 <td class="function_entry_name">
8123 _asn1_set_name
8124 </td>
8125 <td class="function_entry_cyclo">
8126 6
8127 </td>
8128 <td class="function_entry_number">
8129 13
8130 </td>
8131 <td class="function_entry_number">
8132 25
8133 </td>
8134 <td class="function_entry_filename">
8135 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
8136 </td>
8137 </tr>
8138 <tr class="function_entry_simple">
8139 <td class="function_entry_filename">
8140 &nbsp;
8141 </td>
8142 <td class="function_entry_name">
8143 asn1_number_of_elements
8144 </td>
8145 <td class="function_entry_cyclo">
8146 6
8147 </td>
8148 <td class="function_entry_number">
8149 13
8150 </td>
8151 <td class="function_entry_number">
8152 25
8153 </td>
8154 <td class="function_entry_filename">
8155 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/structure.c;hb=HEAD">lib/structure.c</a>
8156 </td>
8157 </tr>
8158 <tr class="function_entry_simple">
8159 <td class="function_entry_filename">
8160 &nbsp;
8161 </td>
8162 <td class="function_entry_name">
8163 _asn1_remove_node
8164 </td>
8165 <td class="function_entry_cyclo">
8166 5
8167 </td>
8168 <td class="function_entry_number">
8169 7
8170 </td>
8171 <td class="function_entry_number">
8172 12
8173 </td>
8174 <td class="function_entry_filename">
8175 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
8176 </td>
8177 </tr>
8178 <tr class="function_entry_simple">
8179 <td class="function_entry_filename">
8180 &nbsp;
8181 </td>
8182 <td class="function_entry_name">
8183 asn1_copy_node
8184 </td>
8185 <td class="function_entry_cyclo">
8186 5
8187 </td>
8188 <td class="function_entry_number">
8189 21
8190 </td>
8191 <td class="function_entry_number">
8192 40
8193 </td>
8194 <td class="function_entry_filename">
8195 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/structure.c;hb=HEAD">lib/structure.c</a>
8196 </td>
8197 </tr>
8198 <tr class="function_entry_simple">
8199 <td class="function_entry_filename">
8200 &nbsp;
8201 </td>
8202 <td class="function_entry_name">
8203 asn1_delete_element
8204 </td>
8205 <td class="function_entry_cyclo">
8206 5
8207 </td>
8208 <td class="function_entry_number">
8209 14
8210 </td>
8211 <td class="function_entry_number">
8212 25
8213 </td>
8214 <td class="function_entry_filename">
8215 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/structure.c;hb=HEAD">lib/structure.c</a>
8216 </td>
8217 </tr>
8218 <tr class="function_entry_simple">
8219 <td class="function_entry_filename">
8220 &nbsp;
8221 </td>
8222 <td class="function_entry_name">
8223 _asn1_set_value_m
8224 </td>
8225 <td class="function_entry_cyclo">
8226 5
8227 </td>
8228 <td class="function_entry_number">
8229 12
8230 </td>
8231 <td class="function_entry_number">
8232 22
8233 </td>
8234 <td class="function_entry_filename">
8235 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
8236 </td>
8237 </tr>
8238 <tr class="function_entry_simple">
8239 <td class="function_entry_filename">
8240 &nbsp;
8241 </td>
8242 <td class="function_entry_name">
8243 _asn1_get_time_der
8244 </td>
8245 <td class="function_entry_cyclo">
8246 5
8247 </td>
8248 <td class="function_entry_number">
8249 10
8250 </td>
8251 <td class="function_entry_number">
8252 17
8253 </td>
8254 <td class="function_entry_filename">
8255 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/decoding.c;hb=HEAD">lib/decoding.c</a>
8256 </td>
8257 </tr>
8258 <tr class="function_entry_simple">
8259 <td class="function_entry_filename">
8260 &nbsp;
8261 </td>
8262 <td class="function_entry_name">
8263 _asn1_find_up
8264 </td>
8265 <td class="function_entry_cyclo">
8266 4
8267 </td>
8268 <td class="function_entry_number">
8269 7
8270 </td>
8271 <td class="function_entry_number">
8272 15
8273 </td>
8274 <td class="function_entry_filename">
8275 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
8276 </td>
8277 </tr>
8278 <tr class="function_entry_simple">
8279 <td class="function_entry_filename">
8280 &nbsp;
8281 </td>
8282 <td class="function_entry_name">
8283 _asn1_find_left
8284 </td>
8285 <td class="function_entry_cyclo">
8286 4
8287 </td>
8288 <td class="function_entry_number">
8289 3
8290 </td>
8291 <td class="function_entry_number">
8292 8
8293 </td>
8294 <td class="function_entry_filename">
8295 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/structure.c;hb=HEAD">lib/structure.c</a>
8296 </td>
8297 </tr>
8298 <tr class="function_entry_simple">
8299 <td class="function_entry_filename">
8300 &nbsp;
8301 </td>
8302 <td class="function_entry_name">
8303 _asn1_ltostr
8304 </td>
8305 <td class="function_entry_cyclo">
8306 4
8307 </td>
8308 <td class="function_entry_number">
8309 22
8310 </td>
8311 <td class="function_entry_number">
8312 32
8313 </td>
8314 <td class="function_entry_filename">
8315 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
8316 </td>
8317 </tr>
8318 <tr class="function_entry_simple">
8319 <td class="function_entry_filename">
8320 &nbsp;
8321 </td>
8322 <td class="function_entry_name">
8323 _asn1_tag_der
8324 </td>
8325 <td class="function_entry_cyclo">
8326 4
8327 </td>
8328 <td class="function_entry_number">
8329 14
8330 </td>
8331 <td class="function_entry_number">
8332 29
8333 </td>
8334 <td class="function_entry_filename">
8335 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/coding.c;hb=HEAD">lib/coding.c</a>
8336 </td>
8337 </tr>
8338 <tr class="function_entry_simple">
8339 <td class="function_entry_filename">
8340 &nbsp;
8341 </td>
8342 <td class="function_entry_name">
8343 _asn1_hierarchical_name
8344 </td>
8345 <td class="function_entry_cyclo">
8346 4
8347 </td>
8348 <td class="function_entry_number">
8349 12
8350 </td>
8351 <td class="function_entry_number">
8352 25
8353 </td>
8354 <td class="function_entry_filename">
8355 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/element.c;hb=HEAD">lib/element.c</a>
8356 </td>
8357 </tr>
8358 <tr class="function_entry_simple">
8359 <td class="function_entry_filename">
8360 &nbsp;
8361 </td>
8362 <td class="function_entry_name">
8363 asn1_get_bit_der
8364 </td>
8365 <td class="function_entry_cyclo">
8366 4
8367 </td>
8368 <td class="function_entry_number">
8369 12
8370 </td>
8371 <td class="function_entry_number">
8372 25
8373 </td>
8374 <td class="function_entry_filename">
8375 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/decoding.c;hb=HEAD">lib/decoding.c</a>
8376 </td>
8377 </tr>
8378 <tr class="function_entry_simple">
8379 <td class="function_entry_filename">
8380 &nbsp;
8381 </td>
8382 <td class="function_entry_name">
8383 asn1_get_octet_der
8384 </td>
8385 <td class="function_entry_cyclo">
8386 4
8387 </td>
8388 <td class="function_entry_number">
8389 11
8390 </td>
8391 <td class="function_entry_number">
8392 26
8393 </td>
8394 <td class="function_entry_filename">
8395 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/decoding.c;hb=HEAD">lib/decoding.c</a>
8396 </td>
8397 </tr>
8398 <tr class="function_entry_simple">
8399 <td class="function_entry_filename">
8400 &nbsp;
8401 </td>
8402 <td class="function_entry_name">
8403 _asn1_time_der
8404 </td>
8405 <td class="function_entry_cyclo">
8406 4
8407 </td>
8408 <td class="function_entry_number">
8409 11
8410 </td>
8411 <td class="function_entry_number">
8412 19
8413 </td>
8414 <td class="function_entry_filename">
8415 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/coding.c;hb=HEAD">lib/coding.c</a>
8416 </td>
8417 </tr>
8418 <tr class="function_entry_simple">
8419 <td class="function_entry_filename">
8420 &nbsp;
8421 </td>
8422 <td class="function_entry_name">
8423 yy_symbol_value_print
8424 </td>
8425 <td class="function_entry_cyclo">
8426 3
8427 </td>
8428 <td class="function_entry_number">
8429 6
8430 </td>
8431 <td class="function_entry_number">
8432 24
8433 </td>
8434 <td class="function_entry_filename">
8435 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/ASN1.c;hb=HEAD">lib/ASN1.c</a>
8436 </td>
8437 </tr>
8438 <tr class="function_entry_simple">
8439 <td class="function_entry_filename">
8440 &nbsp;
8441 </td>
8442 <td class="function_entry_name">
8443 asn1_get_length_ber
8444 </td>
8445 <td class="function_entry_cyclo">
8446 3
8447 </td>
8448 <td class="function_entry_number">
8449 9
8450 </td>
8451 <td class="function_entry_number">
8452 17
8453 </td>
8454 <td class="function_entry_filename">
8455 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/decoding.c;hb=HEAD">lib/decoding.c</a>
8456 </td>
8457 </tr>
8458 <tr class="function_entry_simple">
8459 <td class="function_entry_filename">
8460 &nbsp;
8461 </td>
8462 <td class="function_entry_name">
8463 asn1_strerror
8464 </td>
8465 <td class="function_entry_cyclo">
8466 3
8467 </td>
8468 <td class="function_entry_number">
8469 7
8470 </td>
8471 <td class="function_entry_number">
8472 11
8473 </td>
8474 <td class="function_entry_filename">
8475 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/errors.c;hb=HEAD">lib/errors.c</a>
8476 </td>
8477 </tr>
8478 <tr class="function_entry_simple">
8479 <td class="function_entry_filename">
8480 &nbsp;
8481 </td>
8482 <td class="function_entry_name">
8483 _asn1_get_last_right
8484 </td>
8485 <td class="function_entry_cyclo">
8486 3
8487 </td>
8488 <td class="function_entry_number">
8489 7
8490 </td>
8491 <td class="function_entry_number">
8492 12
8493 </td>
8494 <td class="function_entry_filename">
8495 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
8496 </td>
8497 </tr>
8498 <tr class="function_entry_simple">
8499 <td class="function_entry_filename">
8500 &nbsp;
8501 </td>
8502 <td class="function_entry_name">
8503 _asn1_str_cat
8504 </td>
8505 <td class="function_entry_cyclo">
8506 3
8507 </td>
8508 <td class="function_entry_number">
8509 7
8510 </td>
8511 <td class="function_entry_number">
8512 19
8513 </td>
8514 <td class="function_entry_filename">
8515 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/gstr.c;hb=HEAD">lib/gstr.c</a>
8516 </td>
8517 </tr>
8518 <tr class="function_entry_simple">
8519 <td class="function_entry_filename">
8520 &nbsp;
8521 </td>
8522 <td class="function_entry_name">
8523 _asn1_str_cpy
8524 </td>
8525 <td class="function_entry_cyclo">
8526 3
8527 </td>
8528 <td class="function_entry_number">
8529 6
8530 </td>
8531 <td class="function_entry_number">
8532 18
8533 </td>
8534 <td class="function_entry_filename">
8535 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/gstr.c;hb=HEAD">lib/gstr.c</a>
8536 </td>
8537 </tr>
8538 <tr class="function_entry_simple">
8539 <td class="function_entry_filename">
8540 &nbsp;
8541 </td>
8542 <td class="function_entry_name">
8543 _asn1_set_down
8544 </td>
8545 <td class="function_entry_cyclo">
8546 3
8547 </td>
8548 <td class="function_entry_number">
8549 6
8550 </td>
8551 <td class="function_entry_number">
8552 10
8553 </td>
8554 <td class="function_entry_filename">
8555 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
8556 </td>
8557 </tr>
8558 <tr class="function_entry_simple">
8559 <td class="function_entry_filename">
8560 &nbsp;
8561 </td>
8562 <td class="function_entry_name">
8563 _asn1_set_right
8564 </td>
8565 <td class="function_entry_cyclo">
8566 3
8567 </td>
8568 <td class="function_entry_number">
8569 6
8570 </td>
8571 <td class="function_entry_number">
8572 10
8573 </td>
8574 <td class="function_entry_filename">
8575 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
8576 </td>
8577 </tr>
8578 <tr class="function_entry_simple">
8579 <td class="function_entry_filename">
8580 &nbsp;
8581 </td>
8582 <td class="function_entry_name">
8583 asn1_octet_der
8584 </td>
8585 <td class="function_entry_cyclo">
8586 3
8587 </td>
8588 <td class="function_entry_number">
8589 6
8590 </td>
8591 <td class="function_entry_number">
8592 12
8593 </td>
8594 <td class="function_entry_filename">
8595 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/coding.c;hb=HEAD">lib/coding.c</a>
8596 </td>
8597 </tr>
8598 <tr class="function_entry_simple">
8599 <td class="function_entry_filename">
8600 &nbsp;
8601 </td>
8602 <td class="function_entry_name">
8603 asn1_check_version
8604 </td>
8605 <td class="function_entry_cyclo">
8606 3
8607 </td>
8608 <td class="function_entry_number">
8609 3
8610 </td>
8611 <td class="function_entry_number">
8612 8
8613 </td>
8614 <td class="function_entry_filename">
8615 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/version.c;hb=HEAD">lib/version.c</a>
8616 </td>
8617 </tr>
8618 <tr class="function_entry_simple">
8619 <td class="function_entry_filename">
8620 &nbsp;
8621 </td>
8622 <td class="function_entry_name">
8623 _asn1_add_node
8624 </td>
8625 <td class="function_entry_cyclo">
8626 3
8627 </td>
8628 <td class="function_entry_number">
8629 14
8630 </td>
8631 <td class="function_entry_number">
8632 25
8633 </td>
8634 <td class="function_entry_filename">
8635 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
8636 </td>
8637 </tr>
8638 <tr class="function_entry_simple">
8639 <td class="function_entry_filename">
8640 &nbsp;
8641 </td>
8642 <td class="function_entry_name">
8643 asn1_bit_der
8644 </td>
8645 <td class="function_entry_cyclo">
8646 3
8647 </td>
8648 <td class="function_entry_number">
8649 13
8650 </td>
8651 <td class="function_entry_number">
8652 20
8653 </td>
8654 <td class="function_entry_filename">
8655 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/coding.c;hb=HEAD">lib/coding.c</a>
8656 </td>
8657 </tr>
8658 <tr class="function_entry_simple">
8659 <td class="function_entry_filename">
8660 &nbsp;
8661 </td>
8662 <td class="function_entry_name">
8663 _asn1_set_value_octet
8664 </td>
8665 <td class="function_entry_cyclo">
8666 3
8667 </td>
8668 <td class="function_entry_number">
8669 10
8670 </td>
8671 <td class="function_entry_number">
8672 17
8673 </td>
8674 <td class="function_entry_filename">
8675 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
8676 </td>
8677 </tr>
8678 <tr class="function_entry_simple">
8679 <td class="function_entry_filename">
8680 &nbsp;
8681 </td>
8682 <td class="function_entry_name">
8683 yydestruct
8684 </td>
8685 <td class="function_entry_cyclo">
8686 2
8687 </td>
8688 <td class="function_entry_number">
8689 5
8690 </td>
8691 <td class="function_entry_number">
8692 32
8693 </td>
8694 <td class="function_entry_filename">
8695 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/ASN1.c;hb=HEAD">lib/ASN1.c</a>
8696 </td>
8697 </tr>
8698 <tr class="function_entry_simple">
8699 <td class="function_entry_filename">
8700 &nbsp;
8701 </td>
8702 <td class="function_entry_name">
8703 yy_stack_print
8704 </td>
8705 <td class="function_entry_cyclo">
8706 2
8707 </td>
8708 <td class="function_entry_number">
8709 7
8710 </td>
8711 <td class="function_entry_number">
8712 17
8713 </td>
8714 <td class="function_entry_filename">
8715 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/ASN1.c;hb=HEAD">lib/ASN1.c</a>
8716 </td>
8717 </tr>
8718 <tr class="function_entry_simple">
8719 <td class="function_entry_filename">
8720 &nbsp;
8721 </td>
8722 <td class="function_entry_name">
8723 _asn1_delete_list_and_nodes
8724 </td>
8725 <td class="function_entry_cyclo">
8726 2
8727 </td>
8728 <td class="function_entry_number">
8729 6
8730 </td>
8731 <td class="function_entry_number">
8732 13
8733 </td>
8734 <td class="function_entry_filename">
8735 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
8736 </td>
8737 </tr>
8738 <tr class="function_entry_simple">
8739 <td class="function_entry_filename">
8740 &nbsp;
8741 </td>
8742 <td class="function_entry_name">
8743 _asn1_add_node_only
8744 </td>
8745 <td class="function_entry_cyclo">
8746 2
8747 </td>
8748 <td class="function_entry_number">
8749 6
8750 </td>
8751 <td class="function_entry_number">
8752 13
8753 </td>
8754 <td class="function_entry_filename">
8755 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/structure.c;hb=HEAD">lib/structure.c</a>
8756 </td>
8757 </tr>
8758 <tr class="function_entry_simple">
8759 <td class="function_entry_filename">
8760 &nbsp;
8761 </td>
8762 <td class="function_entry_name">
8763 yystrlen
8764 </td>
8765 <td class="function_entry_cyclo">
8766 2
8767 </td>
8768 <td class="function_entry_number">
8769 6
8770 </td>
8771 <td class="function_entry_number">
8772 24
8773 </td>
8774 <td class="function_entry_filename">
8775 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/ASN1.c;hb=HEAD">lib/ASN1.c</a>
8776 </td>
8777 </tr>
8778 <tr class="function_entry_simple">
8779 <td class="function_entry_filename">
8780 &nbsp;
8781 </td>
8782 <td class="function_entry_name">
8783 yy_symbol_print
8784 </td>
8785 <td class="function_entry_cyclo">
8786 2
8787 </td>
8788 <td class="function_entry_number">
8789 5
8790 </td>
8791 <td class="function_entry_number">
8792 18
8793 </td>
8794 <td class="function_entry_filename">
8795 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/ASN1.c;hb=HEAD">lib/ASN1.c</a>
8796 </td>
8797 </tr>
8798 <tr class="function_entry_simple">
8799 <td class="function_entry_filename">
8800 &nbsp;
8801 </td>
8802 <td class="function_entry_name">
8803 _asn1_delete_list
8804 </td>
8805 <td class="function_entry_cyclo">
8806 2
8807 </td>
8808 <td class="function_entry_number">
8809 5
8810 </td>
8811 <td class="function_entry_number">
8812 12
8813 </td>
8814 <td class="function_entry_filename">
8815 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
8816 </td>
8817 </tr>
8818 <tr class="function_entry_simple">
8819 <td class="function_entry_filename">
8820 &nbsp;
8821 </td>
8822 <td class="function_entry_name">
8823 _asn1_error_description_value_not_found
8824 </td>
8825 <td class="function_entry_cyclo">
8826 2
8827 </td>
8828 <td class="function_entry_number">
8829 5
8830 </td>
8831 <td class="function_entry_number">
8832 14
8833 </td>
8834 <td class="function_entry_filename">
8835 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/coding.c;hb=HEAD">lib/coding.c</a>
8836 </td>
8837 </tr>
8838 <tr class="function_entry_simple">
8839 <td class="function_entry_filename">
8840 &nbsp;
8841 </td>
8842 <td class="function_entry_name">
8843 yystpcpy
8844 </td>
8845 <td class="function_entry_cyclo">
8846 2
8847 </td>
8848 <td class="function_entry_number">
8849 5
8850 </td>
8851 <td class="function_entry_number">
8852 17
8853 </td>
8854 <td class="function_entry_filename">
8855 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/ASN1.c;hb=HEAD">lib/ASN1.c</a>
8856 </td>
8857 </tr>
8858 <tr class="function_entry_simple">
8859 <td class="function_entry_filename">
8860 &nbsp;
8861 </td>
8862 <td class="function_entry_name">
8863 _asn1_mod_type
8864 </td>
8865 <td class="function_entry_cyclo">
8866 2
8867 </td>
8868 <td class="function_entry_number">
8869 4
8870 </td>
8871 <td class="function_entry_number">
8872 8
8873 </td>
8874 <td class="function_entry_filename">
8875 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
8876 </td>
8877 </tr>
8878 <tr class="function_entry_simple">
8879 <td class="function_entry_filename">
8880 &nbsp;
8881 </td>
8882 <td class="function_entry_name">
8883 _asn1_yyerror
8884 </td>
8885 <td class="function_entry_cyclo">
8886 2
8887 </td>
8888 <td class="function_entry_number">
8889 4
8890 </td>
8891 <td class="function_entry_number">
8892 14
8893 </td>
8894 <td class="function_entry_filename">
8895 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/ASN1.c;hb=HEAD">lib/ASN1.c</a>
8896 </td>
8897 </tr>
8898 <tr class="function_entry_simple">
8899 <td class="function_entry_filename">
8900 &nbsp;
8901 </td>
8902 <td class="function_entry_name">
8903 asn1_perror
8904 </td>
8905 <td class="function_entry_cyclo">
8906 2
8907 </td>
8908 <td class="function_entry_number">
8909 3
8910 </td>
8911 <td class="function_entry_number">
8912 6
8913 </td>
8914 <td class="function_entry_filename">
8915 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/errors.c;hb=HEAD">lib/errors.c</a>
8916 </td>
8917 </tr>
8918 <tr class="function_entry_simple">
8919 <td class="function_entry_filename">
8920 &nbsp;
8921 </td>
8922 <td class="function_entry_name">
8923 _asn1_get_name
8924 </td>
8925 <td class="function_entry_cyclo">
8926 2
8927 </td>
8928 <td class="function_entry_number">
8929 3
8930 </td>
8931 <td class="function_entry_number">
8932 7
8933 </td>
8934 <td class="function_entry_filename">
8935 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
8936 </td>
8937 </tr>
8938 <tr class="function_entry_simple">
8939 <td class="function_entry_filename">
8940 &nbsp;
8941 </td>
8942 <td class="function_entry_name">
8943 _asn1_get_down
8944 </td>
8945 <td class="function_entry_cyclo">
8946 2
8947 </td>
8948 <td class="function_entry_number">
8949 3
8950 </td>
8951 <td class="function_entry_number">
8952 7
8953 </td>
8954 <td class="function_entry_filename">
8955 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
8956 </td>
8957 </tr>
8958 <tr class="function_entry_simple">
8959 <td class="function_entry_filename">
8960 &nbsp;
8961 </td>
8962 <td class="function_entry_name">
8963 _asn1_get_right
8964 </td>
8965 <td class="function_entry_cyclo">
8966 2
8967 </td>
8968 <td class="function_entry_number">
8969 3
8970 </td>
8971 <td class="function_entry_number">
8972 7
8973 </td>
8974 <td class="function_entry_filename">
8975 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/parser_aux.c;hb=HEAD">lib/parser_aux.c</a>
8976 </td>
8977 </tr>
8978 <tr class="function_entry_simple">
8979 <td class="function_entry_filename">
8980 &nbsp;
8981 </td>
8982 <td class="function_entry_name">
8983 asn1_create_element
8984 </td>
8985 <td class="function_entry_cyclo">
8986 2
8987 </td>
8988 <td class="function_entry_number">
8989 10
8990 </td>
8991 <td class="function_entry_number">
8992 21
8993 </td>
8994 <td class="function_entry_filename">
8995 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/structure.c;hb=HEAD">lib/structure.c</a>
8996 </td>
8997 </tr>
8998 <tr class="function_entry_simple">
8999 <td class="function_entry_filename">
9000 &nbsp;
9001 </td>
9002 <td class="function_entry_name">
9003 yy_reduce_print
9004 </td>
9005 <td class="function_entry_cyclo">
9006 2
9007 </td>
9008 <td class="function_entry_number">
9009 10
9010 </td>
9011 <td class="function_entry_number">
9012 24
9013 </td>
9014 <td class="function_entry_filename">
9015 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/ASN1.c;hb=HEAD">lib/ASN1.c</a>
9016 </td>
9017 </tr>
9018 <tr class="function_entry_simple">
9019 <td class="function_entry_filename">
9020 &nbsp;
9021 </td>
9022 <td class="function_entry_name">
9023 _asn1_copy_structure2
9024 </td>
9025 <td class="function_entry_cyclo">
9026 1
9027 </td>
9028 <td class="function_entry_number">
9029 3
9030 </td>
9031 <td class="function_entry_number">
9032 10
9033 </td>
9034 <td class="function_entry_filename">
9035 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/structure.c;hb=HEAD">lib/structure.c</a>
9036 </td>
9037 </tr>
9038 <tr class="function_entry_simple">
9039 <td class="function_entry_filename">
9040 &nbsp;
9041 </td>
9042 <td class="function_entry_name">
9043 _asn1_error_description_tag_error
9044 </td>
9045 <td class="function_entry_cyclo">
9046 1
9047 </td>
9048 <td class="function_entry_number">
9049 3
9050 </td>
9051 <td class="function_entry_number">
9052 10
9053 </td>
9054 <td class="function_entry_filename">
9055 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/decoding.c;hb=HEAD">lib/decoding.c</a>
9056 </td>
9057 </tr>
9058 <tr class="function_entry_simple">
9059 <td class="function_entry_filename">
9060 &nbsp;
9061 </td>
9062 <td class="function_entry_name">
9063 YYID
9064 </td>
9065 <td class="function_entry_cyclo">
9066 1
9067 </td>
9068 <td class="function_entry_number">
9069 1
9070 </td>
9071 <td class="function_entry_number">
9072 10
9073 </td>
9074 <td class="function_entry_filename">
9075 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/ASN1.c;hb=HEAD">lib/ASN1.c</a>
9076 </td>
9077 </tr>
9078 <tr class="function_entry_simple">
9079 <td class="function_entry_filename">
9080 &nbsp;
9081 </td>
9082 <td class="function_entry_name">
9083 libtasn1_strerror
9084 </td>
9085 <td class="function_entry_cyclo">
9086 1
9087 </td>
9088 <td class="function_entry_number">
9089 1
9090 </td>
9091 <td class="function_entry_number">
9092 5
9093 </td>
9094 <td class="function_entry_filename">
9095 <a href="http://git.savannah.gnu.org/gitweb/?p=libtasn1.git;a=blob;f=lib/errors.c;hb=HEAD">lib/errors.c</a>
9096 </td>
9097 </tr>
9098 </table>
9099 <hr color="black" size="2"/> Copyright (c) 2007, 2008 Free Software Foundation, Inc.
9100 </body>
9101 </html>