1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
3 <!-- Generated by gnulib's pmccabe2html at 1274360673 -->
5 <title>Cyclomatic Complexity report for GNU Libtasn1</title>
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 = "↑"; } else { capa.style.display = "none"; button.innerHTML = "↓"; } } }}
16 <style type ="text/css" media="screen">
20 font-family: Helvetica, sans-serif;
26 font: 18pt Georgia, serif;
30 border-bottom: 2px solid darkred;
35 font: 14pt Georgia, serif;
37 border-bottom: 2px dashed darkred;
57 .resume_header_entry {
62 .resume_number_entry {
72 border-bottom: solid 2px black;
73 border-top: solid 2px black;
74 border-left: solid 2px black;
75 border-right: solid 2px black;
78 .ranges_header_entry {
81 border-bottom: solid 1px black;
92 .ranges_entry_simple {
98 .ranges_entry_moderate {
110 .ranges_entry_untestable {
120 border-bottom: solid 2px black;
121 border-top: solid 2px black;
122 border-left: solid 2px black;
123 border-right: solid 2px black;
126 .function_table_caption {
134 .function_table_header {
139 .function_table_header_entry {
142 border-bottom: solid 1px black;
155 .function_entry_simple {
161 .function_entry_moderate {
167 .function_entry_high {
173 .function_entry_untestable {
180 .function_entry_name {
187 border-top: solid 1px black;
191 .function_entry_cyclo {
197 border-top: solid 1px black;
201 .function_entry_number {
207 border-top: solid 1px black;
211 .function_entry_filename {
217 border-top: solid 1px black;
223 border: 1px black solid;
233 border-bottom: 1px dashed darkred;
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>
254 <table class="resume_table">
256 <td class="resume_header_entry">
257 Total number of functions
259 <td class="resume_number_entry">
264 <td class="resume_header_entry">
265 Number of low risk functions
267 <td class="resume_number_entry">
272 <td class="resume_header_entry">
273 Number of moderate risk functions
275 <td class="resume_number_entry">
280 <td class="resume_header_entry">
281 Number of high risk functions
283 <td class="resume_number_entry">
288 <td class="resume_header_entry">
289 Number of untestable functions
291 <td class="resume_number_entry">
297 <div class="section_title">Details for all functions</div>
299 <table class="ranges_table">
301 <td class="ranges_header_entry">
304 <td class="ranges_header_entry">
305 Cyclomatic Complexity
307 <td class="ranges_header_entry">
312 <td class="ranges_entry_simple">
315 <td class="ranges_entry">
318 <td class="ranges_entry">
319 Simple module, without much risk
323 <td class="ranges_entry_moderate">
326 <td class="ranges_entry">
329 <td class="ranges_entry">
330 More complex module, moderate risk
334 <td class="ranges_entry_high">
337 <td class="ranges_entry">
340 <td class="ranges_entry">
341 Complex module, high risk
345 <td class="ranges_entry_untestable">
348 <td class="ranges_entry">
351 <td class="ranges_entry">
352 Untestable module, very high risk
357 <table width="90%" class="function_table" cellpadding="0" cellspacing="0">
358 <tr class="function_table_header">
359 <td class="function_table_header_entry">
362 <td class="function_table_header_entry">
365 <td class="function_table_header_entry">
370 <td class="function_table_header_entry">
375 <td class="function_table_header_entry">
380 <td class="function_table_header_entry">
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">↓</span></a>
388 <td class="function_entry_name">
389 asn1_der_decoding_element
391 <td class="function_entry_cyclo">
394 <td class="function_entry_number">
397 <td class="function_entry_number">
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>
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">
409 asn1_der_decoding_element (ASN1_TYPE * structure, const char *elementName,
410 const void *ider, int len, char *errorDescription)
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;
418 int indefinite, result;
419 const unsigned char *der = ider;
423 if (node == ASN1_TYPE_EMPTY)
424 return ASN1_ELEMENT_NOT_FOUND;
426 if (elementName == NULL)
428 asn1_delete_structure (structure);
429 return ASN1_ELEMENT_NOT_FOUND;
432 if (node->type & CONST_OPTION)
434 asn1_delete_structure (structure);
435 return ASN1_GENERIC_ERROR;
438 if ((*structure)->name)
439 { /* Has *structure got a name? */
440 nameLen -= strlen ((*structure)->name);
442 strcpy (currentName, (*structure)->name);
445 asn1_delete_structure (structure);
446 return ASN1_MEM_ERROR;
448 if (!(strcmp (currentName, elementName)))
451 nodeFound = *structure;
453 else if (!memcmp (currentName, elementName, strlen (currentName)))
456 state = OTHER_BRANCH;
459 { /* *structure doesn't have a name? */
461 if (elementName[0] == 0)
464 nodeFound = *structure;
482 if (p->type & CONST_SET)
484 p2 = _asn1_find_up (p);
485 len2 = strtol (p2->value, NULL, 10);
492 else if (counter > len2)
494 asn1_delete_structure (structure);
495 return ASN1_DER_ERROR;
500 if ((p2->type & CONST_SET) && (p2->type & CONST_NOT_USED))
502 if (type_field (p2->type) != TYPE_CHOICE)
504 _asn1_extract_tag_der (p2, der + counter,
505 len - counter, &len2);
512 _asn1_extract_tag_der (p3, der + counter,
513 len - counter, &len2);
514 if (ris == ASN1_SUCCESS)
519 if (ris == ASN1_SUCCESS)
521 p2->type &= ~CONST_NOT_USED;
530 asn1_delete_structure (structure);
531 return ASN1_DER_ERROR;
535 if ((p->type & CONST_OPTION) || (p->type & CONST_DEFAULT))
537 p2 = _asn1_find_up (p);
538 len2 = strtol (p2->value, NULL, 10);
549 if (p->type & CONST_OPTION)
550 asn1_delete_structure (&p);
557 if (type_field (p->type) == TYPE_CHOICE)
563 _asn1_extract_tag_der (p->down, der + counter,
564 len - counter, &len2);
566 ris = ASN1_DER_ERROR;
567 if (ris == ASN1_SUCCESS)
569 while (p->down->right)
572 asn1_delete_structure (&p2);
576 else if (ris == ASN1_ERROR_TYPE_ANY)
578 asn1_delete_structure (structure);
579 return ASN1_ERROR_TYPE_ANY;
584 asn1_delete_structure (&p2);
590 if (!(p->type & CONST_OPTION))
592 asn1_delete_structure (structure);
593 return ASN1_DER_ERROR;
600 if ((p->type & CONST_OPTION) || (p->type & CONST_DEFAULT))
602 p2 = _asn1_find_up (p);
603 len2 = strtol (p2->value, NULL, 10);
605 ris = ASN1_TAG_ERROR;
608 if (ris == ASN1_SUCCESS)
610 _asn1_extract_tag_der (p, der + counter, len - counter, &len2);
611 if (ris != ASN1_SUCCESS)
613 if (p->type & CONST_OPTION)
615 p->type |= CONST_NOT_USED;
618 else if (p->type & CONST_DEFAULT)
620 _asn1_set_value (p, NULL, 0);
625 if (errorDescription != NULL)
626 _asn1_error_description_tag_error (p, errorDescription);
628 asn1_delete_structure (structure);
629 return ASN1_TAG_ERROR;
636 if (ris == ASN1_SUCCESS)
638 switch (type_field (p->type))
643 asn1_delete_structure (structure);
644 return ASN1_DER_ERROR;
654 if (der[counter++] != 1)
656 asn1_delete_structure (structure);
657 return ASN1_DER_ERROR;
662 if (der[counter++] == 0)
663 _asn1_set_value (p, "F", 1);
665 _asn1_set_value (p, "T", 1);
677 case TYPE_ENUMERATED:
679 asn1_get_length_der (der + counter, len - counter, &len3);
681 return ASN1_DER_ERROR;
684 if (len3 + len2 > len - counter)
685 return ASN1_DER_ERROR;
686 _asn1_set_value (p, der + counter, len3 + len2);
691 counter += len3 + len2;
698 _asn1_get_objectid_der (der + counter, len - counter,
699 &len2, temp, sizeof (temp));
700 if (result != ASN1_SUCCESS)
705 tlen = strlen (temp);
708 _asn1_set_value (p, temp, tlen + 1);
716 asn1_get_length_der (der + counter, len - counter, &len3);
718 return ASN1_DER_ERROR;
729 _asn1_get_time_der (der + counter, len - counter, &len2,
730 temp, sizeof (temp) - 1);
731 if (result != ASN1_SUCCESS)
733 asn1_delete_structure (structure);
737 tlen = strlen (temp);
739 _asn1_set_value (p, temp, tlen + 1);
747 asn1_get_length_der (der + counter, len - counter, &len3);
749 return ASN1_DER_ERROR;
756 case TYPE_OCTET_STRING:
757 len3 = len - counter;
760 ris = _asn1_get_octet_string (der + counter, p, &len3);
765 ris = _asn1_get_octet_string (der + counter, NULL, &len3);
767 if (ris != ASN1_SUCCESS)
772 case TYPE_GENERALSTRING:
774 asn1_get_length_der (der + counter, len - counter, &len3);
776 return ASN1_DER_ERROR;
779 if (len3 + len2 > len - counter)
780 return ASN1_DER_ERROR;
781 _asn1_set_value (p, der + counter, len3 + len2);
786 counter += len3 + len2;
789 case TYPE_BIT_STRING:
791 asn1_get_length_der (der + counter, len - counter, &len3);
793 return ASN1_DER_ERROR;
796 if (len3 + len2 > len - counter)
797 return ASN1_DER_ERROR;
798 _asn1_set_value (p, der + counter, len3 + len2);
803 counter += len3 + len2;
810 len2 = strtol (p->value, NULL, 10);
811 _asn1_set_value (p, NULL, 0);
813 { /* indefinite length method */
814 if ((der[counter]) || der[counter + 1])
816 asn1_delete_structure (structure);
817 return ASN1_DER_ERROR;
822 { /* definite length method */
825 asn1_delete_structure (structure);
826 return ASN1_DER_ERROR;
834 { /* move==DOWN || move==RIGHT */
835 if (state == OTHER_BRANCH)
838 asn1_get_length_der (der + counter, len - counter,
841 return ASN1_DER_ERROR;
842 counter += len2 + len3;
846 { /* state==SAME_BRANCH or state==FOUND */
848 asn1_get_length_der (der + counter, len - counter,
851 return ASN1_DER_ERROR;
855 _asn1_ltostr (counter + len3, temp);
856 tlen = strlen (temp);
859 _asn1_set_value (p, temp, tlen + 1);
867 if (type_field (p2->type) != TYPE_TAG)
870 asn1_delete_structure (&p2);
879 { /* indefinite length method */
880 _asn1_set_value (p, "-1", 3);
886 case TYPE_SEQUENCE_OF:
890 len2 = strtol (p->value, NULL, 10);
893 _asn1_append_sequence_set (p);
900 _asn1_set_value (p, NULL, 0);
903 asn1_delete_structure (structure);
904 return ASN1_DER_ERROR;
911 { /* move==DOWN || move==RIGHT */
912 if (state == OTHER_BRANCH)
915 asn1_get_length_der (der + counter, len - counter,
918 return ASN1_DER_ERROR;
919 counter += len2 + len3;
923 { /* state==FOUND or state==SAME_BRANCH */
925 asn1_get_length_der (der + counter, len - counter,
928 return ASN1_DER_ERROR;
932 _asn1_ltostr (counter + len3, temp);
933 tlen = strlen (temp);
936 _asn1_set_value (p, temp, tlen + 1);
938 while ((type_field (p2->type) == TYPE_TAG)
939 || (type_field (p2->type) == TYPE_SIZE))
941 if (p2->right == NULL)
942 _asn1_append_sequence_set (p);
952 (der + counter, len - counter, &class, &len2,
953 &tag) != ASN1_SUCCESS)
954 return ASN1_DER_ERROR;
955 if (counter + len2 > len)
956 return ASN1_DER_ERROR;
959 asn1_get_length_der (der + counter + len2,
960 len - counter - len2, &len3);
962 return ASN1_DER_ERROR;
969 _asn1_set_value_octet (p, der + counter, len2 + len3);
975 counter += len2 + len3;
978 { /* indefinite length */
979 /* Check indefinite lenth method in an EXPLICIT TAG */
980 if ((p->type & CONST_TAG) && (der[counter - 1] == 0x80))
985 len2 = len - counter;
987 _asn1_get_indefinite_length_string (der + counter, &len2);
988 if (ris != ASN1_SUCCESS)
990 asn1_delete_structure (structure);
996 _asn1_set_value_octet (p, der + counter, len2);
1004 /* Check if a couple of 0x00 are present due to an EXPLICIT TAG with
1005 an indefinite length method. */
1008 if (!der[counter] && !der[counter + 1])
1014 asn1_delete_structure (structure);
1015 return ASN1_DER_ERROR;
1023 move = (move == UP) ? RIGHT : DOWN;
1028 if ((p == node && move != DOWN) || (state == EXIT))
1039 nameLen -= strlen (p->name) + 1;
1043 strcat (currentName, ".");
1044 strcat (currentName, p->name);
1048 asn1_delete_structure (structure);
1049 return ASN1_MEM_ERROR;
1051 if (!(strcmp (currentName, elementName)))
1058 (currentName, elementName, strlen (currentName)))
1059 state = SAME_BRANCH;
1061 state = OTHER_BRANCH;
1068 if ((move == RIGHT) && !(p->type & CONST_SET))
1076 dot_p = char_p = currentName;
1077 while ((char_p = strchr (char_p, '.')))
1083 nameLen += strlen (currentName) - (dot_p - currentName);
1086 nameLen -= strlen (p->name);
1088 strcat (currentName, p->name);
1091 asn1_delete_structure (structure);
1092 return ASN1_MEM_ERROR;
1095 if (!(strcmp (currentName, elementName)))
1102 (currentName, elementName, strlen (currentName)))
1103 state = SAME_BRANCH;
1105 state = OTHER_BRANCH;
1114 p = _asn1_find_up (p);
1118 dot_p = char_p = currentName;
1119 while ((char_p = strchr (char_p, '.')))
1125 nameLen += strlen (currentName) - (dot_p - currentName);
1128 if (!(strcmp (currentName, elementName)))
1134 if (!memcmp (currentName, elementName, strlen (currentName)))
1135 state = SAME_BRANCH;
1137 state = OTHER_BRANCH;
1142 _asn1_delete_not_used (*structure);
1146 asn1_delete_structure (structure);
1147 return ASN1_DER_ERROR;
1150 return ASN1_SUCCESS;
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">↓</span></a>
1160 <td class="function_entry_name">
1163 <td class="function_entry_cyclo">
1166 <td class="function_entry_number">
1169 <td class="function_entry_number">
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>
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">
1181 asn1_der_decoding (ASN1_TYPE * element, const void *ider, int len,
1182 char *errorDescription)
1184 ASN1_TYPE node, p, p2, p3;
1186 int counter, len2, len3, len4, move, ris, tlen;
1187 unsigned char class;
1189 int indefinite, result;
1190 const unsigned char *der = ider;
1194 if (node == ASN1_TYPE_EMPTY)
1195 return ASN1_ELEMENT_NOT_FOUND;
1197 if (node->type & CONST_OPTION)
1199 asn1_delete_structure (element);
1200 return ASN1_GENERIC_ERROR;
1211 if (p->type & CONST_SET)
1213 p2 = _asn1_find_up (p);
1214 len2 = strtol (p2->value, NULL, 10);
1217 if (!der[counter] && !der[counter + 1])
1225 else if (counter == len2)
1231 else if (counter > len2)
1233 asn1_delete_structure (element);
1234 return ASN1_DER_ERROR;
1239 if ((p2->type & CONST_SET) && (p2->type & CONST_NOT_USED))
1241 if (type_field (p2->type) != TYPE_CHOICE)
1243 _asn1_extract_tag_der (p2, der + counter,
1244 len - counter, &len2);
1251 _asn1_extract_tag_der (p3, der + counter,
1252 len - counter, &len2);
1253 if (ris == ASN1_SUCCESS)
1258 if (ris == ASN1_SUCCESS)
1260 p2->type &= ~CONST_NOT_USED;
1269 asn1_delete_structure (element);
1270 return ASN1_DER_ERROR;
1274 if ((p->type & CONST_OPTION) || (p->type & CONST_DEFAULT))
1276 p2 = _asn1_find_up (p);
1277 len2 = strtol (p2->value, NULL, 10);
1278 if (counter == len2)
1288 if (p->type & CONST_OPTION)
1289 asn1_delete_structure (&p);
1296 if (type_field (p->type) == TYPE_CHOICE)
1302 _asn1_extract_tag_der (p->down, der + counter,
1303 len - counter, &len2);
1305 ris = ASN1_DER_ERROR;
1306 if (ris == ASN1_SUCCESS)
1308 while (p->down->right)
1310 p2 = p->down->right;
1311 asn1_delete_structure (&p2);
1315 else if (ris == ASN1_ERROR_TYPE_ANY)
1317 asn1_delete_structure (element);
1318 return ASN1_ERROR_TYPE_ANY;
1323 asn1_delete_structure (&p2);
1327 if (p->down == NULL)
1329 if (!(p->type & CONST_OPTION))
1331 asn1_delete_structure (element);
1332 return ASN1_DER_ERROR;
1339 if ((p->type & CONST_OPTION) || (p->type & CONST_DEFAULT))
1341 p2 = _asn1_find_up (p);
1342 len2 = strtol (p2->value, NULL, 10);
1343 if ((len2 != -1) && (counter > len2))
1344 ris = ASN1_TAG_ERROR;
1347 if (ris == ASN1_SUCCESS)
1349 _asn1_extract_tag_der (p, der + counter, len - counter, &len2);
1350 if (ris != ASN1_SUCCESS)
1352 if (p->type & CONST_OPTION)
1354 p->type |= CONST_NOT_USED;
1357 else if (p->type & CONST_DEFAULT)
1359 _asn1_set_value (p, NULL, 0);
1364 if (errorDescription != NULL)
1365 _asn1_error_description_tag_error (p, errorDescription);
1367 asn1_delete_structure (element);
1368 return ASN1_TAG_ERROR;
1375 if (ris == ASN1_SUCCESS)
1377 switch (type_field (p->type))
1382 asn1_delete_structure (element);
1383 return ASN1_DER_ERROR;
1389 if (der[counter++] != 1)
1391 asn1_delete_structure (element);
1392 return ASN1_DER_ERROR;
1394 if (der[counter++] == 0)
1395 _asn1_set_value (p, "F", 1);
1397 _asn1_set_value (p, "T", 1);
1401 case TYPE_ENUMERATED:
1403 asn1_get_length_der (der + counter, len - counter, &len3);
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;
1412 case TYPE_OBJECT_ID:
1414 _asn1_get_objectid_der (der + counter, len - counter, &len2,
1415 temp, sizeof (temp));
1416 if (result != ASN1_SUCCESS)
1418 asn1_delete_structure (element);
1422 tlen = strlen (temp);
1424 _asn1_set_value (p, temp, tlen + 1);
1430 _asn1_get_time_der (der + counter, len - counter, &len2, temp,
1432 if (result != ASN1_SUCCESS)
1434 asn1_delete_structure (element);
1437 tlen = strlen (temp);
1439 _asn1_set_value (p, temp, tlen + 1);
1443 case TYPE_OCTET_STRING:
1444 len3 = len - counter;
1445 ris = _asn1_get_octet_string (der + counter, p, &len3);
1446 if (ris != ASN1_SUCCESS)
1451 case TYPE_GENERALSTRING:
1453 asn1_get_length_der (der + counter, len - counter, &len3);
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;
1462 case TYPE_BIT_STRING:
1464 asn1_get_length_der (der + counter, len - counter, &len3);
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;
1477 len2 = strtol (p->value, NULL, 10);
1478 _asn1_set_value (p, NULL, 0);
1480 { /* indefinite length method */
1481 if (len - counter + 1 > 0)
1483 if ((der[counter]) || der[counter + 1])
1485 asn1_delete_structure (element);
1486 return ASN1_DER_ERROR;
1490 return ASN1_DER_ERROR;
1494 { /* definite length method */
1495 if (len2 != counter)
1497 asn1_delete_structure (element);
1498 return ASN1_DER_ERROR;
1504 { /* move==DOWN || move==RIGHT */
1506 asn1_get_length_der (der + counter, len - counter, &len2);
1508 return ASN1_DER_ERROR;
1512 _asn1_ltostr (counter + len3, temp);
1513 tlen = strlen (temp);
1515 _asn1_set_value (p, temp, tlen + 1);
1523 if (type_field (p2->type) != TYPE_TAG)
1526 asn1_delete_structure (&p2);
1535 { /* indefinite length method */
1536 _asn1_set_value (p, "-1", 3);
1541 case TYPE_SEQUENCE_OF:
1545 len2 = strtol (p->value, NULL, 10);
1547 { /* indefinite length method */
1548 if ((counter + 2) > len)
1549 return ASN1_DER_ERROR;
1550 if ((der[counter]) || der[counter + 1])
1552 _asn1_append_sequence_set (p);
1559 _asn1_set_value (p, NULL, 0);
1563 { /* definite length method */
1566 _asn1_append_sequence_set (p);
1573 _asn1_set_value (p, NULL, 0);
1574 if (len2 != counter)
1576 asn1_delete_structure (element);
1577 return ASN1_DER_ERROR;
1582 { /* move==DOWN || move==RIGHT */
1584 asn1_get_length_der (der + counter, len - counter, &len2);
1586 return ASN1_DER_ERROR;
1591 { /* definite length method */
1592 _asn1_ltostr (counter + len3, temp);
1593 tlen = strlen (temp);
1596 _asn1_set_value (p, temp, tlen + 1);
1599 { /* indefinite length method */
1600 _asn1_set_value (p, "-1", 3);
1603 while ((type_field (p2->type) == TYPE_TAG)
1604 || (type_field (p2->type) == TYPE_SIZE))
1606 if (p2->right == NULL)
1607 _asn1_append_sequence_set (p);
1614 if (asn1_get_tag_der
1615 (der + counter, len - counter, &class, &len2,
1616 &tag) != ASN1_SUCCESS)
1617 return ASN1_DER_ERROR;
1618 if (counter + len2 > len)
1619 return ASN1_DER_ERROR;
1621 asn1_get_length_der (der + counter + len2,
1622 len - counter - len2, &len3);
1624 return ASN1_DER_ERROR;
1625 if (len4 > len - counter + len2 + len3)
1626 return ASN1_DER_ERROR;
1630 _asn1_set_value_octet (p, der + counter, len2 + len3);
1631 counter += len2 + len3;
1634 { /* indefinite length */
1635 /* Check indefinite lenth method in an EXPLICIT TAG */
1636 if ((p->type & CONST_TAG) && (der[counter - 1] == 0x80))
1641 len2 = len - counter;
1643 _asn1_get_indefinite_length_string (der + counter, &len2);
1644 if (ris != ASN1_SUCCESS)
1646 asn1_delete_structure (element);
1650 _asn1_set_value_octet (p, der + counter, len2);
1653 /* Check if a couple of 0x00 are present due to an EXPLICIT TAG with
1654 an indefinite length method. */
1657 if (!der[counter] && !der[counter + 1])
1663 asn1_delete_structure (element);
1664 return ASN1_DER_ERROR;
1671 move = (move == UP) ? RIGHT : DOWN;
1676 if (p == node && move != DOWN)
1686 if ((move == RIGHT) && !(p->type & CONST_SET))
1694 p = _asn1_find_up (p);
1697 _asn1_delete_not_used (*element);
1701 asn1_delete_structure (element);
1702 return ASN1_DER_ERROR;
1705 return ASN1_SUCCESS;
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">↓</span></a>
1715 <td class="function_entry_name">
1718 <td class="function_entry_cyclo">
1721 <td class="function_entry_number">
1724 <td class="function_entry_number">
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>
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">
1736 asn1_write_value (ASN1_TYPE node_root, const char *name,
1737 const void *ivalue, int len)
1739 ASN1_TYPE node, p, p2;
1740 unsigned char *temp, *value_temp = NULL, *default_temp = NULL;
1741 int len2, k, k2, negative;
1743 const unsigned char *value = ivalue;
1745 node = asn1_find_node (node_root, name);
1747 return ASN1_ELEMENT_NOT_FOUND;
1749 if ((node->type & CONST_OPTION) && (value == NULL) && (len == 0))
1751 asn1_delete_structure (&node);
1752 return ASN1_SUCCESS;
1755 if ((type_field (node->type) == TYPE_SEQUENCE_OF) && (value == NULL)
1759 while ((type_field (p->type) == TYPE_TAG)
1760 || (type_field (p->type) == TYPE_SIZE))
1764 asn1_delete_structure (&p->right);
1766 return ASN1_SUCCESS;
1769 switch (type_field (node->type))
1772 if (!strcmp (value, "TRUE"))
1774 if (node->type & CONST_DEFAULT)
1777 while (type_field (p->type) != TYPE_DEFAULT)
1779 if (p->type & CONST_TRUE)
1780 _asn1_set_value (node, NULL, 0);
1782 _asn1_set_value (node, "T", 1);
1785 _asn1_set_value (node, "T", 1);
1787 else if (!strcmp (value, "FALSE"))
1789 if (node->type & CONST_DEFAULT)
1792 while (type_field (p->type) != TYPE_DEFAULT)
1794 if (p->type & CONST_FALSE)
1795 _asn1_set_value (node, NULL, 0);
1797 _asn1_set_value (node, "F", 1);
1800 _asn1_set_value (node, "F", 1);
1803 return ASN1_VALUE_NOT_VALID;
1806 case TYPE_ENUMERATED:
1809 if ((isdigit (value[0])) || (value[0] == '-'))
1812 (unsigned char *) _asn1_malloc (SIZEOF_UNSIGNED_LONG_INT);
1813 if (value_temp == NULL)
1814 return ASN1_MEM_ALLOC_ERROR;
1816 _asn1_convert_integer (value, value_temp,
1817 SIZEOF_UNSIGNED_LONG_INT, &len);
1820 { /* is an identifier like v1 */
1821 if (!(node->type & CONST_LIST))
1822 return ASN1_VALUE_NOT_VALID;
1826 if (type_field (p->type) == TYPE_CONSTANT)
1828 if ((p->name) && (!strcmp (p->name, value)))
1832 _asn1_malloc (SIZEOF_UNSIGNED_LONG_INT);
1833 if (value_temp == NULL)
1834 return ASN1_MEM_ALLOC_ERROR;
1836 _asn1_convert_integer (p->value,
1838 SIZEOF_UNSIGNED_LONG_INT,
1846 return ASN1_VALUE_NOT_VALID;
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);
1858 if (value_temp[0] & 0x80)
1863 if (negative && (type_field (node->type) == TYPE_ENUMERATED))
1865 _asn1_free (value_temp);
1866 return ASN1_VALUE_NOT_VALID;
1869 for (k = 0; k < len - 1; k++)
1870 if (negative && (value_temp[k] != 0xFF))
1872 else if (!negative && value_temp[k])
1875 if ((negative && !(value_temp[k] & 0x80)) ||
1876 (!negative && (value_temp[k] & 0x80)))
1879 _asn1_set_value_octet (node, value_temp + k, len - k);
1881 if (node->type & CONST_DEFAULT)
1884 while (type_field (p->type) != TYPE_DEFAULT)
1886 if ((isdigit (p->value[0])) || (p->value[0] == '-'))
1889 (unsigned char *) _asn1_malloc (SIZEOF_UNSIGNED_LONG_INT);
1890 if (default_temp == NULL)
1892 _asn1_free (value_temp);
1893 return ASN1_MEM_ALLOC_ERROR;
1896 _asn1_convert_integer (p->value, default_temp,
1897 SIZEOF_UNSIGNED_LONG_INT, &len2);
1900 { /* is an identifier like v1 */
1901 if (!(node->type & CONST_LIST))
1903 _asn1_free (value_temp);
1904 return ASN1_VALUE_NOT_VALID;
1909 if (type_field (p2->type) == TYPE_CONSTANT)
1911 if ((p2->name) && (!strcmp (p2->name, p->value)))
1915 _asn1_malloc (SIZEOF_UNSIGNED_LONG_INT);
1916 if (default_temp == NULL)
1918 _asn1_free (value_temp);
1919 return ASN1_MEM_ALLOC_ERROR;
1922 _asn1_convert_integer (p2->value,
1924 SIZEOF_UNSIGNED_LONG_INT,
1933 _asn1_free (value_temp);
1934 return ASN1_VALUE_NOT_VALID;
1939 if ((len - k) == len2)
1941 for (k2 = 0; k2 < len2; k2++)
1942 if (value_temp[k + k2] != default_temp[k2])
1947 _asn1_set_value (node, NULL, 0);
1949 _asn1_free (default_temp);
1951 _asn1_free (value_temp);
1953 case TYPE_OBJECT_ID:
1954 for (i = 0; i < strlen (value); i++)
1955 if ((!isdigit (value[i])) && (value[i] != '.') && (value[i] != '+'))
1956 return ASN1_VALUE_NOT_VALID;
1957 if (node->type & CONST_DEFAULT)
1960 while (type_field (p->type) != TYPE_DEFAULT)
1962 if (!strcmp (value, p->value))
1964 _asn1_set_value (node, NULL, 0);
1968 _asn1_set_value (node, value, strlen (value) + 1);
1971 if (node->type & CONST_UTC)
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))
1981 if (value[10] != 'Z')
1982 return ASN1_VALUE_NOT_VALID;
1985 if ((!isdigit (value[10])) || (!isdigit (value[11])) ||
1987 return ASN1_VALUE_NOT_VALID;
1990 if ((value[10] != '+') && (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;
1997 if ((!isdigit (value[10])) || (!isdigit (value[11])))
1998 return ASN1_VALUE_NOT_VALID;
1999 if ((value[12] != '+') && (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;
2006 return ASN1_VALUE_NOT_FOUND;
2008 _asn1_set_value (node, value, strlen (value) + 1);
2011 { /* GENERALIZED TIME */
2013 _asn1_set_value (node, value, strlen (value) + 1);
2016 case TYPE_OCTET_STRING:
2018 len = strlen (value);
2019 _asn1_set_value_octet (node, value, len);
2021 case TYPE_GENERALSTRING:
2023 len = strlen (value);
2024 _asn1_set_value_octet (node, value, len);
2026 case TYPE_BIT_STRING:
2028 len = strlen (value);
2029 asn1_length_der ((len >> 3) + 2, NULL, &len2);
2030 temp = (unsigned char *) _asn1_malloc ((len >> 3) + 2 + len2);
2032 return ASN1_MEM_ALLOC_ERROR;
2034 asn1_bit_der (value, len, temp, &len2);
2035 _asn1_set_value_m (node, temp, len2);
2042 if (!strcmp (p->name, value))
2049 asn1_delete_structure (&p2);
2060 return ASN1_ELEMENT_NOT_FOUND;
2063 _asn1_set_value_octet (node, value, len);
2065 case TYPE_SEQUENCE_OF:
2067 if (strcmp (value, "NEW"))
2068 return ASN1_VALUE_NOT_VALID;
2069 _asn1_append_sequence_set (node);
2072 return ASN1_ELEMENT_NOT_FOUND;
2076 return ASN1_SUCCESS;
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">↓</span></a>
2086 <td class="function_entry_name">
2087 asn1_print_structure
2089 <td class="function_entry_cyclo">
2092 <td class="function_entry_number">
2095 <td class="function_entry_number">
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>
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">
2107 asn1_print_structure (FILE * out, ASN1_TYPE structure, const char *name,
2111 int k, indent = 0, len, len2, len3;
2116 root = asn1_find_node (structure, name);
2124 if (mode == ASN1_PRINT_ALL)
2126 for (k = 0; k < indent; k++)
2128 fprintf (out, "name:");
2130 fprintf (out, "%s ", p->name);
2132 fprintf (out, "NULL ");
2136 switch (type_field (p->type))
2143 for (k = 0; k < indent; k++)
2145 fprintf (out, "name:");
2147 fprintf (out, "%s ", p->name);
2149 fprintf (out, "NULL ");
2153 if (mode != ASN1_PRINT_NAME)
2155 switch (type_field (p->type))
2158 if (mode == ASN1_PRINT_ALL)
2159 fprintf (out, "type:CONST");
2162 if (mode == ASN1_PRINT_ALL)
2163 fprintf (out, "type:TAG");
2166 if (mode == ASN1_PRINT_ALL)
2167 fprintf (out, "type:SIZE");
2170 fprintf (out, "type:DEFAULT");
2173 fprintf (out, "type:NULL");
2175 case TYPE_IDENTIFIER:
2176 fprintf (out, "type:IDENTIFIER");
2179 fprintf (out, "type:INTEGER");
2181 case TYPE_ENUMERATED:
2182 fprintf (out, "type:ENUMERATED");
2185 fprintf (out, "type:TIME");
2188 fprintf (out, "type:BOOLEAN");
2191 fprintf (out, "type:SEQUENCE");
2193 case TYPE_BIT_STRING:
2194 fprintf (out, "type:BIT_STR");
2196 case TYPE_OCTET_STRING:
2197 fprintf (out, "type:OCT_STR");
2199 case TYPE_GENERALSTRING:
2200 fprintf (out, "type:GENERALSTRING");
2202 case TYPE_SEQUENCE_OF:
2203 fprintf (out, "type:SEQ_OF");
2205 case TYPE_OBJECT_ID:
2206 fprintf (out, "type:OBJ_ID");
2209 fprintf (out, "type:ANY");
2212 fprintf (out, "type:SET");
2215 fprintf (out, "type:SET_OF");
2218 fprintf (out, "type:CHOICE");
2220 case TYPE_DEFINITIONS:
2221 fprintf (out, "type:DEFINITIONS");
2228 if ((mode == ASN1_PRINT_NAME_TYPE_VALUE) || (mode == ASN1_PRINT_ALL))
2230 switch (type_field (p->type))
2233 if (mode == ASN1_PRINT_ALL)
2235 fprintf (out, " value:%s", p->value);
2238 if (mode == ASN1_PRINT_ALL)
2240 fprintf (out, " value:%s", p->value);
2243 if (mode == ASN1_PRINT_ALL)
2245 fprintf (out, " value:%s", p->value);
2249 fprintf (out, " value:%s", p->value);
2250 else if (p->type & CONST_TRUE)
2251 fprintf (out, " value:TRUE");
2252 else if (p->type & CONST_FALSE)
2253 fprintf (out, " value:FALSE");
2255 case TYPE_IDENTIFIER:
2257 fprintf (out, " value:%s", p->value);
2263 len = asn1_get_length_der (p->value, p->value_len, &len2);
2264 fprintf (out, " value:0x");
2266 for (k = 0; k < len; k++)
2267 fprintf (out, "%02x", (p->value)[k + len2]);
2270 case TYPE_ENUMERATED:
2274 len = asn1_get_length_der (p->value, p->value_len, &len2);
2275 fprintf (out, " value:0x");
2277 for (k = 0; k < len; k++)
2278 fprintf (out, "%02x", (p->value)[k + len2]);
2283 fprintf (out, " value:%s", p->value);
2288 if (p->value[0] == 'T')
2289 fprintf (out, " value:TRUE");
2290 else if (p->value[0] == 'F')
2291 fprintf (out, " value:FALSE");
2294 case TYPE_BIT_STRING:
2298 len = asn1_get_length_der (p->value, p->value_len, &len2);
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]);
2308 case TYPE_OCTET_STRING:
2312 len = asn1_get_length_der (p->value, p->value_len, &len2);
2313 fprintf (out, " value:");
2315 for (k = 0; k < len; k++)
2316 fprintf (out, "%02x", (p->value)[k + len2]);
2319 case TYPE_GENERALSTRING:
2323 len = asn1_get_length_der (p->value, p->value_len, &len2);
2324 fprintf (out, " value:");
2326 for (k = 0; k < len; k++)
2327 fprintf (out, "%02x", (p->value)[k + len2]);
2330 case TYPE_OBJECT_ID:
2332 fprintf (out, " value:%s", p->value);
2338 len2 = asn1_get_length_der (p->value, p->value_len, &len3);
2339 fprintf (out, " value:");
2341 for (k = 0; k < len2; k++)
2342 fprintf (out, "%02x", (p->value)[k + len3]);
2348 case TYPE_DEFINITIONS:
2349 case TYPE_SEQUENCE_OF:
2358 if (mode == ASN1_PRINT_ALL)
2360 if (p->type & 0x1FFFFF00)
2362 fprintf (out, " attr:");
2363 if (p->type & CONST_UNIVERSAL)
2364 fprintf (out, "UNIVERSAL,");
2365 if (p->type & CONST_PRIVATE)
2366 fprintf (out, "PRIVATE,");
2367 if (p->type & CONST_APPLICATION)
2368 fprintf (out, "APPLICATION,");
2369 if (p->type & CONST_EXPLICIT)
2370 fprintf (out, "EXPLICIT,");
2371 if (p->type & CONST_IMPLICIT)
2372 fprintf (out, "IMPLICIT,");
2373 if (p->type & CONST_TAG)
2374 fprintf (out, "TAG,");
2375 if (p->type & CONST_DEFAULT)
2376 fprintf (out, "DEFAULT,");
2377 if (p->type & CONST_TRUE)
2378 fprintf (out, "TRUE,");
2379 if (p->type & CONST_FALSE)
2380 fprintf (out, "FALSE,");
2381 if (p->type & CONST_LIST)
2382 fprintf (out, "LIST,");
2383 if (p->type & CONST_MIN_MAX)
2384 fprintf (out, "MIN_MAX,");
2385 if (p->type & CONST_OPTION)
2386 fprintf (out, "OPTION,");
2387 if (p->type & CONST_1_PARAM)
2388 fprintf (out, "1_PARAM,");
2389 if (p->type & CONST_SIZE)
2390 fprintf (out, "SIZE,");
2391 if (p->type & CONST_DEFINED_BY)
2392 fprintf (out, "DEF_BY,");
2393 if (p->type & CONST_GENERALIZED)
2394 fprintf (out, "GENERALIZED,");
2395 if (p->type & CONST_UTC)
2396 fprintf (out, "UTC,");
2397 if (p->type & CONST_SET)
2398 fprintf (out, "SET,");
2399 if (p->type & CONST_NOT_USED)
2400 fprintf (out, "NOT_USED,");
2401 if (p->type & CONST_ASSIGN)
2402 fprintf (out, "ASSIGNMENT,");
2406 if (mode == ASN1_PRINT_ALL)
2408 fprintf (out, "\n");
2412 switch (type_field (p->type))
2419 fprintf (out, "\n");
2439 p = _asn1_find_up (p);
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">↓</span></a>
2463 <td class="function_entry_name">
2464 asn1_der_decoding_startEnd
2466 <td class="function_entry_cyclo">
2469 <td class="function_entry_number">
2472 <td class="function_entry_number">
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>
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">
2484 asn1_der_decoding_startEnd (ASN1_TYPE element, const void *ider, int len,
2485 const char *name_element, int *start, int *end)
2487 ASN1_TYPE node, node_to_find, p, p2, p3;
2488 int counter, len2, len3, len4, move, ris;
2489 unsigned char class;
2492 const unsigned char *der = ider;
2496 if (node == ASN1_TYPE_EMPTY)
2497 return ASN1_ELEMENT_NOT_FOUND;
2499 node_to_find = asn1_find_node (node, name_element);
2501 if (node_to_find == NULL)
2502 return ASN1_ELEMENT_NOT_FOUND;
2504 if (node_to_find == node)
2508 return ASN1_SUCCESS;
2511 if (node->type & CONST_OPTION)
2512 return ASN1_GENERIC_ERROR;
2523 if (p->type & CONST_SET)
2525 p2 = _asn1_find_up (p);
2526 len2 = strtol (p2->value, NULL, 10);
2529 if (!der[counter] && !der[counter + 1])
2537 else if (counter == len2)
2543 else if (counter > len2)
2544 return ASN1_DER_ERROR;
2548 if ((p2->type & CONST_SET) && (p2->type & CONST_NOT_USED))
2550 if (type_field (p2->type) != TYPE_CHOICE)
2552 _asn1_extract_tag_der (p2, der + counter,
2553 len - counter, &len2);
2558 _asn1_extract_tag_der (p3, der + counter,
2559 len - counter, &len2);
2561 if (ris == ASN1_SUCCESS)
2563 p2->type &= ~CONST_NOT_USED;
2571 return ASN1_DER_ERROR;
2574 if (p == node_to_find)
2577 if (type_field (p->type) == TYPE_CHOICE)
2581 _asn1_extract_tag_der (p, der + counter, len - counter,
2583 if (p == node_to_find)
2587 if (ris == ASN1_SUCCESS)
2589 _asn1_extract_tag_der (p, der + counter, len - counter, &len2);
2590 if (ris != ASN1_SUCCESS)
2592 if (p->type & CONST_OPTION)
2594 p->type |= CONST_NOT_USED;
2597 else if (p->type & CONST_DEFAULT)
2603 return ASN1_TAG_ERROR;
2610 if (ris == ASN1_SUCCESS)
2612 switch (type_field (p->type))
2616 return ASN1_DER_ERROR;
2621 if (der[counter++] != 1)
2622 return ASN1_DER_ERROR;
2627 case TYPE_ENUMERATED:
2629 asn1_get_length_der (der + counter, len - counter, &len3);
2631 return ASN1_DER_ERROR;
2632 counter += len3 + len2;
2635 case TYPE_OBJECT_ID:
2637 asn1_get_length_der (der + counter, len - counter, &len3);
2639 return ASN1_DER_ERROR;
2640 counter += len2 + len3;
2645 asn1_get_length_der (der + counter, len - counter, &len3);
2647 return ASN1_DER_ERROR;
2648 counter += len2 + len3;
2651 case TYPE_OCTET_STRING:
2652 len3 = len - counter;
2653 ris = _asn1_get_octet_string (der + counter, NULL, &len3);
2654 if (ris != ASN1_SUCCESS)
2659 case TYPE_GENERALSTRING:
2661 asn1_get_length_der (der + counter, len - counter, &len3);
2663 return ASN1_DER_ERROR;
2664 counter += len3 + len2;
2667 case TYPE_BIT_STRING:
2669 asn1_get_length_der (der + counter, len - counter, &len3);
2671 return ASN1_DER_ERROR;
2672 counter += len3 + len2;
2680 asn1_get_length_der (der + counter, len - counter, &len2);
2682 return ASN1_DER_ERROR;
2691 if (!der[counter] && !der[counter + 1]) /* indefinite length method */
2696 case TYPE_SEQUENCE_OF:
2701 asn1_get_length_der (der + counter, len - counter, &len2);
2703 return ASN1_DER_ERROR;
2705 if ((len3 == -1) && !der[counter] && !der[counter + 1])
2710 while ((type_field (p2->type) == TYPE_TAG) ||
2711 (type_field (p2->type) == TYPE_SIZE))
2718 if (!der[counter] && !der[counter + 1]) /* indefinite length method */
2724 if (asn1_get_tag_der
2725 (der + counter, len - counter, &class, &len2,
2726 &tag) != ASN1_SUCCESS)
2727 return ASN1_DER_ERROR;
2728 if (counter + len2 > len)
2729 return ASN1_DER_ERROR;
2732 asn1_get_length_der (der + counter + len2,
2733 len - counter - len2, &len3);
2735 return ASN1_DER_ERROR;
2739 counter += len2 + len4 + len3;
2742 { /* indefinite length */
2743 /* Check indefinite lenth method in an EXPLICIT TAG */
2744 if ((p->type & CONST_TAG) && (der[counter - 1] == 0x80))
2749 len2 = len - counter;
2751 _asn1_get_indefinite_length_string (der + counter, &len2);
2752 if (ris != ASN1_SUCCESS)
2756 /* Check if a couple of 0x00 are present due to an EXPLICIT TAG with
2757 an indefinite length method. */
2760 if (!der[counter] && !der[counter + 1])
2763 return ASN1_DER_ERROR;
2769 move = (move == UP) ? RIGHT : DOWN;
2774 if ((p == node_to_find) && (move == RIGHT))
2777 return ASN1_SUCCESS;
2780 if (p == node && move != DOWN)
2790 if ((move == RIGHT) && !(p->type & CONST_SET))
2798 p = _asn1_find_up (p);
2801 return ASN1_ELEMENT_NOT_FOUND;
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">↓</span></a>
2811 <td class="function_entry_name">
2814 <td class="function_entry_cyclo">
2817 <td class="function_entry_number">
2820 <td class="function_entry_number">
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>
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">
2832 asn1_der_coding (ASN1_TYPE element, const char *name, void *ider, int *len,
2833 char *ErrorDescription)
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;
2839 unsigned char *der = ider;
2841 node = asn1_find_node (element, name);
2843 return ASN1_ELEMENT_NOT_FOUND;
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
2849 node = _asn1_copy_structure3 (node);
2851 return ASN1_ELEMENT_NOT_FOUND;
2861 counter_old = counter;
2862 max_len_old = max_len;
2865 err = _asn1_insert_tag_der (p, der, &counter, &max_len);
2866 if (err != ASN1_SUCCESS && err != ASN1_MEM_ERROR)
2869 switch (type_field (p->type))
2879 if ((p->type & CONST_DEFAULT) && (p->value == NULL))
2881 counter = counter_old;
2882 max_len = max_len_old;
2886 if (p->value == NULL)
2888 _asn1_error_description_value_not_found (p,
2890 err = ASN1_VALUE_NOT_FOUND;
2897 if (p->value[0] == 'F')
2900 der[counter++] = 0xFF;
2908 case TYPE_ENUMERATED:
2909 if ((p->type & CONST_DEFAULT) && (p->value == NULL))
2911 counter = counter_old;
2912 max_len = max_len_old;
2916 if (p->value == NULL)
2918 _asn1_error_description_value_not_found (p,
2920 err = ASN1_VALUE_NOT_FOUND;
2923 len2 = asn1_get_length_der (p->value, p->value_len, &len3);
2926 err = ASN1_DER_ERROR;
2929 max_len -= len2 + len3;
2931 memcpy (der + counter, p->value, len3 + len2);
2932 counter += len3 + len2;
2936 case TYPE_OBJECT_ID:
2937 if ((p->type & CONST_DEFAULT) && (p->value == NULL))
2939 counter = counter_old;
2940 max_len = max_len_old;
2944 if (p->value == NULL)
2946 _asn1_error_description_value_not_found (p,
2948 err = ASN1_VALUE_NOT_FOUND;
2952 err = _asn1_objectid_der (p->value, der + counter, &len2);
2953 if (err != ASN1_SUCCESS && err != ASN1_MEM_ERROR)
2962 if (p->value == NULL)
2964 _asn1_error_description_value_not_found (p, ErrorDescription);
2965 err = ASN1_VALUE_NOT_FOUND;
2969 err = _asn1_time_der (p->value, der + counter, &len2);
2970 if (err != ASN1_SUCCESS && err != ASN1_MEM_ERROR)
2977 case TYPE_OCTET_STRING:
2978 if (p->value == NULL)
2980 _asn1_error_description_value_not_found (p, ErrorDescription);
2981 err = ASN1_VALUE_NOT_FOUND;
2984 len2 = asn1_get_length_der (p->value, p->value_len, &len3);
2987 err = ASN1_DER_ERROR;
2990 max_len -= len2 + len3;
2992 memcpy (der + counter, p->value, len3 + len2);
2993 counter += len3 + len2;
2996 case TYPE_GENERALSTRING:
2997 if (p->value == NULL)
2999 _asn1_error_description_value_not_found (p, ErrorDescription);
3000 err = ASN1_VALUE_NOT_FOUND;
3003 len2 = asn1_get_length_der (p->value, p->value_len, &len3);
3006 err = ASN1_DER_ERROR;
3009 max_len -= len2 + len3;
3011 memcpy (der + counter, p->value, len3 + len2);
3012 counter += len3 + len2;
3015 case TYPE_BIT_STRING:
3016 if (p->value == NULL)
3018 _asn1_error_description_value_not_found (p, ErrorDescription);
3019 err = ASN1_VALUE_NOT_FOUND;
3022 len2 = asn1_get_length_der (p->value, p->value_len, &len3);
3025 err = ASN1_DER_ERROR;
3028 max_len -= len2 + len3;
3030 memcpy (der + counter, p->value, len3 + len2);
3031 counter += len3 + len2;
3038 _asn1_ltostr (counter, temp);
3039 tlen = strlen (temp);
3041 _asn1_set_value (p, temp, tlen + 1);
3042 if (p->down == NULL)
3050 while (p2 && (type_field (p2->type) == TYPE_TAG))
3064 len2 = strtol (p->value, NULL, 10);
3065 _asn1_set_value (p, NULL, 0);
3066 if ((type_field (p->type) == TYPE_SET) && (max_len >= 0))
3067 _asn1_ordering_set (der + len2, max_len - len2, p);
3068 asn1_length_der (counter - len2, temp, &len3);
3072 memmove (der + len2 + len3, der + len2, counter - len2);
3073 memcpy (der + len2, temp, len3);
3079 case TYPE_SEQUENCE_OF:
3083 _asn1_ltostr (counter, temp);
3084 tlen = strlen (temp);
3087 _asn1_set_value (p, temp, tlen + 1);
3089 while ((type_field (p->type) == TYPE_TAG)
3090 || (type_field (p->type) == TYPE_SIZE))
3099 p = _asn1_find_up (p);
3104 len2 = strtol (p->value, NULL, 10);
3105 _asn1_set_value (p, NULL, 0);
3106 if ((type_field (p->type) == TYPE_SET_OF)
3107 && (max_len - len2 > 0))
3109 _asn1_ordering_set_of (der + len2, max_len - len2, p);
3111 asn1_length_der (counter - len2, temp, &len3);
3115 memmove (der + len2 + len3, der + len2, counter - len2);
3116 memcpy (der + len2, temp, len3);
3123 if (p->value == NULL)
3125 _asn1_error_description_value_not_found (p, ErrorDescription);
3126 err = ASN1_VALUE_NOT_FOUND;
3129 len2 = asn1_get_length_der (p->value, p->value_len, &len3);
3132 err = ASN1_DER_ERROR;
3137 memcpy (der + counter, p->value + len3, len2);
3142 move = (move == UP) ? RIGHT : DOWN;
3146 if ((move != DOWN) && (counter != counter_old))
3148 err = _asn1_complete_explicit_tag (p, der, &counter, &max_len);
3149 if (err != ASN1_SUCCESS && err != ASN1_MEM_ERROR)
3153 if (p == node && move != DOWN)
3171 p = _asn1_find_up (p);
3178 err = ASN1_MEM_ERROR;
3185 asn1_delete_structure (&node);
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">↓</span></a>
3196 <td class="function_entry_name">
3197 _asn1_extract_tag_der
3199 <td class="function_entry_cyclo">
3202 <td class="function_entry_number">
3205 <td class="function_entry_number">
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>
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">
3217 _asn1_extract_tag_der (ASN1_TYPE node, const unsigned char *der, int der_len,
3221 int counter, len2, len3, is_tag_implicit;
3222 unsigned long tag, tag_implicit = 0;
3223 unsigned char class, class2, class_implicit = 0;
3226 return ASN1_GENERIC_ERROR;
3228 counter = is_tag_implicit = 0;
3230 if (node->type & CONST_TAG)
3235 if (type_field (p->type) == TYPE_TAG)
3237 if (p->type & CONST_APPLICATION)
3238 class2 = ASN1_CLASS_APPLICATION;
3239 else if (p->type & CONST_UNIVERSAL)
3240 class2 = ASN1_CLASS_UNIVERSAL;
3241 else if (p->type & CONST_PRIVATE)
3242 class2 = ASN1_CLASS_PRIVATE;
3244 class2 = ASN1_CLASS_CONTEXT_SPECIFIC;
3246 if (p->type & CONST_EXPLICIT)
3248 if (asn1_get_tag_der
3249 (der + counter, der_len - counter, &class, &len2,
3250 &tag) != ASN1_SUCCESS)
3251 return ASN1_DER_ERROR;
3253 if (counter + len2 > der_len)
3254 return ASN1_DER_ERROR;
3258 asn1_get_length_ber (der + counter, der_len - counter,
3261 return ASN1_DER_ERROR;
3264 if (counter > der_len)
3265 return ASN1_DER_ERROR;
3267 if (!is_tag_implicit)
3269 if ((class != (class2 | ASN1_CLASS_STRUCTURED)) ||
3270 (tag != strtoul ((char *) p->value, NULL, 10)))
3271 return ASN1_TAG_ERROR;
3274 { /* ASN1_TAG_IMPLICIT */
3275 if ((class != class_implicit) || (tag != tag_implicit))
3276 return ASN1_TAG_ERROR;
3278 is_tag_implicit = 0;
3281 { /* ASN1_TAG_IMPLICIT */
3282 if (!is_tag_implicit)
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;
3299 if (is_tag_implicit)
3301 if (asn1_get_tag_der
3302 (der + counter, der_len - counter, &class, &len2,
3303 &tag) != ASN1_SUCCESS)
3304 return ASN1_DER_ERROR;
3305 if (counter + len2 > der_len)
3306 return ASN1_DER_ERROR;
3308 if ((class != class_implicit) || (tag != tag_implicit))
3310 if (type_field (node->type) == TYPE_OCTET_STRING)
3312 class_implicit |= ASN1_CLASS_STRUCTURED;
3313 if ((class != class_implicit) || (tag != tag_implicit))
3314 return ASN1_TAG_ERROR;
3317 return ASN1_TAG_ERROR;
3322 if (type_field (node->type) == TYPE_TAG)
3326 return ASN1_SUCCESS;
3329 if (asn1_get_tag_der
3330 (der + counter, der_len - counter, &class, &len2,
3331 &tag) != ASN1_SUCCESS)
3332 return ASN1_DER_ERROR;
3334 if (counter + len2 > der_len)
3335 return ASN1_DER_ERROR;
3337 switch (type_field (node->type))
3340 if ((class != ASN1_CLASS_UNIVERSAL) || (tag != ASN1_TAG_NULL))
3341 return ASN1_DER_ERROR;
3344 if ((class != ASN1_CLASS_UNIVERSAL) || (tag != ASN1_TAG_BOOLEAN))
3345 return ASN1_DER_ERROR;
3348 if ((class != ASN1_CLASS_UNIVERSAL) || (tag != ASN1_TAG_INTEGER))
3349 return ASN1_DER_ERROR;
3351 case TYPE_ENUMERATED:
3352 if ((class != ASN1_CLASS_UNIVERSAL) || (tag != ASN1_TAG_ENUMERATED))
3353 return ASN1_DER_ERROR;
3355 case TYPE_OBJECT_ID:
3356 if ((class != ASN1_CLASS_UNIVERSAL) || (tag != ASN1_TAG_OBJECT_ID))
3357 return ASN1_DER_ERROR;
3360 if (node->type & CONST_UTC)
3362 if ((class != ASN1_CLASS_UNIVERSAL)
3363 || (tag != ASN1_TAG_UTCTime))
3364 return ASN1_DER_ERROR;
3368 if ((class != ASN1_CLASS_UNIVERSAL)
3369 || (tag != ASN1_TAG_GENERALIZEDTime))
3370 return ASN1_DER_ERROR;
3373 case TYPE_OCTET_STRING:
3374 if (((class != ASN1_CLASS_UNIVERSAL)
3375 && (class != (ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED)))
3376 || (tag != ASN1_TAG_OCTET_STRING))
3377 return ASN1_DER_ERROR;
3379 case TYPE_GENERALSTRING:
3380 if ((class != ASN1_CLASS_UNIVERSAL)
3381 || (tag != ASN1_TAG_GENERALSTRING))
3382 return ASN1_DER_ERROR;
3384 case TYPE_BIT_STRING:
3385 if ((class != ASN1_CLASS_UNIVERSAL) || (tag != ASN1_TAG_BIT_STRING))
3386 return ASN1_DER_ERROR;
3389 case TYPE_SEQUENCE_OF:
3390 if ((class != (ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED))
3391 || (tag != ASN1_TAG_SEQUENCE))
3392 return ASN1_DER_ERROR;
3396 if ((class != (ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED))
3397 || (tag != ASN1_TAG_SET))
3398 return ASN1_DER_ERROR;
3404 return ASN1_DER_ERROR;
3411 return ASN1_SUCCESS;
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">↓</span></a>
3421 <td class="function_entry_name">
3424 <td class="function_entry_cyclo">
3427 <td class="function_entry_number">
3430 <td class="function_entry_number">
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>
3438 <td colspan="6" height="0">
3439 <div id="yyparse_src" class="function_src" style="position: relative; display: none;">
3440 <pre class="function_src">
3442 yyparse (void *YYPARSE_PARAM)
3445 yyparse (YYPARSE_PARAM)
3446 void *YYPARSE_PARAM;
3448 #else /* ! YYPARSE_PARAM */
3449 #if (defined __STDC__ || defined __C99__FUNC__ \
3450 || defined __cplusplus || defined _MSC_VER)
3463 /* Number of tokens to shift before error messages enabled. */
3466 /* The stacks and their tools:
3467 `yyss': related to states.
3468 `yyvs': related to semantic values.
3470 Refer to the stacks thru separate pointers, to allow yyoverflow
3471 to reallocate them elsewhere. */
3473 /* The state stack. */
3474 yytype_int16 yyssa[YYINITDEPTH];
3476 yytype_int16 *yyssp;
3478 /* The semantic value stack. */
3479 YYSTYPE yyvsa[YYINITDEPTH];
3483 YYSIZE_T yystacksize;
3487 /* Lookahead token as an internal (translated) token number. */
3489 /* The variables used to return semantic value and location from the
3494 /* Buffer for error messages, and its allocated size. */
3496 char *yymsg = yymsgbuf;
3497 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3500 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3502 /* The number of symbols on the RHS of the reduced rule.
3503 Keep to zero when no symbol should be popped. */
3509 yystacksize = YYINITDEPTH;
3511 YYDPRINTF ((stderr, "Starting parse\n"));
3516 yychar = YYEMPTY; /* Cause a token to be read. */
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. */
3527 /*------------------------------------------------------------.
3528 | yynewstate -- Push a new state, which is found in yystate. |
3529 `------------------------------------------------------------*/
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. */
3538 if (yyss + yystacksize - 1 <= yyssp)
3540 /* Get the current used size of the three stacks, in elements. */
3541 YYSIZE_T yysize = yyssp - yyss + 1;
3545 /* Give user a chance to reallocate the stack. Use copies of
3546 these so that the &'s don't force the real ones into
3548 YYSTYPE *yyvs1 = yyvs;
3549 yytype_int16 *yyss1 = yyss;
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 &yyss1, yysize * sizeof (*yyssp),
3557 &yyvs1, yysize * sizeof (*yyvsp),
3563 #else /* no yyoverflow */
3564 # ifndef YYSTACK_RELOCATE
3565 goto yyexhaustedlab;
3567 /* Extend the stack our own way. */
3568 if (YYMAXDEPTH <= yystacksize)
3569 goto yyexhaustedlab;
3571 if (YYMAXDEPTH < yystacksize)
3572 yystacksize = YYMAXDEPTH;
3575 yytype_int16 *yyss1 = yyss;
3576 union yyalloc *yyptr =
3577 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3579 goto yyexhaustedlab;
3580 YYSTACK_RELOCATE (yyss_alloc, yyss);
3581 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
3582 # undef YYSTACK_RELOCATE
3584 YYSTACK_FREE (yyss1);
3587 #endif /* no yyoverflow */
3589 yyssp = yyss + yysize - 1;
3590 yyvsp = yyvs + yysize - 1;
3592 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3593 (unsigned long int) yystacksize));
3595 if (yyss + yystacksize - 1 <= yyssp)
3599 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3601 if (yystate == YYFINAL)
3611 /* Do appropriate processing given the current state. Read a
3612 lookahead token if we need one and don't already have one. */
3614 /* First try to decide what to do without reference to lookahead token. */
3615 yyn = yypact[yystate];
3616 if (yyn == YYPACT_NINF)
3619 /* Not known => get a lookahead token if don't already have one. */
3621 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
3622 if (yychar == YYEMPTY)
3624 YYDPRINTF ((stderr, "Reading a token: "));
3628 if (yychar <= YYEOF)
3630 yychar = yytoken = YYEOF;
3631 YYDPRINTF ((stderr, "Now at end of input.\n"));
3635 yytoken = YYTRANSLATE (yychar);
3636 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3639 /* If the proper action on seeing token YYTOKEN is to reduce or to
3640 detect an error, take that action. */
3642 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3647 if (yyn == 0 || yyn == YYTABLE_NINF)
3653 /* Count tokens shifted since error; after three, turn off error
3658 /* Shift the lookahead token. */
3659 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3661 /* Discard the shifted token. */
3670 /*-----------------------------------------------------------.
3671 | yydefault -- do the default action for the current state. |
3672 `-----------------------------------------------------------*/
3674 yyn = yydefact[yystate];
3680 /*-----------------------------.
3681 | yyreduce -- Do a reduction. |
3682 `-----------------------------*/
3684 /* yyn is the number of a rule to reduce with. */
3687 /* If YYLEN is nonzero, implement the default value of the action:
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];
3698 YY_REDUCE_PRINT (yyn);
3703 /* Line 1455 of yacc.c */
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));
3711 p_tree=(yyval.node);
3717 /* Line 1455 of yacc.c */
3719 {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
3724 /* Line 1455 of yacc.c */
3726 {strcpy((yyval.str),(yyvsp[(2) - (2)].str));}
3731 /* Line 1455 of yacc.c */
3733 {strcpy((yyval.str),"-");
3734 strcat((yyval.str),(yyvsp[(2) - (2)].str));}
3739 /* Line 1455 of yacc.c */
3741 {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
3746 /* Line 1455 of yacc.c */
3748 {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
3753 /* Line 1455 of yacc.c */
3755 {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
3760 /* Line 1455 of yacc.c */
3762 {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
3767 /* Line 1455 of yacc.c */
3769 {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
3774 /* Line 1455 of yacc.c */
3776 {strcpy((yyval.str),(yyvsp[(1) - (1)].str));}
3781 /* Line 1455 of yacc.c */
3783 {(yyval.node)=_asn1_add_node(TYPE_CONSTANT);
3784 _asn1_set_value((yyval.node),(yyvsp[(2) - (3)].str),strlen((yyvsp[(2) - (3)].str))+1);}
3789 /* Line 1455 of yacc.c */
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);}
3798 /* Line 1455 of yacc.c */
3800 {(yyval.node)=(yyvsp[(1) - (1)].node);}
3805 /* Line 1455 of yacc.c */
3807 {(yyval.node)=(yyvsp[(1) - (3)].node);
3808 _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (3)].node)),(yyvsp[(3) - (3)].node));}
3813 /* Line 1455 of yacc.c */
3815 {(yyval.node)=_asn1_add_node(TYPE_CONSTANT);
3816 _asn1_set_value((yyval.node),(yyvsp[(1) - (1)].str),strlen((yyvsp[(1) - (1)].str))+1);}
3821 /* Line 1455 of yacc.c */
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);}
3830 /* Line 1455 of yacc.c */
3832 {(yyval.node)=(yyvsp[(1) - (1)].node);}
3837 /* Line 1455 of yacc.c */
3839 {(yyval.node)=(yyvsp[(1) - (2)].node);
3840 _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (2)].node)),(yyvsp[(2) - (2)].node));}
3845 /* Line 1455 of yacc.c */
3847 {(yyval.constant)=CONST_UNIVERSAL;}
3852 /* Line 1455 of yacc.c */
3854 {(yyval.constant)=CONST_PRIVATE;}
3859 /* Line 1455 of yacc.c */
3861 {(yyval.constant)=CONST_APPLICATION;}
3866 /* Line 1455 of yacc.c */
3868 {(yyval.node)=_asn1_add_node(TYPE_TAG);
3869 _asn1_set_value((yyval.node),(yyvsp[(2) - (3)].str),strlen((yyvsp[(2) - (3)].str))+1);}
3874 /* Line 1455 of yacc.c */
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);}
3882 /* Line 1455 of yacc.c */
3884 {(yyval.node)=(yyvsp[(1) - (1)].node);}
3889 /* Line 1455 of yacc.c */
3891 {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_EXPLICIT);}
3896 /* Line 1455 of yacc.c */
3898 {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_IMPLICIT);}
3903 /* Line 1455 of yacc.c */
3905 {(yyval.node)=_asn1_add_node(TYPE_DEFAULT);
3906 _asn1_set_value((yyval.node),(yyvsp[(2) - (2)].str),strlen((yyvsp[(2) - (2)].str))+1);}
3911 /* Line 1455 of yacc.c */
3913 {(yyval.node)=_asn1_add_node(TYPE_DEFAULT|CONST_TRUE);}
3918 /* Line 1455 of yacc.c */
3920 {(yyval.node)=_asn1_add_node(TYPE_DEFAULT|CONST_FALSE);}
3925 /* Line 1455 of yacc.c */
3927 {(yyval.node)=_asn1_add_node(TYPE_INTEGER);}
3932 /* Line 1455 of yacc.c */
3934 {(yyval.node)=_asn1_add_node(TYPE_INTEGER|CONST_LIST);
3935 _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
3940 /* Line 1455 of yacc.c */
3942 {(yyval.node)=_asn1_add_node(TYPE_INTEGER);}
3947 /* Line 1455 of yacc.c */
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));}
3957 /* Line 1455 of yacc.c */
3959 {(yyval.node)=_asn1_add_node(TYPE_BOOLEAN);}
3964 /* Line 1455 of yacc.c */
3966 {(yyval.node)=_asn1_add_node(TYPE_TIME|CONST_UTC);}
3971 /* Line 1455 of yacc.c */
3973 {(yyval.node)=_asn1_add_node(TYPE_TIME|CONST_GENERALIZED);}
3978 /* Line 1455 of yacc.c */
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);}
3986 /* Line 1455 of yacc.c */
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));}
3995 /* Line 1455 of yacc.c */
3997 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4002 /* Line 1455 of yacc.c */
4004 {(yyval.node)=(yyvsp[(2) - (3)].node);}
4009 /* Line 1455 of yacc.c */
4011 {(yyval.node)=_asn1_add_node(TYPE_GENERALSTRING);}
4016 /* Line 1455 of yacc.c */
4018 {(yyval.node)=_asn1_add_node(TYPE_GENERALSTRING|CONST_SIZE);
4019 _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));}
4024 /* Line 1455 of yacc.c */
4026 {(yyval.node)=_asn1_add_node(TYPE_OCTET_STRING);}
4031 /* Line 1455 of yacc.c */
4033 {(yyval.node)=_asn1_add_node(TYPE_OCTET_STRING|CONST_SIZE);
4034 _asn1_set_down((yyval.node),(yyvsp[(3) - (3)].node));}
4039 /* Line 1455 of yacc.c */
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);}
4048 /* Line 1455 of yacc.c */
4050 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4055 /* Line 1455 of yacc.c */
4057 {(yyval.node)=(yyvsp[(1) - (3)].node);
4058 _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (3)].node)),(yyvsp[(3) - (3)].node));}
4063 /* Line 1455 of yacc.c */
4065 {(yyval.node)=_asn1_add_node(TYPE_BIT_STRING);}
4070 /* Line 1455 of yacc.c */
4072 {(yyval.node)=_asn1_add_node(TYPE_BIT_STRING|CONST_SIZE);}
4077 /* Line 1455 of yacc.c */
4079 {(yyval.node)=_asn1_add_node(TYPE_BIT_STRING|CONST_LIST);
4080 _asn1_set_down((yyval.node),(yyvsp[(4) - (5)].node));}
4085 /* Line 1455 of yacc.c */
4087 {(yyval.node)=_asn1_add_node(TYPE_ENUMERATED|CONST_LIST);
4088 _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
4093 /* Line 1455 of yacc.c */
4095 {(yyval.node)=_asn1_add_node(TYPE_OBJECT_ID);}
4100 /* Line 1455 of yacc.c */
4102 {(yyval.node)=_asn1_add_node(TYPE_IDENTIFIER);
4103 _asn1_set_value((yyval.node),(yyvsp[(1) - (1)].str),strlen((yyvsp[(1) - (1)].str))+1);}
4108 /* Line 1455 of yacc.c */
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));}
4117 /* Line 1455 of yacc.c */
4119 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4124 /* Line 1455 of yacc.c */
4126 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4131 /* Line 1455 of yacc.c */
4133 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4138 /* Line 1455 of yacc.c */
4140 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4145 /* Line 1455 of yacc.c */
4147 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4152 /* Line 1455 of yacc.c */
4154 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4159 /* Line 1455 of yacc.c */
4161 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4166 /* Line 1455 of yacc.c */
4168 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4173 /* Line 1455 of yacc.c */
4175 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4180 /* Line 1455 of yacc.c */
4182 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4187 /* Line 1455 of yacc.c */
4189 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4194 /* Line 1455 of yacc.c */
4196 {(yyval.node)=_asn1_add_node(TYPE_NULL);}
4201 /* Line 1455 of yacc.c */
4203 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4208 /* Line 1455 of yacc.c */
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));}
4217 /* Line 1455 of yacc.c */
4219 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4224 /* Line 1455 of yacc.c */
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));}
4233 /* Line 1455 of yacc.c */
4235 {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_OPTION);}
4240 /* Line 1455 of yacc.c */
4242 {(yyval.node)=_asn1_set_name((yyvsp[(2) - (2)].node),(yyvsp[(1) - (2)].str));}
4247 /* Line 1455 of yacc.c */
4249 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4254 /* Line 1455 of yacc.c */
4256 {(yyval.node)=(yyvsp[(1) - (3)].node);
4257 _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (3)].node)),(yyvsp[(3) - (3)].node));}
4262 /* Line 1455 of yacc.c */
4264 {(yyval.node)=_asn1_add_node(TYPE_SEQUENCE);
4265 _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
4270 /* Line 1455 of yacc.c */
4272 {(yyval.node)=_asn1_add_node(TYPE_SEQUENCE_OF);
4273 _asn1_set_down((yyval.node),(yyvsp[(3) - (3)].node));}
4278 /* Line 1455 of yacc.c */
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));}
4287 /* Line 1455 of yacc.c */
4289 {(yyval.node)=_asn1_add_node(TYPE_SET);
4290 _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
4295 /* Line 1455 of yacc.c */
4297 {(yyval.node)=_asn1_add_node(TYPE_SET_OF);
4298 _asn1_set_down((yyval.node),(yyvsp[(3) - (3)].node));}
4303 /* Line 1455 of yacc.c */
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));}
4312 /* Line 1455 of yacc.c */
4314 {(yyval.node)=_asn1_add_node(TYPE_CHOICE);
4315 _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));}
4320 /* Line 1455 of yacc.c */
4322 {(yyval.node)=_asn1_add_node(TYPE_ANY);}
4327 /* Line 1455 of yacc.c */
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));}
4336 /* Line 1455 of yacc.c */
4338 {(yyval.node)=_asn1_set_name((yyvsp[(3) - (3)].node),(yyvsp[(1) - (3)].str));}
4343 /* Line 1455 of yacc.c */
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));}
4352 /* Line 1455 of yacc.c */
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));}
4362 /* Line 1455 of yacc.c */
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);}
4371 /* Line 1455 of yacc.c */
4373 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4378 /* Line 1455 of yacc.c */
4380 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4385 /* Line 1455 of yacc.c */
4387 {(yyval.node)=(yyvsp[(1) - (1)].node);}
4392 /* Line 1455 of yacc.c */
4394 {(yyval.node)=(yyvsp[(1) - (2)].node);
4395 _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (2)].node)),(yyvsp[(2) - (2)].node));}
4400 /* Line 1455 of yacc.c */
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));}
4409 /* Line 1455 of yacc.c */
4411 {(yyval.node)=_asn1_add_node(TYPE_OBJECT_ID);
4412 _asn1_set_name((yyval.node),(yyvsp[(1) - (3)].str));}
4417 /* Line 1455 of yacc.c */
4419 {(yyval.constant)=CONST_EXPLICIT;}
4424 /* Line 1455 of yacc.c */
4426 {(yyval.constant)=CONST_IMPLICIT;}
4431 /* Line 1455 of yacc.c */
4435 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4439 YY_STACK_PRINT (yyss, yyssp);
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. */
4449 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4450 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4451 yystate = yytable[yystate];
4453 yystate = yydefgoto[yyn - YYNTOKENS];
4458 /*------------------------------------.
4459 | yyerrlab -- here on detecting error |
4460 `------------------------------------*/
4462 /* If not already recovering from an error, report this error. */
4466 #if ! YYERROR_VERBOSE
4467 yyerror (YY_("syntax error"));
4470 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
4471 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
4473 YYSIZE_T yyalloc = 2 * yysize;
4474 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
4475 yyalloc = YYSTACK_ALLOC_MAXIMUM;
4476 if (yymsg != yymsgbuf)
4477 YYSTACK_FREE (yymsg);
4478 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
4480 yymsg_alloc = yyalloc;
4484 yymsg_alloc = sizeof yymsgbuf;
4488 if (0 < yysize && yysize <= yymsg_alloc)
4490 (void) yysyntax_error (yymsg, yystate, yychar);
4495 yyerror (YY_("syntax error"));
4497 goto yyexhaustedlab;
4505 if (yyerrstatus == 3)
4507 /* If just tried and failed to reuse lookahead token after an
4508 error, discard it. */
4510 if (yychar <= YYEOF)
4512 /* Return failure if at end of input. */
4513 if (yychar == YYEOF)
4518 yydestruct ("Error: discarding",
4519 yytoken, &yylval);
4524 /* Else will try to reuse lookahead token after shifting the error
4529 /*---------------------------------------------------.
4530 | yyerrorlab -- error raised explicitly by YYERROR. |
4531 `---------------------------------------------------*/
4534 /* Pacify compilers like GCC when the user code never invokes
4535 YYERROR and the label yyerrorlab therefore never appears in user
4537 if (/*CONSTCOND*/ 0)
4540 /* Do not reclaim the symbols of the rule which action triggered
4544 YY_STACK_PRINT (yyss, yyssp);
4549 /*-------------------------------------------------------------.
4550 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4551 `-------------------------------------------------------------*/
4553 yyerrstatus = 3; /* Each real token shifted decrements this. */
4557 yyn = yypact[yystate];
4558 if (yyn != YYPACT_NINF)
4561 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4569 /* Pop the current state because it cannot handle the error token. */
4574 yydestruct ("Error: popping",
4575 yystos[yystate], yyvsp);
4578 YY_STACK_PRINT (yyss, yyssp);
4584 /* Shift the error token. */
4585 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4591 /*-------------------------------------.
4592 | yyacceptlab -- YYACCEPT comes here. |
4593 `-------------------------------------*/
4598 /*-----------------------------------.
4599 | yyabortlab -- YYABORT comes here. |
4600 `-----------------------------------*/
4605 #if !defined(yyoverflow) || YYERROR_VERBOSE
4606 /*-------------------------------------------------.
4607 | yyexhaustedlab -- memory exhaustion comes here. |
4608 `-------------------------------------------------*/
4610 yyerror (YY_("memory exhausted"));
4616 if (yychar != YYEMPTY)
4617 yydestruct ("Cleanup: discarding lookahead",
4618 yytoken, &yylval);
4619 /* Do not reclaim the symbols of the rule which action triggered
4620 this YYABORT or YYACCEPT. */
4622 YY_STACK_PRINT (yyss, yyssp);
4623 while (yyssp != yyss)
4625 yydestruct ("Cleanup: popping",
4626 yystos[*yyssp], yyvsp);
4631 YYSTACK_FREE (yyss);
4634 if (yymsg != yymsgbuf)
4635 YYSTACK_FREE (yymsg);
4637 /* Make sure YYID is used. */
4638 return YYID (yyresult);
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">↓</span></a>
4648 <td class="function_entry_name">
4649 _asn1_expand_object_id
4651 <td class="function_entry_cyclo">
4654 <td class="function_entry_number">
4657 <td class="function_entry_number">
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>
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">
4669 _asn1_expand_object_id (ASN1_TYPE node)
4671 ASN1_TYPE p, p2, p3, p4, p5;
4672 char name_root[ASN1_MAX_NAME_SIZE], name2[2 * ASN1_MAX_NAME_SIZE + 1];
4676 return ASN1_ELEMENT_NOT_FOUND;
4678 _asn1_str_cpy (name_root, sizeof (name_root), node->name);
4683 while (!((p == node) && (move == UP)))
4687 if ((type_field (p->type) == TYPE_OBJECT_ID)
4688 && (p->type & CONST_ASSIGN))
4691 if (p2 && (type_field (p2->type) == TYPE_CONSTANT))
4693 if (p2->value && !isdigit (p2->value[0]))
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 & CONST_ASSIGN))
4701 return ASN1_ELEMENT_NOT_FOUND;
4702 _asn1_set_down (p, p2->right);
4703 _asn1_remove_node (p2);
4708 if (type_field (p4->type) == TYPE_CONSTANT)
4710 p5 = _asn1_add_node_only (TYPE_CONSTANT);
4711 _asn1_set_name (p5, p4->name);
4712 tlen = strlen (p4->value);
4714 _asn1_set_value (p5, p4->value, tlen + 1);
4717 _asn1_set_right (p5, p->down);
4718 _asn1_set_down (p, p5);
4722 _asn1_set_right (p5, p2->right);
4723 _asn1_set_right (p2, p5);
4761 p = _asn1_find_up (p);
4765 /*******************************/
4766 /* expand DEFAULT */
4767 /*******************************/
4771 while (!((p == node) && (move == UP)))
4775 if ((type_field (p->type) == TYPE_OBJECT_ID) &&
4776 (p->type & CONST_DEFAULT))
4779 if (p2 && (type_field (p2->type) == TYPE_DEFAULT))
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 & CONST_ASSIGN))
4787 return ASN1_ELEMENT_NOT_FOUND;
4792 if (type_field (p4->type) == TYPE_CONSTANT)
4795 _asn1_str_cat (name2, sizeof (name2), ".");
4796 _asn1_str_cat (name2, sizeof (name2), p4->value);
4800 tlen = strlen (name2);
4802 _asn1_set_value (p2, name2, tlen + 1);
4832 p = _asn1_find_up (p);
4835 return ASN1_SUCCESS;
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">↓</span></a>
4845 <td class="function_entry_name">
4848 <td class="function_entry_cyclo">
4851 <td class="function_entry_number">
4854 <td class="function_entry_number">
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>
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">
4868 int c,counter=0,k,lastc;
4869 char string[ASN1_MAX_NAME_SIZE+1]; /* will contain the next token */
4874 while((c=fgetc(file_asn1))==' ' || c=='\t' || c=='\n')
4875 if(c=='\n') lineNumber++;
4878 strcpy(lastToken,"End Of File");
4882 if(c=='(' || c==')' || c=='[' || c==']' ||
4883 c=='{' || c=='}' || c==',' || c=='.' ||
4885 lastToken[0]=c;lastToken[1]=0;
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;
4894 else{ /* Comments */
4897 /* A comment finishes at the next double hypen or the end of line */
4898 while((c=fgetc(file_asn1))!=EOF && c!='\n' &&
4899 (lastc!='-' || (lastc=='-' && c!='-')))
4902 strcpy(lastToken,"End Of File");
4906 if(c=='\n') lineNumber++;
4907 continue; /* next char, please! (repeat the search) */
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=='.'))
4917 if(counter>=ASN1_MAX_NAME_SIZE){
4918 result_parse=ASN1_NAME_TOO_LONG;
4921 string[counter++]=c;
4923 ungetc(c,file_asn1);
4925 strcpy(lastToken,string);
4927 /* Is STRING a number? */
4928 for(k=0;k<counter;k++)
4929 if(!isdigit(string[k])) break;
4932 strcpy(yylval.str,string);
4933 return NUM; /* return the number */
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];
4940 /* STRING is an IDENTIFIER */
4941 strcpy(yylval.str,string);
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">↓</span></a>
4953 <td class="function_entry_name">
4954 asn1_expand_any_defined_by
4956 <td class="function_entry_cyclo">
4959 <td class="function_entry_number">
4962 <td class="function_entry_number">
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>
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">
4974 asn1_expand_any_defined_by (ASN1_TYPE definitions, ASN1_TYPE * element)
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];
4983 if ((definitions == ASN1_TYPE_EMPTY) || (*element == ASN1_TYPE_EMPTY))
4984 return ASN1_ELEMENT_NOT_FOUND;
4986 strcpy (definitionsName, definitions->name);
4987 strcat (definitionsName, ".");
4993 switch (type_field (p->type))
4996 if ((p->type & CONST_DEFINED_BY) && (p->value))
4998 /* search the "DEF_BY" element */
5000 while ((p2) && (type_field (p2->type) != TYPE_CONSTANT))
5005 retCode = ASN1_ERROR_TYPE_ANY;
5009 p3 = _asn1_find_up (p);
5013 retCode = ASN1_ERROR_TYPE_ANY;
5020 if ((p3->name) && !(strcmp (p3->name, p2->name)))
5025 if ((!p3) || (type_field (p3->type) != TYPE_OBJECT_ID) ||
5026 (p3->value == NULL))
5029 p3 = _asn1_find_up (p);
5030 p3 = _asn1_find_up (p3);
5034 retCode = ASN1_ERROR_TYPE_ANY;
5042 if ((p3->name) && !(strcmp (p3->name, p2->name)))
5047 if ((!p3) || (type_field (p3->type) != TYPE_OBJECT_ID) ||
5048 (p3->value == NULL))
5050 retCode = ASN1_ERROR_TYPE_ANY;
5055 /* search the OBJECT_ID into definitions */
5056 p2 = definitions->down;
5059 if ((type_field (p2->type) == TYPE_OBJECT_ID) &&
5060 (p2->type & CONST_ASSIGN))
5062 strcpy (name, definitionsName);
5063 strcat (name, p2->name);
5065 len = ASN1_MAX_NAME_SIZE;
5067 asn1_read_value (definitions, name, value, &len);
5069 if ((result == ASN1_SUCCESS)
5070 && (!strcmp (p3->value, value)))
5072 p2 = p2->right; /* pointer to the structure to
5073 use for expansion */
5074 while ((p2) && (p2->type & CONST_ASSIGN))
5079 strcpy (name, definitionsName);
5080 strcat (name, p2->name);
5083 asn1_create_element (definitions, name, &aux);
5084 if (result == ASN1_SUCCESS)
5086 _asn1_set_name (aux, p->name);
5088 asn1_get_length_der (p->value,
5089 p->value_len, &len3);
5091 return ASN1_DER_ERROR;
5094 asn1_der_decoding (&aux, p->value + len3,
5097 if (result == ASN1_SUCCESS)
5100 _asn1_set_right (aux, p->right);
5101 _asn1_set_right (p, aux);
5103 result = asn1_delete_structure (&p);
5104 if (result == ASN1_SUCCESS)
5107 aux = ASN1_TYPE_EMPTY;
5111 { /* error with asn1_delete_structure */
5112 asn1_delete_structure (&aux);
5118 { /* error with asn1_der_decoding */
5124 { /* error with asn1_create_element */
5130 { /* error with the pointer to the structure to exapand */
5131 retCode = ASN1_ERROR_TYPE_ANY;
5141 retCode = ASN1_ERROR_TYPE_ANY;
5156 else if (p == *element)
5167 p = _asn1_find_up (p);
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">↓</span></a>
5192 <td class="function_entry_name">
5195 <td class="function_entry_cyclo">
5198 <td class="function_entry_number">
5201 <td class="function_entry_number">
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>
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">
5213 asn1_read_value (ASN1_TYPE root, const char *name, void *ivalue, int *len)
5215 ASN1_TYPE node, p, p2;
5217 int value_size = *len;
5218 unsigned char *value = ivalue;
5220 node = asn1_find_node (root, name);
5222 return ASN1_ELEMENT_NOT_FOUND;
5224 if ((type_field (node->type) != TYPE_NULL) &&
5225 (type_field (node->type) != TYPE_CHOICE) &&
5226 !(node->type & CONST_DEFAULT) && !(node->type & CONST_ASSIGN) &&
5227 (node->value == NULL))
5228 return ASN1_VALUE_NOT_FOUND;
5230 switch (type_field (node->type))
5233 PUT_STR_VALUE (value, value_size, "NULL");
5236 if ((node->type & CONST_DEFAULT) && (node->value == NULL))
5239 while (type_field (p->type) != TYPE_DEFAULT)
5241 if (p->type & CONST_TRUE)
5243 PUT_STR_VALUE (value, value_size, "TRUE");
5247 PUT_STR_VALUE (value, value_size, "FALSE");
5250 else if (node->value[0] == 'T')
5252 PUT_STR_VALUE (value, value_size, "TRUE");
5256 PUT_STR_VALUE (value, value_size, "FALSE");
5260 case TYPE_ENUMERATED:
5261 if ((node->type & CONST_DEFAULT) && (node->value == NULL))
5264 while (type_field (p->type) != TYPE_DEFAULT)
5266 if ((isdigit (p->value[0])) || (p->value[0] == '-')
5267 || (p->value[0] == '+'))
5269 if (_asn1_convert_integer
5270 (p->value, value, value_size, len) != ASN1_SUCCESS)
5271 return ASN1_MEM_ERROR;
5274 { /* is an identifier like v1 */
5278 if (type_field (p2->type) == TYPE_CONSTANT)
5280 if ((p2->name) && (!strcmp (p2->name, p->value)))
5282 if (_asn1_convert_integer
5283 (p2->value, value, value_size,
5284 len) != ASN1_SUCCESS)
5285 return ASN1_MEM_ERROR;
5296 if (asn1_get_octet_der
5297 (node->value, node->value_len, &len2, value, value_size,
5298 len) != ASN1_SUCCESS)
5299 return ASN1_MEM_ERROR;
5302 case TYPE_OBJECT_ID:
5303 if (node->type & CONST_ASSIGN)
5309 if (type_field (p->type) == TYPE_CONSTANT)
5311 ADD_STR_VALUE (value, value_size, p->value);
5314 ADD_STR_VALUE (value, value_size, ".");
5319 *len = strlen (value) + 1;
5321 else if ((node->type & CONST_DEFAULT) && (node->value == NULL))
5324 while (type_field (p->type) != TYPE_DEFAULT)
5326 PUT_STR_VALUE (value, value_size, p->value);
5330 PUT_STR_VALUE (value, value_size, node->value);
5334 PUT_STR_VALUE (value, value_size, node->value);
5336 case TYPE_OCTET_STRING:
5338 if (asn1_get_octet_der
5339 (node->value, node->value_len, &len2, value, value_size,
5340 len) != ASN1_SUCCESS)
5341 return ASN1_MEM_ERROR;
5343 case TYPE_GENERALSTRING:
5345 if (asn1_get_octet_der
5346 (node->value, node->value_len, &len2, value, value_size,
5347 len) != ASN1_SUCCESS)
5348 return ASN1_MEM_ERROR;
5350 case TYPE_BIT_STRING:
5352 if (asn1_get_bit_der
5353 (node->value, node->value_len, &len2, value, value_size,
5354 len) != ASN1_SUCCESS)
5355 return ASN1_MEM_ERROR;
5358 PUT_STR_VALUE (value, value_size, node->down->name);
5362 len2 = asn1_get_length_der (node->value, node->value_len, &len3);
5364 return ASN1_DER_ERROR;
5365 PUT_VALUE (value, value_size, node->value + len3, len2);
5368 return ASN1_ELEMENT_NOT_FOUND;
5371 return ASN1_SUCCESS;
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">↓</span></a>
5381 <td class="function_entry_name">
5382 _asn1_check_identifier
5384 <td class="function_entry_cyclo">
5387 <td class="function_entry_number">
5390 <td class="function_entry_number">
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>
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">
5402 _asn1_check_identifier (ASN1_TYPE node)
5405 char name2[ASN1_MAX_NAME_SIZE * 2 + 2];
5408 return ASN1_ELEMENT_NOT_FOUND;
5413 if (type_field (p->type) == TYPE_IDENTIFIER)
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);
5421 strcpy (_asn1_identifierMissing, p->value);
5422 return ASN1_IDENTIFIER_NOT_FOUND;
5425 else if ((type_field (p->type) == TYPE_OBJECT_ID) &&
5426 (p->type & CONST_DEFAULT))
5429 if (p2 && (type_field (p2->type) == TYPE_DEFAULT))
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 & CONST_ASSIGN))
5438 return ASN1_IDENTIFIER_NOT_FOUND;
5440 _asn1_identifierMissing[0] = 0;
5443 else if ((type_field (p->type) == TYPE_OBJECT_ID) &&
5444 (p->type & CONST_ASSIGN))
5447 if (p2 && (type_field (p2->type) == TYPE_CONSTANT))
5449 if (p2->value && !isdigit (p2->value[0]))
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 & CONST_ASSIGN))
5458 return ASN1_IDENTIFIER_NOT_FOUND;
5460 _asn1_identifierMissing[0] = 0;
5475 p = _asn1_find_up (p);
5490 return ASN1_SUCCESS;
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">↓</span></a>
5500 <td class="function_entry_name">
5501 _asn1_expand_identifier
5503 <td class="function_entry_cyclo">
5506 <td class="function_entry_number">
5509 <td class="function_entry_number">
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>
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">
5521 _asn1_expand_identifier (ASN1_TYPE * node, ASN1_TYPE root)
5523 ASN1_TYPE p, p2, p3;
5524 char name2[ASN1_MAX_NAME_SIZE + 2];
5528 return ASN1_ELEMENT_NOT_FOUND;
5533 while (!((p == *node) && (move == UP)))
5537 if (type_field (p->type) == TYPE_IDENTIFIER)
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);
5545 return ASN1_IDENTIFIER_NOT_FOUND;
5547 _asn1_set_name (p2, p->name);
5548 p2->right = p->right;
5551 p->right->left = p2;
5557 _asn1_set_right (p3, p2->down);
5558 _asn1_set_down (p2, p->down);
5561 p3 = _asn1_find_left (p);
5563 _asn1_set_right (p3, p2);
5566 p3 = _asn1_find_up (p);
5568 _asn1_set_down (p3, p2);
5575 if (p->type & CONST_SIZE)
5576 p2->type |= CONST_SIZE;
5577 if (p->type & CONST_TAG)
5578 p2->type |= CONST_TAG;
5579 if (p->type & CONST_OPTION)
5580 p2->type |= CONST_OPTION;
5581 if (p->type & CONST_DEFAULT)
5582 p2->type |= CONST_DEFAULT;
5583 if (p->type & CONST_SET)
5584 p2->type |= CONST_SET;
5585 if (p->type & CONST_NOT_USED)
5586 p2->type |= CONST_NOT_USED;
5590 _asn1_remove_node (p);
5622 p = _asn1_find_up (p);
5625 return ASN1_SUCCESS;
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">↓</span></a>
5635 <td class="function_entry_name">
5636 _asn1_ordering_set_of
5638 <td class="function_entry_cyclo">
5641 <td class="function_entry_number">
5644 <td class="function_entry_number">
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>
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">
5656 _asn1_ordering_set_of (unsigned char *der, int der_len, ASN1_TYPE node)
5661 struct vet *next, *prev;
5664 int counter, len, len2, change;
5665 struct vet *first, *last, *p_vet, *p2_vet;
5667 unsigned char *temp, class;
5668 unsigned long k, max;
5672 if (type_field (node->type) != TYPE_SET_OF)
5676 while ((type_field (p->type) == TYPE_TAG)
5677 || (type_field (p->type) == TYPE_SIZE))
5681 if ((p == NULL) || (p->right == NULL))
5684 first = last = NULL;
5687 p_vet = (struct vet *) _asn1_malloc (sizeof (struct vet));
5699 /* extraction of tag and length */
5700 if (der_len - counter > 0)
5703 if (asn1_get_tag_der
5704 (der + counter, der_len - counter, &class, &len,
5705 NULL) != ASN1_SUCCESS)
5709 len2 = asn1_get_length_der (der + counter, der_len - counter, &len);
5712 counter += len + len2;
5715 p_vet->end = counter;
5723 p2_vet = p_vet->next;
5727 if ((p_vet->end - counter) > (p2_vet->end - p_vet->end))
5728 max = p_vet->end - counter;
5730 max = p2_vet->end - p_vet->end;
5733 for (k = 0; k < max; k++)
5734 if (der[counter + k] > der[p_vet->end + k])
5739 else if (der[counter + k] < der[p_vet->end + k])
5746 && ((p_vet->end - counter) > (p2_vet->end - p_vet->end)))
5751 /* change position */
5752 temp = (unsigned char *) _asn1_malloc (p_vet->end - counter);
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);
5763 p_vet->end = counter + (p2_vet->end - p_vet->end);
5765 counter = p_vet->end;
5767 p2_vet = p2_vet->next;
5768 p_vet = p_vet->next;
5772 p_vet->prev->next = NULL;
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">↓</span></a>
5787 <td class="function_entry_name">
5788 asn1_expand_octet_string
5790 <td class="function_entry_cyclo">
5793 <td class="function_entry_number">
5796 <td class="function_entry_number">
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>
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">
5808 asn1_expand_octet_string (ASN1_TYPE definitions, ASN1_TYPE * element,
5809 const char *octetName, const char *objectName)
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];
5818 if ((definitions == ASN1_TYPE_EMPTY) || (*element == ASN1_TYPE_EMPTY))
5819 return ASN1_ELEMENT_NOT_FOUND;
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;
5829 objectNode = asn1_find_node (*element, objectName);
5830 if (objectNode == ASN1_TYPE_EMPTY)
5831 return ASN1_ELEMENT_NOT_FOUND;
5833 if (type_field (objectNode->type) != TYPE_OBJECT_ID)
5834 return ASN1_ELEMENT_NOT_FOUND;
5836 if (objectNode->value == NULL)
5837 return ASN1_VALUE_NOT_FOUND;
5840 /* search the OBJECT_ID into definitions */
5841 p2 = definitions->down;
5844 if ((type_field (p2->type) == TYPE_OBJECT_ID) &&
5845 (p2->type & CONST_ASSIGN))
5847 strcpy (name, definitions->name);
5849 strcat (name, p2->name);
5851 len = sizeof (value);
5852 result = asn1_read_value (definitions, name, value, &len);
5854 if ((result == ASN1_SUCCESS)
5855 && (!strcmp (objectNode->value, value)))
5858 p2 = p2->right; /* pointer to the structure to
5859 use for expansion */
5860 while ((p2) && (p2->type & CONST_ASSIGN))
5865 strcpy (name, definitions->name);
5867 strcat (name, p2->name);
5869 result = asn1_create_element (definitions, name, &aux);
5870 if (result == ASN1_SUCCESS)
5872 _asn1_set_name (aux, octetNode->name);
5874 asn1_get_length_der (octetNode->value,
5875 octetNode->value_len, &len3);
5877 return ASN1_DER_ERROR;
5880 asn1_der_decoding (&aux, octetNode->value + len3,
5881 len2, errorDescription);
5882 if (result == ASN1_SUCCESS)
5885 _asn1_set_right (aux, octetNode->right);
5886 _asn1_set_right (octetNode, aux);
5888 result = asn1_delete_structure (&octetNode);
5889 if (result == ASN1_SUCCESS)
5891 aux = ASN1_TYPE_EMPTY;
5895 { /* error with asn1_delete_structure */
5896 asn1_delete_structure (&aux);
5902 { /* error with asn1_der_decoding */
5908 { /* error with asn1_create_element */
5914 { /* error with the pointer to the structure to exapand */
5915 retCode = ASN1_VALUE_NOT_VALID;
5926 retCode = ASN1_VALUE_NOT_VALID;
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">↓</span></a>
5938 <td class="function_entry_name">
5941 <td class="function_entry_cyclo">
5944 <td class="function_entry_number">
5947 <td class="function_entry_number">
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>
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">
5959 asn1_array2tree (const ASN1_ARRAY_TYPE * array, ASN1_TYPE * definitions,
5960 char *errorDescription)
5962 ASN1_TYPE p, p_last = NULL;
5965 asn1_retCode result;
5968 if (*definitions != ASN1_TYPE_EMPTY)
5969 return ASN1_ELEMENT_NOT_EMPTY;
5974 while (array[k].value || array[k].type || array[k].name)
5976 p = _asn1_add_node (array[k].type & (~CONST_DOWN));
5978 _asn1_set_name (p, array[k].name);
5980 _asn1_set_value (p, array[k].value, strlen (array[k].value) + 1);
5982 if (*definitions == NULL)
5986 _asn1_set_down (p_last, p);
5987 else if (move == RIGHT)
5988 _asn1_set_right (p_last, p);
5992 if (array[k].type & CONST_DOWN)
5994 else if (array[k].type & CONST_RIGHT)
6000 if (p_last == *definitions)
6003 p_last = _asn1_find_up (p_last);
6008 if (p_last->type & CONST_RIGHT)
6010 p_last->type &= ~CONST_RIGHT;
6019 if (p_last == *definitions)
6021 result = _asn1_check_identifier (*definitions);
6022 if (result == ASN1_SUCCESS)
6024 _asn1_change_integer_value (*definitions);
6025 _asn1_expand_object_id (*definitions);
6030 result = ASN1_ARRAY_ERROR;
6033 if (errorDescription != NULL)
6035 if (result == ASN1_IDENTIFIER_NOT_FOUND)
6037 Estrcpy (errorDescription, ":: identifier '");
6038 Estrcat (errorDescription, _asn1_identifierMissing);
6039 Estrcat (errorDescription, "' not found");
6042 errorDescription[0] = 0;
6045 if (result != ASN1_SUCCESS)
6047 _asn1_delete_list_and_nodes ();
6048 *definitions = ASN1_TYPE_EMPTY;
6051 _asn1_delete_list ();
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">↓</span></a>
6063 <td class="function_entry_name">
6064 _asn1_insert_tag_der
6066 <td class="function_entry_cyclo">
6069 <td class="function_entry_number">
6072 <td class="function_entry_number">
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>
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">
6084 _asn1_insert_tag_der (ASN1_TYPE node, unsigned char *der, int *counter,
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];
6093 is_tag_implicit = 0;
6095 if (node->type & CONST_TAG)
6100 if (type_field (p->type) == TYPE_TAG)
6102 if (p->type & CONST_APPLICATION)
6103 class = ASN1_CLASS_APPLICATION;
6104 else if (p->type & CONST_UNIVERSAL)
6105 class = ASN1_CLASS_UNIVERSAL;
6106 else if (p->type & CONST_PRIVATE)
6107 class = ASN1_CLASS_PRIVATE;
6109 class = ASN1_CLASS_CONTEXT_SPECIFIC;
6111 if (p->type & CONST_EXPLICIT)
6113 if (is_tag_implicit)
6114 _asn1_tag_der (class_implicit, tag_implicit, tag_der,
6117 _asn1_tag_der (class | ASN1_CLASS_STRUCTURED,
6118 strtoul (p->value, NULL, 10), tag_der,
6121 *max_len -= tag_len;
6123 memcpy (der + *counter, tag_der, tag_len);
6124 *counter += tag_len;
6126 _asn1_ltostr (*counter, temp);
6127 _asn1_set_name (p, temp);
6129 is_tag_implicit = 0;
6132 { /* CONST_IMPLICIT */
6133 if (!is_tag_implicit)
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;
6150 if (is_tag_implicit)
6152 _asn1_tag_der (class_implicit, tag_implicit, tag_der, &tag_len);
6156 switch (type_field (node->type))
6159 _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_NULL, tag_der,
6163 _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_BOOLEAN, tag_der,
6167 _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_INTEGER, tag_der,
6170 case TYPE_ENUMERATED:
6171 _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_ENUMERATED, tag_der,
6174 case TYPE_OBJECT_ID:
6175 _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_OBJECT_ID, tag_der,
6179 if (node->type & CONST_UTC)
6181 _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_UTCTime, tag_der,
6185 _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_GENERALIZEDTime,
6186 tag_der, &tag_len);
6188 case TYPE_OCTET_STRING:
6189 _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_OCTET_STRING, tag_der,
6192 case TYPE_GENERALSTRING:
6193 _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_GENERALSTRING,
6194 tag_der, &tag_len);
6196 case TYPE_BIT_STRING:
6197 _asn1_tag_der (ASN1_CLASS_UNIVERSAL, ASN1_TAG_BIT_STRING, tag_der,
6201 case TYPE_SEQUENCE_OF:
6202 _asn1_tag_der (ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED,
6203 ASN1_TAG_SEQUENCE, tag_der, &tag_len);
6207 _asn1_tag_der (ASN1_CLASS_UNIVERSAL | ASN1_CLASS_STRUCTURED,
6208 ASN1_TAG_SET, tag_der, &tag_len);
6220 return ASN1_GENERIC_ERROR;
6224 *max_len -= tag_len;
6226 memcpy (der + *counter, tag_der, tag_len);
6227 *counter += tag_len;
6230 return ASN1_MEM_ERROR;
6232 return ASN1_SUCCESS;
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">↓</span></a>
6242 <td class="function_entry_name">
6245 <td class="function_entry_cyclo">
6248 <td class="function_entry_number">
6251 <td class="function_entry_number">
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>
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">
6263 asn1_find_node (ASN1_TYPE pointer, const char *name)
6266 char *n_end, n[ASN1_MAX_NAME_SIZE + 1];
6267 const char *n_start;
6269 if (pointer == NULL)
6278 if (p->name != NULL)
6279 { /* has *pointer got a name ? */
6280 n_end = strchr (n_start, '.'); /* search the first dot */
6283 memcpy (n, n_start, n_end - n_start);
6284 n[n_end - n_start] = 0;
6290 _asn1_str_cpy (n, sizeof (n), n_start);
6296 if ((p->name) && (!strcmp (p->name, n)))
6306 { /* *pointer doesn't have a name */
6307 if (n_start[0] == 0)
6312 { /* Has the end of NAME been reached? */
6313 n_end = strchr (n_start, '.'); /* search the next dot */
6316 memcpy (n, n_start, n_end - n_start);
6317 n[n_end - n_start] = 0;
6323 _asn1_str_cpy (n, sizeof (n), n_start);
6327 if (p->down == NULL)
6332 /* The identifier "?LAST" indicates the last element
6333 in the right chain. */
6334 if (!strcmp (n, "?LAST"))
6345 if ((p->name) && (!strcmp (p->name, n)))
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">↓</span></a>
6365 <td class="function_entry_name">
6366 _asn1_type_choice_config
6368 <td class="function_entry_cyclo">
6371 <td class="function_entry_number">
6374 <td class="function_entry_number">
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>
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">
6386 _asn1_type_choice_config (ASN1_TYPE node)
6388 ASN1_TYPE p, p2, p3, p4;
6392 return ASN1_ELEMENT_NOT_FOUND;
6397 while (!((p == node) && (move == UP)))
6401 if ((type_field (p->type) == TYPE_CHOICE) && (p->type & CONST_TAG))
6406 if (type_field (p2->type) != TYPE_TAG)
6408 p2->type |= CONST_TAG;
6409 p3 = _asn1_find_left (p2);
6412 if (type_field (p3->type) == TYPE_TAG)
6414 p4 = _asn1_add_node_only (p3->type);
6415 tlen = strlen (p3->value);
6417 _asn1_set_value (p4, p3->value, tlen + 1);
6418 _asn1_set_right (p4, p2->down);
6419 _asn1_set_down (p2, p4);
6421 p3 = _asn1_find_left (p3);
6426 p->type &= ~(CONST_TAG);
6431 if (type_field (p2->type) == TYPE_TAG)
6432 asn1_delete_structure (&p2);
6463 p = _asn1_find_up (p);
6466 return ASN1_SUCCESS;
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">↓</span></a>
6476 <td class="function_entry_name">
6477 _asn1_get_octet_string
6479 <td class="function_entry_cyclo">
6482 <td class="function_entry_number">
6485 <td class="function_entry_number">
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>
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">
6497 _asn1_get_octet_string (const unsigned char *der, ASN1_TYPE node, int *len)
6499 int len2, len3, counter, tot_len, indefinite;
6503 if (*(der - 1) & ASN1_CLASS_STRUCTURED)
6506 indefinite = asn1_get_length_der (der, *len, &len3);
6507 if (indefinite < -1)
6508 return ASN1_DER_ERROR;
6511 if (indefinite >= 0)
6516 if (counter > (*len))
6517 return ASN1_DER_ERROR;
6519 if (indefinite == -1)
6521 if ((der[counter] == 0) && (der[counter + 1] == 0))
6527 else if (counter >= indefinite)
6530 if (der[counter] != ASN1_TAG_OCTET_STRING)
6531 return ASN1_DER_ERROR;
6535 len2 = asn1_get_length_der (der + counter, *len - counter, &len3);
6537 return ASN1_DER_ERROR;
6539 counter += len3 + len2;
6546 unsigned char temp[DER_LEN];
6549 len2 = sizeof (temp);
6551 asn1_length_der (tot_len, temp, &len2);
6552 _asn1_set_value (node, temp, len2);
6556 ret = _asn1_extract_der_octet (node, der, *len);
6557 if (ret != ASN1_SUCCESS)
6563 { /* NOT STRUCTURED */
6564 len2 = asn1_get_length_der (der, *len, &len3);
6566 return ASN1_DER_ERROR;
6567 if (len3 + len2 > *len)
6568 return ASN1_DER_ERROR;
6570 _asn1_set_value (node, der, len3 + len2);
6571 counter = len3 + len2;
6575 return ASN1_SUCCESS;
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">↓</span></a>
6586 <td class="function_entry_name">
6589 <td class="function_entry_cyclo">
6592 <td class="function_entry_number">
6595 <td class="function_entry_number">
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>
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">
6607 _asn1_ordering_set (unsigned char *der, int der_len, ASN1_TYPE node)
6612 unsigned long value;
6613 struct vet *next, *prev;
6616 int counter, len, len2;
6617 struct vet *first, *last, *p_vet, *p2_vet;
6619 unsigned char class, *temp;
6624 if (type_field (node->type) != TYPE_SET)
6628 while ((type_field (p->type) == TYPE_TAG)
6629 || (type_field (p->type) == TYPE_SIZE))
6632 if ((p == NULL) || (p->right == NULL))
6635 first = last = NULL;
6638 p_vet = (struct vet *) _asn1_malloc (sizeof (struct vet));
6650 /* tag value calculation */
6651 if (asn1_get_tag_der
6652 (der + counter, der_len - counter, &class, &len2,
6653 &tag) != ASN1_SUCCESS)
6655 p_vet->value = (class << 24) | tag;
6658 /* extraction and length */
6659 len2 = asn1_get_length_der (der + counter, der_len - counter, &len);
6662 counter += len + len2;
6664 p_vet->end = counter;
6672 p2_vet = p_vet->next;
6676 if (p_vet->value > p2_vet->value)
6678 /* change position */
6679 temp = (unsigned char *) _asn1_malloc (p_vet->end - counter);
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);
6691 p_vet->value = p2_vet->value;
6692 p2_vet->value = tag;
6694 p_vet->end = counter + (p2_vet->end - p_vet->end);
6696 counter = p_vet->end;
6698 p2_vet = p2_vet->next;
6699 p_vet = p_vet->next;
6703 p_vet->prev->next = NULL;
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">↓</span></a>
6718 <td class="function_entry_name">
6721 <td class="function_entry_cyclo">
6724 <td class="function_entry_number">
6727 <td class="function_entry_number">
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>
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">
6739 yysyntax_error (char *yyresult, int yystate, int yychar)
6741 int yyn = yypact[yystate];
6743 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
6747 int yytype = YYTRANSLATE (yychar);
6748 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
6749 YYSIZE_T yysize = yysize0;
6751 int yysize_overflow = 0;
6752 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
6753 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
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");
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;
6776 /* Start YYX at -YYN if negative to avoid negative indexes in
6778 int yyxbegin = yyn < 0 ? -yyn : 0;
6780 /* Stay within bounds of both yycheck and yytname. */
6781 int yychecklim = YYLAST - yyn + 1;
6782 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
6785 yyarg[0] = yytname[yytype];
6786 yyfmt = yystpcpy (yyformat, yyunexpected);
6788 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
6789 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
6791 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
6795 yyformat[sizeof yyunexpected - 1] = '\0';
6798 yyarg[yycount++] = yytname[yyx];
6799 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
6800 yysize_overflow |= (yysize1 < yysize);
6802 yyfmt = yystpcpy (yyfmt, yyprefix);
6806 yyf = YY_(yyformat);
6807 yysize1 = yysize + yystrlen (yyf);
6808 yysize_overflow |= (yysize1 < yysize);
6811 if (yysize_overflow)
6812 return YYSIZE_MAXIMUM;
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;
6821 while ((*yyp = *yyf) != '\0')
6823 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
6825 yyp += yytnamerr (yyp, yyarg[yyi++]);
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">↓</span></a>
6846 <td class="function_entry_name">
6847 _asn1_convert_integer
6849 <td class="function_entry_cyclo">
6852 <td class="function_entry_number">
6855 <td class="function_entry_number">
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>
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">
6867 _asn1_convert_integer (const char *value, unsigned char *value_out,
6868 int value_out_size, int *len)
6871 unsigned char val[SIZEOF_UNSIGNED_LONG_INT];
6875 valtmp = strtol (value, NULL, 10);
6877 for (k = 0; k < SIZEOF_UNSIGNED_LONG_INT; k++)
6879 val[SIZEOF_UNSIGNED_LONG_INT - k - 1] = (valtmp >> (8 * k)) & 0xFF;
6882 if (val[0] & 0x80)
6887 for (k = 0; k < SIZEOF_UNSIGNED_LONG_INT - 1; k++)
6889 if (negative && (val[k] != 0xFF))
6891 else if (!negative && val[k])
6895 if ((negative && !(val[k] & 0x80)) || (!negative && (val[k] & 0x80)))
6898 *len = SIZEOF_UNSIGNED_LONG_INT - k;
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;
6904 for (k2 = k; k2 < SIZEOF_UNSIGNED_LONG_INT; k2++)
6905 value_out[k2 - k] = val[k2];
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]);
6914 return ASN1_SUCCESS;
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">↓</span></a>
6924 <td class="function_entry_name">
6927 <td class="function_entry_cyclo">
6930 <td class="function_entry_number">
6933 <td class="function_entry_number">
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>
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">
6945 asn1_read_tag (ASN1_TYPE root, const char *name, int *tagValue,
6948 ASN1_TYPE node, p, pTag;
6950 node = asn1_find_node (root, name);
6952 return ASN1_ELEMENT_NOT_FOUND;
6956 /* pTag will points to the IMPLICIT TAG */
6958 if (node->type & CONST_TAG)
6962 if (type_field (p->type) == TYPE_TAG)
6964 if ((p->type & CONST_IMPLICIT) && (pTag == NULL))
6966 else if (p->type & CONST_EXPLICIT)
6975 *tagValue = strtoul (pTag->value, NULL, 10);
6977 if (pTag->type & CONST_APPLICATION)
6978 *classValue = ASN1_CLASS_APPLICATION;
6979 else if (pTag->type & CONST_UNIVERSAL)
6980 *classValue = ASN1_CLASS_UNIVERSAL;
6981 else if (pTag->type & CONST_PRIVATE)
6982 *classValue = ASN1_CLASS_PRIVATE;
6984 *classValue = ASN1_CLASS_CONTEXT_SPECIFIC;
6988 *classValue = ASN1_CLASS_UNIVERSAL;
6990 switch (type_field (node->type))
6993 *tagValue = ASN1_TAG_NULL;
6996 *tagValue = ASN1_TAG_BOOLEAN;
6999 *tagValue = ASN1_TAG_INTEGER;
7001 case TYPE_ENUMERATED:
7002 *tagValue = ASN1_TAG_ENUMERATED;
7004 case TYPE_OBJECT_ID:
7005 *tagValue = ASN1_TAG_OBJECT_ID;
7008 if (node->type & CONST_UTC)
7010 *tagValue = ASN1_TAG_UTCTime;
7013 *tagValue = ASN1_TAG_GENERALIZEDTime;
7015 case TYPE_OCTET_STRING:
7016 *tagValue = ASN1_TAG_OCTET_STRING;
7018 case TYPE_GENERALSTRING:
7019 *tagValue = ASN1_TAG_GENERALSTRING;
7021 case TYPE_BIT_STRING:
7022 *tagValue = ASN1_TAG_BIT_STRING;
7025 case TYPE_SEQUENCE_OF:
7026 *tagValue = ASN1_TAG_SEQUENCE;
7030 *tagValue = ASN1_TAG_SET;
7042 return ASN1_SUCCESS;
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">↓</span></a>
7053 <td class="function_entry_name">
7056 <td class="function_entry_cyclo">
7059 <td class="function_entry_number">
7062 <td class="function_entry_number">
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>
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">
7074 _asn1_objectid_der (unsigned char *str, unsigned char *der, int *der_len)
7076 int len_len, counter, k, first, max_len;
7077 char *temp, *n_end, *n_start;
7079 unsigned long val, val1 = 0;
7083 temp = (char *) _asn1_malloc (strlen (str) + 2);
7085 return ASN1_MEM_ALLOC_ERROR;
7092 while ((n_end = strchr (n_start, '.')))
7095 val = strtoul (n_start, NULL, 10);
7100 else if (counter == 2)
7103 der[0] = 40 * val1 + val;
7109 for (k = 4; k >= 0; k--)
7111 bit7 = (val >> (k * 7)) & 0x7F;
7112 if (bit7 || first || !k)
7116 if (max_len > (*der_len))
7117 der[*der_len] = bit7;
7124 n_start = n_end + 1;
7127 asn1_length_der (*der_len, NULL, &len_len);
7128 if (max_len >= (*der_len + len_len))
7130 memmove (der + len_len, der, *der_len);
7131 asn1_length_der (*der_len, der, &len_len);
7133 *der_len += len_len;
7137 if (max_len < (*der_len))
7138 return ASN1_MEM_ERROR;
7140 return ASN1_SUCCESS;
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">↓</span></a>
7150 <td class="function_entry_name">
7151 _asn1_type_set_config
7153 <td class="function_entry_cyclo">
7156 <td class="function_entry_number">
7159 <td class="function_entry_number">
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>
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">
7171 _asn1_type_set_config (ASN1_TYPE node)
7177 return ASN1_ELEMENT_NOT_FOUND;
7182 while (!((p == node) && (move == UP)))
7186 if (type_field (p->type) == TYPE_SET)
7191 if (type_field (p2->type) != TYPE_TAG)
7192 p2->type |= CONST_SET | CONST_NOT_USED;
7223 p = _asn1_find_up (p);
7226 return ASN1_SUCCESS;
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">↓</span></a>
7236 <td class="function_entry_name">
7237 _asn1_get_objectid_der
7239 <td class="function_entry_cyclo">
7242 <td class="function_entry_number">
7245 <td class="function_entry_number">
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>
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">
7257 _asn1_get_objectid_der (const unsigned char *der, int der_len, int *ret_len,
7258 char *str, int str_size)
7260 int len_len, len, k;
7263 unsigned long val, val1, prev_val;
7266 if (str && str_size > 0)
7267 str[0] = 0; /* no oid */
7269 if (str == NULL || der_len <= 0)
7270 return ASN1_GENERIC_ERROR;
7271 len = asn1_get_length_der (der, der_len, &len_len);
7273 if (len < 0 || len > der_len || len_len > der_len)
7274 return ASN1_DER_ERROR;
7276 val1 = der[len_len] / 40;
7277 val = der[len_len] - val1 * 40;
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));
7286 for (k = 1; k < len; k++)
7288 /* X.690 mandates that the leading byte must never be 0x80
7290 if (leading != 0 && der[len_len + k] == 0x80)
7291 return ASN1_DER_ERROR;
7294 /* check for wrap around */
7296 val |= der[len_len + k] & 0x7F;
7299 return ASN1_DER_ERROR;
7303 if (!(der[len_len + k] & 0x80))
7305 _asn1_str_cat (str, str_size, ".");
7306 _asn1_str_cat (str, str_size, _asn1_ltostr (val, temp));
7312 *ret_len = len + len_len;
7314 return ASN1_SUCCESS;
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">↓</span></a>
7324 <td class="function_entry_name">
7325 _asn1_delete_not_used
7327 <td class="function_entry_cyclo">
7330 <td class="function_entry_number">
7333 <td class="function_entry_number">
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>
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">
7345 _asn1_delete_not_used (ASN1_TYPE node)
7350 return ASN1_ELEMENT_NOT_FOUND;
7355 if (p->type & CONST_NOT_USED)
7360 p2 = _asn1_find_left (p);
7362 p2 = _asn1_find_up (p);
7364 asn1_delete_structure (&p);
7369 break; /* reach node */
7385 p = _asn1_find_up (p);
7400 return ASN1_SUCCESS;
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">↓</span></a>
7410 <td class="function_entry_name">
7411 _asn1_set_default_tag
7413 <td class="function_entry_cyclo">
7416 <td class="function_entry_number">
7419 <td class="function_entry_number">
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>
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">
7431 _asn1_set_default_tag (ASN1_TYPE node)
7435 if ((node == NULL) || (type_field (node->type) != TYPE_DEFINITIONS))
7436 return ASN1_ELEMENT_NOT_FOUND;
7441 if ((type_field (p->type) == TYPE_TAG) &&
7442 !(p->type & CONST_EXPLICIT) && !(p->type & CONST_IMPLICIT))
7444 if (node->type & CONST_EXPLICIT)
7445 p->type |= CONST_EXPLICIT;
7447 p->type |= CONST_IMPLICIT;
7460 p = _asn1_find_up (p);
7475 return ASN1_SUCCESS;
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">↓</span></a>
7485 <td class="function_entry_name">
7486 _asn1_create_static_structure
7488 <td class="function_entry_cyclo">
7491 <td class="function_entry_number">
7494 <td class="function_entry_number">
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>
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">
7506 _asn1_create_static_structure (ASN1_TYPE pointer, char *output_file_name,
7513 file = fopen (output_file_name, "w");
7516 return ASN1_FILE_NOT_FOUND;
7518 fprintf (file, "#if HAVE_CONFIG_H\n");
7519 fprintf (file, "# include \"config.h\"\n");
7520 fprintf (file, "#endif\n\n");
7522 fprintf (file, "#include <libtasn1.h>\n\n");
7524 fprintf (file, "const ASN1_ARRAY_TYPE %s[] = {\n", vector_name);
7530 fprintf (file, " { ");
7533 fprintf (file, "\"%s\", ", p->name);
7535 fprintf (file, "NULL, ");
7543 fprintf (file, "%lu, ", t);
7546 fprintf (file, "\"%s\"},\n", p->value);
7548 fprintf (file, "NULL },\n");
7562 p = _asn1_find_up (p);
7577 fprintf (file, " { NULL, 0, NULL }\n};\n");
7581 return ASN1_SUCCESS;
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">↓</span></a>
7591 <td class="function_entry_name">
7592 _asn1_copy_structure3
7594 <td class="function_entry_cyclo">
7597 <td class="function_entry_number">
7600 <td class="function_entry_number">
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>
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">
7612 _asn1_copy_structure3 (ASN1_TYPE source_node)
7614 ASN1_TYPE dest_node, p_s, p_d, p_d_prev;
7617 if (source_node == NULL)
7620 dest_node = _asn1_add_node_only (source_node->type);
7632 _asn1_set_name (p_d, p_s->name);
7634 _asn1_set_value (p_d, p_s->value, p_s->value_len);
7646 p_d = _asn1_add_node_only (p_s->type);
7647 _asn1_set_down (p_d_prev, p_d);
7653 if (p_s == source_node)
7662 p_d = _asn1_add_node_only (p_s->type);
7663 _asn1_set_right (p_d_prev, p_d);
7670 p_s = _asn1_find_up (p_s);
7671 p_d = _asn1_find_up (p_d);
7674 while (p_s != source_node);
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">↓</span></a>
7686 <td class="function_entry_name">
7687 _asn1_change_integer_value
7689 <td class="function_entry_cyclo">
7692 <td class="function_entry_number">
7695 <td class="function_entry_number">
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>
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">
7707 _asn1_change_integer_value (ASN1_TYPE node)
7710 unsigned char val[SIZEOF_UNSIGNED_LONG_INT];
7711 unsigned char val2[SIZEOF_UNSIGNED_LONG_INT + 1];
7715 return ASN1_ELEMENT_NOT_FOUND;
7720 if ((type_field (p->type) == TYPE_INTEGER) && (p->type & CONST_ASSIGN))
7724 _asn1_convert_integer (p->value, val, sizeof (val), &len);
7725 asn1_octet_der (val, len, val2, &len);
7726 _asn1_set_value (p, val2, len);
7744 p = _asn1_find_up (p);
7760 return ASN1_SUCCESS;
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">↓</span></a>
7770 <td class="function_entry_name">
7773 <td class="function_entry_cyclo">
7776 <td class="function_entry_number">
7779 <td class="function_entry_number">
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>
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">
7791 asn1_get_tag_der (const unsigned char *der, int der_len,
7792 unsigned char *cls, int *len, unsigned long *tag)
7796 if (der == NULL || der_len < 2 || len == NULL)
7797 return ASN1_DER_ERROR;
7799 *cls = der[0] & 0xE0;
7800 if ((der[0] & 0x1F) != 0x1F)
7804 ris = der[0] & 0x1F;
7811 while (punt <= der_len && der[punt] & 128)
7814 ris = ris * 128 + (der[punt++] & 0x7F);
7816 /* wrapper around, and no bignums... */
7817 return ASN1_DER_ERROR;
7819 if (punt >= der_len)
7820 return ASN1_DER_ERROR;
7823 ris = ris * 128 + (der[punt++] & 0x7F);
7825 /* wrapper around, and no bignums... */
7826 return ASN1_DER_ERROR;
7832 return ASN1_SUCCESS;
7838 <tr class="function_entry_simple">
7839 <td class="function_entry_filename">
7842 <td class="function_entry_name">
7843 _asn1_get_indefinite_length_string
7845 <td class="function_entry_cyclo">
7848 <td class="function_entry_number">
7851 <td class="function_entry_number">
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>
7858 <tr class="function_entry_simple">
7859 <td class="function_entry_filename">
7862 <td class="function_entry_name">
7863 _asn1_complete_explicit_tag
7865 <td class="function_entry_cyclo">
7868 <td class="function_entry_number">
7871 <td class="function_entry_number">
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>
7878 <tr class="function_entry_simple">
7879 <td class="function_entry_filename">
7882 <td class="function_entry_name">
7885 <td class="function_entry_cyclo">
7888 <td class="function_entry_number">
7891 <td class="function_entry_number">
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>
7898 <tr class="function_entry_simple">
7899 <td class="function_entry_filename">
7902 <td class="function_entry_name">
7903 asn1_find_structure_from_oid
7905 <td class="function_entry_cyclo">
7908 <td class="function_entry_number">
7911 <td class="function_entry_number">
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>
7918 <tr class="function_entry_simple">
7919 <td class="function_entry_filename">
7922 <td class="function_entry_name">
7923 asn1_delete_structure
7925 <td class="function_entry_cyclo">
7928 <td class="function_entry_number">
7931 <td class="function_entry_number">
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>
7938 <tr class="function_entry_simple">
7939 <td class="function_entry_filename">
7942 <td class="function_entry_name">
7945 <td class="function_entry_cyclo">
7948 <td class="function_entry_number">
7951 <td class="function_entry_number">
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>
7958 <tr class="function_entry_simple">
7959 <td class="function_entry_filename">
7962 <td class="function_entry_name">
7965 <td class="function_entry_cyclo">
7968 <td class="function_entry_number">
7971 <td class="function_entry_number">
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>
7978 <tr class="function_entry_simple">
7979 <td class="function_entry_filename">
7982 <td class="function_entry_name">
7983 _asn1_extract_der_octet
7985 <td class="function_entry_cyclo">
7988 <td class="function_entry_number">
7991 <td class="function_entry_number">
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>
7998 <tr class="function_entry_simple">
7999 <td class="function_entry_filename">
8002 <td class="function_entry_name">
8005 <td class="function_entry_cyclo">
8008 <td class="function_entry_number">
8011 <td class="function_entry_number">
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>
8018 <tr class="function_entry_simple">
8019 <td class="function_entry_filename">
8022 <td class="function_entry_name">
8023 _asn1_append_sequence_set
8025 <td class="function_entry_cyclo">
8028 <td class="function_entry_number">
8031 <td class="function_entry_number">
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>
8038 <tr class="function_entry_simple">
8039 <td class="function_entry_filename">
8042 <td class="function_entry_name">
8045 <td class="function_entry_cyclo">
8048 <td class="function_entry_number">
8051 <td class="function_entry_number">
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>
8058 <tr class="function_entry_simple">
8059 <td class="function_entry_filename">
8062 <td class="function_entry_name">
8063 _asn1_create_errorDescription
8065 <td class="function_entry_cyclo">
8068 <td class="function_entry_number">
8071 <td class="function_entry_number">
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>
8078 <tr class="function_entry_simple">
8079 <td class="function_entry_filename">
8082 <td class="function_entry_name">
8085 <td class="function_entry_cyclo">
8088 <td class="function_entry_number">
8091 <td class="function_entry_number">
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>
8098 <tr class="function_entry_simple">
8099 <td class="function_entry_filename">
8102 <td class="function_entry_name">
8105 <td class="function_entry_cyclo">
8108 <td class="function_entry_number">
8111 <td class="function_entry_number">
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>
8118 <tr class="function_entry_simple">
8119 <td class="function_entry_filename">
8122 <td class="function_entry_name">
8125 <td class="function_entry_cyclo">
8128 <td class="function_entry_number">
8131 <td class="function_entry_number">
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>
8138 <tr class="function_entry_simple">
8139 <td class="function_entry_filename">
8142 <td class="function_entry_name">
8143 asn1_number_of_elements
8145 <td class="function_entry_cyclo">
8148 <td class="function_entry_number">
8151 <td class="function_entry_number">
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>
8158 <tr class="function_entry_simple">
8159 <td class="function_entry_filename">
8162 <td class="function_entry_name">
8165 <td class="function_entry_cyclo">
8168 <td class="function_entry_number">
8171 <td class="function_entry_number">
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>
8178 <tr class="function_entry_simple">
8179 <td class="function_entry_filename">
8182 <td class="function_entry_name">
8185 <td class="function_entry_cyclo">
8188 <td class="function_entry_number">
8191 <td class="function_entry_number">
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>
8198 <tr class="function_entry_simple">
8199 <td class="function_entry_filename">
8202 <td class="function_entry_name">
8205 <td class="function_entry_cyclo">
8208 <td class="function_entry_number">
8211 <td class="function_entry_number">
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>
8218 <tr class="function_entry_simple">
8219 <td class="function_entry_filename">
8222 <td class="function_entry_name">
8225 <td class="function_entry_cyclo">
8228 <td class="function_entry_number">
8231 <td class="function_entry_number">
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>
8238 <tr class="function_entry_simple">
8239 <td class="function_entry_filename">
8242 <td class="function_entry_name">
8245 <td class="function_entry_cyclo">
8248 <td class="function_entry_number">
8251 <td class="function_entry_number">
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>
8258 <tr class="function_entry_simple">
8259 <td class="function_entry_filename">
8262 <td class="function_entry_name">
8265 <td class="function_entry_cyclo">
8268 <td class="function_entry_number">
8271 <td class="function_entry_number">
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>
8278 <tr class="function_entry_simple">
8279 <td class="function_entry_filename">
8282 <td class="function_entry_name">
8285 <td class="function_entry_cyclo">
8288 <td class="function_entry_number">
8291 <td class="function_entry_number">
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>
8298 <tr class="function_entry_simple">
8299 <td class="function_entry_filename">
8302 <td class="function_entry_name">
8305 <td class="function_entry_cyclo">
8308 <td class="function_entry_number">
8311 <td class="function_entry_number">
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>
8318 <tr class="function_entry_simple">
8319 <td class="function_entry_filename">
8322 <td class="function_entry_name">
8325 <td class="function_entry_cyclo">
8328 <td class="function_entry_number">
8331 <td class="function_entry_number">
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>
8338 <tr class="function_entry_simple">
8339 <td class="function_entry_filename">
8342 <td class="function_entry_name">
8343 _asn1_hierarchical_name
8345 <td class="function_entry_cyclo">
8348 <td class="function_entry_number">
8351 <td class="function_entry_number">
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>
8358 <tr class="function_entry_simple">
8359 <td class="function_entry_filename">
8362 <td class="function_entry_name">
8365 <td class="function_entry_cyclo">
8368 <td class="function_entry_number">
8371 <td class="function_entry_number">
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>
8378 <tr class="function_entry_simple">
8379 <td class="function_entry_filename">
8382 <td class="function_entry_name">
8385 <td class="function_entry_cyclo">
8388 <td class="function_entry_number">
8391 <td class="function_entry_number">
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>
8398 <tr class="function_entry_simple">
8399 <td class="function_entry_filename">
8402 <td class="function_entry_name">
8405 <td class="function_entry_cyclo">
8408 <td class="function_entry_number">
8411 <td class="function_entry_number">
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>
8418 <tr class="function_entry_simple">
8419 <td class="function_entry_filename">
8422 <td class="function_entry_name">
8423 yy_symbol_value_print
8425 <td class="function_entry_cyclo">
8428 <td class="function_entry_number">
8431 <td class="function_entry_number">
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>
8438 <tr class="function_entry_simple">
8439 <td class="function_entry_filename">
8442 <td class="function_entry_name">
8445 <td class="function_entry_cyclo">
8448 <td class="function_entry_number">
8451 <td class="function_entry_number">
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>
8458 <tr class="function_entry_simple">
8459 <td class="function_entry_filename">
8462 <td class="function_entry_name">
8465 <td class="function_entry_cyclo">
8468 <td class="function_entry_number">
8471 <td class="function_entry_number">
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>
8478 <tr class="function_entry_simple">
8479 <td class="function_entry_filename">
8482 <td class="function_entry_name">
8483 _asn1_get_last_right
8485 <td class="function_entry_cyclo">
8488 <td class="function_entry_number">
8491 <td class="function_entry_number">
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>
8498 <tr class="function_entry_simple">
8499 <td class="function_entry_filename">
8502 <td class="function_entry_name">
8505 <td class="function_entry_cyclo">
8508 <td class="function_entry_number">
8511 <td class="function_entry_number">
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>
8518 <tr class="function_entry_simple">
8519 <td class="function_entry_filename">
8522 <td class="function_entry_name">
8525 <td class="function_entry_cyclo">
8528 <td class="function_entry_number">
8531 <td class="function_entry_number">
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>
8538 <tr class="function_entry_simple">
8539 <td class="function_entry_filename">
8542 <td class="function_entry_name">
8545 <td class="function_entry_cyclo">
8548 <td class="function_entry_number">
8551 <td class="function_entry_number">
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>
8558 <tr class="function_entry_simple">
8559 <td class="function_entry_filename">
8562 <td class="function_entry_name">
8565 <td class="function_entry_cyclo">
8568 <td class="function_entry_number">
8571 <td class="function_entry_number">
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>
8578 <tr class="function_entry_simple">
8579 <td class="function_entry_filename">
8582 <td class="function_entry_name">
8585 <td class="function_entry_cyclo">
8588 <td class="function_entry_number">
8591 <td class="function_entry_number">
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>
8598 <tr class="function_entry_simple">
8599 <td class="function_entry_filename">
8602 <td class="function_entry_name">
8605 <td class="function_entry_cyclo">
8608 <td class="function_entry_number">
8611 <td class="function_entry_number">
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>
8618 <tr class="function_entry_simple">
8619 <td class="function_entry_filename">
8622 <td class="function_entry_name">
8625 <td class="function_entry_cyclo">
8628 <td class="function_entry_number">
8631 <td class="function_entry_number">
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>
8638 <tr class="function_entry_simple">
8639 <td class="function_entry_filename">
8642 <td class="function_entry_name">
8645 <td class="function_entry_cyclo">
8648 <td class="function_entry_number">
8651 <td class="function_entry_number">
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>
8658 <tr class="function_entry_simple">
8659 <td class="function_entry_filename">
8662 <td class="function_entry_name">
8663 _asn1_set_value_octet
8665 <td class="function_entry_cyclo">
8668 <td class="function_entry_number">
8671 <td class="function_entry_number">
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>
8678 <tr class="function_entry_simple">
8679 <td class="function_entry_filename">
8682 <td class="function_entry_name">
8685 <td class="function_entry_cyclo">
8688 <td class="function_entry_number">
8691 <td class="function_entry_number">
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>
8698 <tr class="function_entry_simple">
8699 <td class="function_entry_filename">
8702 <td class="function_entry_name">
8705 <td class="function_entry_cyclo">
8708 <td class="function_entry_number">
8711 <td class="function_entry_number">
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>
8718 <tr class="function_entry_simple">
8719 <td class="function_entry_filename">
8722 <td class="function_entry_name">
8723 _asn1_delete_list_and_nodes
8725 <td class="function_entry_cyclo">
8728 <td class="function_entry_number">
8731 <td class="function_entry_number">
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>
8738 <tr class="function_entry_simple">
8739 <td class="function_entry_filename">
8742 <td class="function_entry_name">
8745 <td class="function_entry_cyclo">
8748 <td class="function_entry_number">
8751 <td class="function_entry_number">
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>
8758 <tr class="function_entry_simple">
8759 <td class="function_entry_filename">
8762 <td class="function_entry_name">
8765 <td class="function_entry_cyclo">
8768 <td class="function_entry_number">
8771 <td class="function_entry_number">
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>
8778 <tr class="function_entry_simple">
8779 <td class="function_entry_filename">
8782 <td class="function_entry_name">
8785 <td class="function_entry_cyclo">
8788 <td class="function_entry_number">
8791 <td class="function_entry_number">
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>
8798 <tr class="function_entry_simple">
8799 <td class="function_entry_filename">
8802 <td class="function_entry_name">
8805 <td class="function_entry_cyclo">
8808 <td class="function_entry_number">
8811 <td class="function_entry_number">
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>
8818 <tr class="function_entry_simple">
8819 <td class="function_entry_filename">
8822 <td class="function_entry_name">
8823 _asn1_error_description_value_not_found
8825 <td class="function_entry_cyclo">
8828 <td class="function_entry_number">
8831 <td class="function_entry_number">
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>
8838 <tr class="function_entry_simple">
8839 <td class="function_entry_filename">
8842 <td class="function_entry_name">
8845 <td class="function_entry_cyclo">
8848 <td class="function_entry_number">
8851 <td class="function_entry_number">
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>
8858 <tr class="function_entry_simple">
8859 <td class="function_entry_filename">
8862 <td class="function_entry_name">
8865 <td class="function_entry_cyclo">
8868 <td class="function_entry_number">
8871 <td class="function_entry_number">
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>
8878 <tr class="function_entry_simple">
8879 <td class="function_entry_filename">
8882 <td class="function_entry_name">
8885 <td class="function_entry_cyclo">
8888 <td class="function_entry_number">
8891 <td class="function_entry_number">
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>
8898 <tr class="function_entry_simple">
8899 <td class="function_entry_filename">
8902 <td class="function_entry_name">
8905 <td class="function_entry_cyclo">
8908 <td class="function_entry_number">
8911 <td class="function_entry_number">
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>
8918 <tr class="function_entry_simple">
8919 <td class="function_entry_filename">
8922 <td class="function_entry_name">
8925 <td class="function_entry_cyclo">
8928 <td class="function_entry_number">
8931 <td class="function_entry_number">
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>
8938 <tr class="function_entry_simple">
8939 <td class="function_entry_filename">
8942 <td class="function_entry_name">
8945 <td class="function_entry_cyclo">
8948 <td class="function_entry_number">
8951 <td class="function_entry_number">
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>
8958 <tr class="function_entry_simple">
8959 <td class="function_entry_filename">
8962 <td class="function_entry_name">
8965 <td class="function_entry_cyclo">
8968 <td class="function_entry_number">
8971 <td class="function_entry_number">
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>
8978 <tr class="function_entry_simple">
8979 <td class="function_entry_filename">
8982 <td class="function_entry_name">
8985 <td class="function_entry_cyclo">
8988 <td class="function_entry_number">
8991 <td class="function_entry_number">
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>
8998 <tr class="function_entry_simple">
8999 <td class="function_entry_filename">
9002 <td class="function_entry_name">
9005 <td class="function_entry_cyclo">
9008 <td class="function_entry_number">
9011 <td class="function_entry_number">
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>
9018 <tr class="function_entry_simple">
9019 <td class="function_entry_filename">
9022 <td class="function_entry_name">
9023 _asn1_copy_structure2
9025 <td class="function_entry_cyclo">
9028 <td class="function_entry_number">
9031 <td class="function_entry_number">
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>
9038 <tr class="function_entry_simple">
9039 <td class="function_entry_filename">
9042 <td class="function_entry_name">
9043 _asn1_error_description_tag_error
9045 <td class="function_entry_cyclo">
9048 <td class="function_entry_number">
9051 <td class="function_entry_number">
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>
9058 <tr class="function_entry_simple">
9059 <td class="function_entry_filename">
9062 <td class="function_entry_name">
9065 <td class="function_entry_cyclo">
9068 <td class="function_entry_number">
9071 <td class="function_entry_number">
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>
9078 <tr class="function_entry_simple">
9079 <td class="function_entry_filename">
9082 <td class="function_entry_name">
9085 <td class="function_entry_cyclo">
9088 <td class="function_entry_number">
9091 <td class="function_entry_number">
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>
9099 <hr color="black" size="2"/> Copyright (c) 2007, 2008 Free Software Foundation, Inc.