diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-11-21 09:02:17 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2013-11-25 10:14:56 +0100 |
commit | eb440016e28ef46729536ae0d8c3a935eb3ca798 (patch) | |
tree | 33ae06dd439d000813af65bc812bcf00937ae4c9 /lib | |
parent | c5a9cfaf1bc008a2b4b7bbd544a8f3ab3d62d953 (diff) | |
download | libtasn1-eb440016e28ef46729536ae0d8c3a935eb3ca798.tar.gz libtasn1-eb440016e28ef46729536ae0d8c3a935eb3ca798.tar.bz2 libtasn1-eb440016e28ef46729536ae0d8c3a935eb3ca798.zip |
The parser accepts negative numbers in INTEGER ranges. Use snprintf() instead of strcpy() in parser.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ASN1.c | 948 | ||||
-rw-r--r-- | lib/ASN1.y | 39 |
2 files changed, 508 insertions, 479 deletions
@@ -518,16 +518,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 219 +#define YYLAST 223 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 60 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 51 +#define YYNNTS 52 /* YYNRULES -- Number of rules. */ -#define YYNRULES 125 +#define YYNRULES 128 /* YYNRULES -- Number of states. */ -#define YYNSTATES 217 +#define YYNSTATES 223 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -578,80 +578,81 @@ static const yytype_uint8 yytranslate[] = static const yytype_uint16 yyprhs[] = { 0, 0, 3, 12, 14, 17, 20, 22, 24, 26, - 28, 30, 32, 36, 41, 43, 47, 49, 54, 56, - 59, 61, 63, 65, 69, 74, 76, 79, 82, 85, - 88, 91, 93, 97, 99, 104, 109, 117, 119, 121, - 123, 128, 136, 138, 142, 144, 147, 149, 152, 154, - 157, 159, 162, 164, 167, 169, 172, 174, 177, 179, - 182, 184, 187, 190, 194, 199, 201, 205, 208, 212, - 218, 223, 226, 228, 231, 233, 235, 237, 239, 241, - 243, 245, 247, 249, 251, 253, 255, 257, 259, 261, - 263, 265, 267, 269, 271, 273, 275, 278, 280, 283, - 286, 289, 291, 295, 300, 304, 309, 314, 318, 323, - 328, 330, 335, 339, 343, 351, 358, 363, 365, 367, - 369, 372, 377, 381, 383, 385 + 28, 30, 33, 35, 37, 39, 43, 48, 50, 54, + 56, 61, 63, 66, 68, 70, 72, 76, 81, 83, + 86, 89, 92, 95, 98, 100, 104, 106, 111, 116, + 124, 126, 128, 130, 135, 143, 145, 149, 151, 154, + 156, 159, 161, 164, 166, 169, 171, 174, 176, 179, + 181, 184, 186, 189, 191, 194, 197, 201, 206, 208, + 212, 215, 219, 225, 230, 233, 235, 238, 240, 242, + 244, 246, 248, 250, 252, 254, 256, 258, 260, 262, + 264, 266, 268, 270, 272, 274, 276, 278, 280, 282, + 285, 287, 290, 293, 296, 298, 302, 307, 311, 316, + 321, 325, 330, 335, 337, 342, 346, 350, 358, 365, + 370, 372, 374, 376, 379, 384, 388, 390, 392 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 61, 0, -1, 109, 31, 110, 32, 3, 33, 108, + 61, 0, -1, 110, 31, 111, 32, 3, 33, 109, 34, -1, 4, -1, 49, 4, -1, 50, 4, -1, - 62, -1, 63, -1, 4, -1, 5, -1, 64, -1, - 5, -1, 51, 64, 52, -1, 5, 51, 64, 52, - -1, 67, -1, 68, 53, 67, -1, 65, -1, 5, - 51, 4, 52, -1, 69, -1, 70, 69, -1, 13, - -1, 14, -1, 15, -1, 54, 4, 55, -1, 54, - 71, 4, 55, -1, 72, -1, 72, 29, -1, 72, - 30, -1, 16, 66, -1, 16, 22, -1, 16, 23, - -1, 64, -1, 75, 56, 64, -1, 7, -1, 7, - 57, 68, 58, -1, 76, 51, 75, 52, -1, 76, - 51, 65, 59, 59, 65, 52, -1, 21, -1, 35, - -1, 36, -1, 8, 51, 65, 52, -1, 8, 51, - 65, 59, 59, 65, 52, -1, 79, -1, 51, 79, - 52, -1, 37, -1, 37, 80, -1, 38, -1, 38, - 80, -1, 39, -1, 39, 80, -1, 40, -1, 40, - 80, -1, 41, -1, 41, 80, -1, 42, -1, 42, - 80, -1, 43, -1, 43, 80, -1, 44, -1, 44, - 80, -1, 45, -1, 45, 80, -1, 9, 10, -1, - 9, 10, 80, -1, 5, 51, 4, 52, -1, 91, - -1, 92, 53, 91, -1, 12, 10, -1, 12, 10, - 80, -1, 12, 10, 57, 92, 58, -1, 48, 57, - 92, 58, -1, 19, 20, -1, 5, -1, 5, 80, - -1, 76, -1, 94, -1, 77, -1, 78, -1, 90, - -1, 93, -1, 81, -1, 82, -1, 83, -1, 84, - -1, 85, -1, 86, -1, 87, -1, 88, -1, 89, - -1, 101, -1, 95, -1, 103, -1, 104, -1, 102, - -1, 24, -1, 96, -1, 73, 96, -1, 97, -1, - 97, 74, -1, 97, 6, -1, 5, 98, -1, 99, - -1, 100, 53, 99, -1, 11, 57, 100, 58, -1, - 11, 18, 96, -1, 11, 80, 18, 96, -1, 28, - 57, 100, 58, -1, 28, 18, 96, -1, 28, 80, - 18, 96, -1, 17, 57, 100, 58, -1, 25, -1, - 25, 26, 27, 5, -1, 5, 3, 97, -1, 1, - 3, 97, -1, 5, 19, 20, 3, 57, 70, 58, - -1, 5, 5, 3, 57, 70, 58, -1, 5, 7, - 3, 64, -1, 105, -1, 106, -1, 107, -1, 108, - 107, -1, 5, 57, 70, 58, -1, 5, 57, 58, - -1, 5, -1, 29, -1, 30, -1 + 62, -1, 63, -1, 4, -1, 5, -1, 4, -1, + 50, 4, -1, 5, -1, 64, -1, 5, -1, 51, + 64, 52, -1, 5, 51, 64, 52, -1, 68, -1, + 69, 53, 68, -1, 65, -1, 5, 51, 4, 52, + -1, 70, -1, 71, 70, -1, 13, -1, 14, -1, + 15, -1, 54, 4, 55, -1, 54, 72, 4, 55, + -1, 73, -1, 73, 29, -1, 73, 30, -1, 16, + 67, -1, 16, 22, -1, 16, 23, -1, 64, -1, + 76, 56, 64, -1, 7, -1, 7, 57, 69, 58, + -1, 77, 51, 76, 52, -1, 77, 51, 66, 59, + 59, 66, 52, -1, 21, -1, 35, -1, 36, -1, + 8, 51, 65, 52, -1, 8, 51, 65, 59, 59, + 65, 52, -1, 80, -1, 51, 80, 52, -1, 37, + -1, 37, 81, -1, 38, -1, 38, 81, -1, 39, + -1, 39, 81, -1, 40, -1, 40, 81, -1, 41, + -1, 41, 81, -1, 42, -1, 42, 81, -1, 43, + -1, 43, 81, -1, 44, -1, 44, 81, -1, 45, + -1, 45, 81, -1, 9, 10, -1, 9, 10, 81, + -1, 5, 51, 4, 52, -1, 92, -1, 93, 53, + 92, -1, 12, 10, -1, 12, 10, 81, -1, 12, + 10, 57, 93, 58, -1, 48, 57, 93, 58, -1, + 19, 20, -1, 5, -1, 5, 81, -1, 77, -1, + 95, -1, 78, -1, 79, -1, 91, -1, 94, -1, + 82, -1, 83, -1, 84, -1, 85, -1, 86, -1, + 87, -1, 88, -1, 89, -1, 90, -1, 102, -1, + 96, -1, 104, -1, 105, -1, 103, -1, 24, -1, + 97, -1, 74, 97, -1, 98, -1, 98, 75, -1, + 98, 6, -1, 5, 99, -1, 100, -1, 101, 53, + 100, -1, 11, 57, 101, 58, -1, 11, 18, 97, + -1, 11, 81, 18, 97, -1, 28, 57, 101, 58, + -1, 28, 18, 97, -1, 28, 81, 18, 97, -1, + 17, 57, 101, 58, -1, 25, -1, 25, 26, 27, + 5, -1, 5, 3, 98, -1, 1, 3, 98, -1, + 5, 19, 20, 3, 57, 71, 58, -1, 5, 5, + 3, 57, 71, 58, -1, 5, 7, 3, 64, -1, + 106, -1, 107, -1, 108, -1, 109, 108, -1, 5, + 57, 71, 58, -1, 5, 57, 58, -1, 5, -1, + 29, -1, 30, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 134, 134, 147, 148, 151, 155, 156, 159, 160, - 163, 164, 167, 169, 174, 175, 179, 181, 186, 187, - 191, 192, 193, 196, 198, 202, 203, 204, 207, 209, - 210, 214, 215, 219, 220, 222, 223, 230, 233, 234, - 237, 239, 245, 246, 249, 250, 254, 255, 259, 260, - 264, 265, 269, 270, 274, 275, 279, 280, 284, 285, - 289, 290, 294, 295, 299, 304, 305, 309, 310, 311, - 316, 322, 325, 327, 330, 331, 332, 333, 334, 335, - 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, - 346, 347, 348, 349, 350, 353, 354, 359, 360, 363, - 366, 369, 370, 374, 376, 378, 383, 385, 387, 392, - 396, 397, 402, 404, 407, 411, 416, 422, 423, 426, - 427, 431, 434, 436, 460, 461 + 0, 135, 135, 148, 149, 152, 155, 156, 159, 160, + 163, 164, 165, 168, 169, 172, 174, 179, 180, 184, + 186, 191, 192, 196, 197, 198, 201, 203, 207, 208, + 209, 212, 214, 215, 219, 220, 224, 225, 227, 228, + 235, 238, 239, 242, 244, 250, 251, 254, 255, 259, + 260, 264, 265, 269, 270, 274, 275, 279, 280, 284, + 285, 289, 290, 294, 295, 299, 300, 304, 309, 310, + 314, 315, 316, 321, 327, 330, 332, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 358, 359, + 364, 365, 368, 371, 374, 375, 379, 381, 383, 388, + 390, 392, 397, 401, 402, 407, 409, 412, 416, 421, + 427, 428, 431, 432, 436, 439, 441, 465, 466 }; #endif @@ -671,18 +672,19 @@ static const char *const yytname[] = "VisibleString", "FROM", "IMPORTS", "ENUMERATED", "'+'", "'-'", "'('", "')'", "','", "'['", "']'", "'|'", "'{'", "'}'", "'.'", "$accept", "definitions", "pos_num", "neg_num", "pos_neg_num", "num_identifier", - "pos_neg_identifier", "constant", "constant_list", "obj_constant", - "obj_constant_list", "class", "tag_type", "tag", "default", - "pos_neg_list", "integer_def", "boolean_def", "Time", "size_def2", - "size_def", "generalstring_def", "numericstring_def", "ia5string_def", - "teletexstring_def", "printablestring_def", "universalstring_def", - "bmpstring_def", "utf8string_def", "visiblestring_def", - "octet_string_def", "bit_element", "bit_element_list", "bit_string_def", - "enumerated_def", "object_def", "type_assig_right", - "type_assig_right_tag", "type_assig_right_tag_default", "type_assig", - "type_assig_list", "sequence_def", "set_def", "choise_def", "any_def", - "type_def", "constant_def", "type_constant", "type_constant_list", - "definitions_id", "explicit_implicit", YY_NULL + "int_identifier", "pos_neg_identifier", "constant", "constant_list", + "obj_constant", "obj_constant_list", "class", "tag_type", "tag", + "default", "pos_neg_list", "integer_def", "boolean_def", "Time", + "size_def2", "size_def", "generalstring_def", "numericstring_def", + "ia5string_def", "teletexstring_def", "printablestring_def", + "universalstring_def", "bmpstring_def", "utf8string_def", + "visiblestring_def", "octet_string_def", "bit_element", + "bit_element_list", "bit_string_def", "enumerated_def", "object_def", + "type_assig_right", "type_assig_right_tag", + "type_assig_right_tag_default", "type_assig", "type_assig_list", + "sequence_def", "set_def", "choise_def", "any_def", "type_def", + "constant_def", "type_constant", "type_constant_list", "definitions_id", + "explicit_implicit", YY_NULL }; #endif @@ -704,36 +706,36 @@ static const yytype_uint16 yytoknum[] = static const yytype_uint8 yyr1[] = { 0, 60, 61, 62, 62, 63, 64, 64, 65, 65, - 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, - 71, 71, 71, 72, 72, 73, 73, 73, 74, 74, - 74, 75, 75, 76, 76, 76, 76, 77, 78, 78, - 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, - 84, 84, 85, 85, 86, 86, 87, 87, 88, 88, - 89, 89, 90, 90, 91, 92, 92, 93, 93, 93, - 94, 95, 96, 96, 96, 96, 96, 96, 96, 96, - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, - 96, 96, 96, 96, 96, 97, 97, 98, 98, 98, - 99, 100, 100, 101, 101, 101, 102, 102, 102, 103, - 104, 104, 105, 105, 106, 106, 106, 107, 107, 108, - 108, 109, 109, 109, 110, 110 + 66, 66, 66, 67, 67, 68, 68, 69, 69, 70, + 70, 71, 71, 72, 72, 72, 73, 73, 74, 74, + 74, 75, 75, 75, 76, 76, 77, 77, 77, 77, + 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, + 83, 84, 84, 85, 85, 86, 86, 87, 87, 88, + 88, 89, 89, 90, 90, 91, 91, 92, 93, 93, + 94, 94, 94, 95, 96, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 98, 98, + 99, 99, 99, 100, 101, 101, 102, 102, 102, 103, + 103, 103, 104, 105, 105, 106, 106, 107, 107, 107, + 108, 108, 109, 109, 110, 110, 110, 111, 111 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 8, 1, 2, 2, 1, 1, 1, 1, - 1, 1, 3, 4, 1, 3, 1, 4, 1, 2, - 1, 1, 1, 3, 4, 1, 2, 2, 2, 2, - 2, 1, 3, 1, 4, 4, 7, 1, 1, 1, - 4, 7, 1, 3, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 2, 3, 4, 1, 3, 2, 3, 5, - 4, 2, 1, 2, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 1, 1, 3, 4, 1, 3, 1, + 4, 1, 2, 1, 1, 1, 3, 4, 1, 2, + 2, 2, 2, 2, 1, 3, 1, 4, 4, 7, + 1, 1, 1, 4, 7, 1, 3, 1, 2, 1, + 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, + 2, 1, 2, 1, 2, 2, 3, 4, 1, 3, + 2, 3, 5, 4, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, - 2, 1, 3, 4, 3, 4, 4, 3, 4, 4, - 1, 4, 3, 3, 7, 6, 4, 1, 1, 1, - 2, 4, 3, 1, 1, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 1, 2, 2, 2, 1, 3, 4, 3, 4, 4, + 3, 4, 4, 1, 4, 3, 3, 7, 6, 4, + 1, 1, 1, 2, 4, 3, 1, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. @@ -741,169 +743,174 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 0, 123, 0, 0, 0, 1, 0, 8, 9, 122, - 16, 18, 0, 124, 125, 0, 0, 121, 19, 0, - 0, 0, 17, 0, 0, 0, 117, 118, 119, 0, - 0, 0, 0, 0, 0, 2, 120, 72, 33, 0, - 0, 0, 0, 0, 37, 94, 110, 0, 38, 39, - 44, 46, 48, 50, 52, 54, 56, 58, 60, 0, - 0, 25, 0, 74, 76, 77, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 78, 79, 75, 90, 95, - 113, 89, 93, 91, 92, 112, 0, 0, 0, 0, - 0, 42, 73, 0, 62, 0, 0, 0, 67, 0, - 71, 0, 0, 0, 0, 45, 47, 49, 51, 53, - 55, 57, 59, 61, 0, 0, 20, 21, 22, 0, - 26, 27, 96, 0, 0, 3, 0, 0, 6, 7, - 116, 0, 0, 0, 0, 0, 14, 0, 63, 104, - 0, 101, 0, 0, 0, 68, 0, 0, 107, 0, - 0, 0, 65, 0, 23, 0, 3, 9, 31, 0, - 0, 0, 4, 5, 0, 0, 43, 0, 0, 0, - 34, 97, 100, 0, 103, 105, 0, 109, 111, 106, - 108, 0, 0, 70, 24, 0, 35, 0, 115, 0, - 40, 0, 0, 12, 15, 99, 0, 98, 102, 69, - 0, 66, 0, 32, 114, 0, 13, 11, 29, 30, - 10, 28, 64, 0, 0, 36, 41 + 0, 126, 0, 0, 0, 1, 0, 8, 9, 125, + 19, 21, 0, 127, 128, 0, 0, 124, 22, 0, + 0, 0, 20, 0, 0, 0, 120, 121, 122, 0, + 0, 0, 0, 0, 0, 2, 123, 75, 36, 0, + 0, 0, 0, 0, 40, 97, 113, 0, 41, 42, + 47, 49, 51, 53, 55, 57, 59, 61, 63, 0, + 0, 28, 0, 77, 79, 80, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 81, 82, 78, 93, 98, + 116, 92, 96, 94, 95, 115, 0, 0, 0, 0, + 0, 45, 76, 0, 65, 0, 0, 0, 70, 0, + 74, 0, 0, 0, 0, 48, 50, 52, 54, 56, + 58, 60, 62, 64, 0, 0, 23, 24, 25, 0, + 29, 30, 99, 0, 0, 3, 0, 0, 6, 7, + 119, 0, 0, 0, 0, 0, 17, 0, 66, 107, + 0, 104, 0, 0, 0, 71, 0, 0, 110, 0, + 0, 0, 68, 0, 26, 0, 3, 12, 0, 34, + 0, 0, 0, 4, 5, 0, 9, 0, 46, 0, + 0, 0, 37, 100, 103, 0, 106, 108, 0, 112, + 114, 109, 111, 0, 0, 73, 27, 5, 0, 38, + 0, 118, 0, 43, 0, 0, 15, 18, 102, 0, + 101, 105, 72, 0, 69, 0, 35, 117, 0, 16, + 14, 32, 33, 13, 31, 67, 10, 0, 0, 0, + 11, 39, 44 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 2, 128, 129, 130, 10, 211, 136, 137, 11, - 12, 119, 61, 62, 197, 160, 63, 64, 65, 91, - 92, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 152, 153, 76, 77, 78, 79, 80, 172, 141, - 142, 81, 82, 83, 84, 26, 27, 28, 29, 3, - 15 + -1, 2, 128, 129, 130, 10, 160, 214, 136, 137, + 11, 12, 119, 61, 62, 200, 161, 63, 64, 65, + 91, 92, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 152, 153, 76, 77, 78, 79, 80, 174, + 141, 142, 81, 82, 83, 84, 26, 27, 28, 29, + 3, 15 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -121 +#define YYPACT_NINF -129 static const yytype_int16 yypact[] = { - 10, -16, 49, 20, 1, -121, 28, -121, 9, -121, - -121, -121, 4, -121, -121, 44, 69, -121, -121, 91, - 55, 100, -121, 112, 144, 99, -121, -121, -121, 29, - 84, 84, 148, 150, 136, -121, -121, 5, 101, 147, - 21, 149, 104, 145, -121, -121, 137, 35, -121, -121, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 109, - 32, 37, 143, 118, -121, -121, -121, -121, -121, -121, - -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, - -121, -121, -121, -121, -121, -121, 113, 48, 169, 122, - 166, -121, -121, 23, 5, 143, 170, 158, 24, 170, - -121, 162, 143, 170, 172, -121, -121, -121, -121, -121, - -121, -121, -121, -121, 187, 139, -121, -121, -121, 189, - -121, -121, -121, 50, 138, -121, 191, 192, -121, -121, - -121, 140, 141, 146, 151, 48, -121, -20, -121, -121, - 84, -121, 26, 143, 187, -121, 58, 194, -121, 77, - 143, 152, -121, 78, -121, 153, 142, -121, -121, 154, - 85, 6, -121, -121, 138, -15, -121, 48, 155, 23, - -121, 34, -121, 170, -121, -121, 81, -121, -121, -121, - -121, 196, 187, -121, -121, 156, -121, 48, -121, 22, - -121, 157, 159, -121, -121, -121, 65, -121, -121, -121, - 160, -121, 141, -121, -121, 141, -121, -121, -121, -121, - -121, -121, -121, 165, 167, -121, -121 + 36, -7, 74, 22, 3, -129, 26, -129, 34, -129, + -129, -129, 5, -129, -129, 55, 89, -129, -129, 97, + 57, 101, -129, 122, 141, 132, -129, -129, -129, 32, + 77, 77, 152, 165, 150, -129, -129, 6, 119, 167, + 18, 168, 124, 159, -129, -129, 156, 21, -129, -129, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 126, + 30, 38, 121, 133, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, -129, -129, -129, -129, 128, 58, 183, 136, + 180, -129, -129, 20, 6, 121, 184, 172, -3, 184, + -129, 164, 121, 184, 174, -129, -129, -129, -129, -129, + -129, -129, -129, -129, 188, 139, -129, -129, -129, 191, + -129, -129, -129, 42, 149, -129, 192, 193, -129, -129, + -129, 142, 169, 146, 151, 58, -129, 53, -129, -129, + 77, -129, 71, 121, 188, -129, 83, 195, -129, 90, + 121, 153, -129, 94, -129, 148, 147, -129, 197, -129, + 154, 43, 7, -129, -129, 149, -129, -21, -129, 58, + 155, 20, -129, 24, -129, 184, -129, -129, 114, -129, + -129, -129, -129, 201, 188, -129, -129, 157, 158, -129, + 58, -129, 23, -129, 160, 162, -129, -129, -129, 54, + -129, -129, -129, 163, -129, 47, -129, -129, 169, -129, + -129, -129, -129, -129, -129, -129, -129, 204, 166, 170, + -129, -129, -129 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -121, -121, -121, -121, -119, -120, -121, 36, -121, -12, - -93, -121, -121, -121, -121, -121, -121, -121, -121, 114, - -33, -121, -121, -121, -121, -121, -121, -121, -121, -121, - -121, 27, 62, -121, -121, -121, -60, -30, -121, 45, - 41, -121, -121, -121, -121, -121, -121, 181, -121, -121, - -121 + -129, -129, -129, -129, -120, -128, 4, -129, 39, -129, + -12, -92, -129, -129, -129, -129, -129, -129, -129, -129, + 130, -34, -129, -129, -129, -129, -129, -129, -129, -129, + -129, -129, 27, 68, -129, -129, -129, -60, -30, -129, + 46, 72, -129, -129, -129, -129, -129, -129, 194, -129, + -129, -129 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -9 +#define YYTABLE_NINF -12 static const yytype_int16 yytable[] = { - 18, 85, 122, 159, 158, 7, 8, 97, 7, 8, - 7, 8, 165, 89, 104, 1, 168, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 7, 8, 134, 89, - 24, 161, 89, 169, 25, 139, 115, 190, 170, 95, - 195, 4, 148, 89, 191, 116, 117, 118, 192, 5, - 196, 6, 125, 102, 156, 157, 90, 13, 14, 9, - 16, 138, 17, 35, 188, 145, 120, 121, 203, 125, - 207, 189, 90, 20, 135, 90, 19, 210, 96, 173, - 204, 144, 213, 175, 174, 214, 90, 208, 209, 37, - 180, 38, 103, 39, 21, 40, 41, 126, 127, 126, - 127, 42, 31, 43, 32, 44, 33, 22, 45, 46, - 171, 173, 47, 24, 126, 127, 177, 25, 34, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 173, 182, 59, 23, 182, 179, 183, 186, 60, 199, - 146, 187, 7, 8, 149, 7, 157, 30, 37, 18, - 38, 86, 39, 87, 40, 41, 88, 94, 93, 98, - 42, 99, 43, 101, 44, 100, 114, 45, 46, 123, - 124, 47, 131, 132, 89, 140, 143, 18, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 147, - 150, 59, 151, 155, 154, 162, 163, 164, 166, 178, - 200, -8, 167, 181, 133, 194, 176, 193, 184, 201, - 36, 206, 212, 185, 0, 202, 205, 215, 198, 216 + 18, 85, 122, 159, 167, 89, 97, 7, 8, 7, + 8, 7, 8, 104, 89, 170, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 134, 89, 7, 8, 89, + 198, 193, 162, 24, 115, 139, 95, 25, 194, 102, + 199, 1, 148, 116, 117, 118, 156, 157, 90, 195, + 4, 216, 157, 6, 144, 13, 14, 90, 125, 210, + 138, 9, 125, 17, 145, 191, 35, 120, 121, 90, + 206, 135, 90, 192, 5, 96, 211, 212, 103, 213, + 219, 207, 37, 177, 38, 16, 39, 19, 40, 41, + 182, 126, 158, 20, 42, 189, 43, 217, 44, 190, + 21, 45, 46, 126, 127, 47, 171, 126, 127, 22, + 173, 172, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 24, 175, 59, 37, 25, 38, 176, + 39, 60, 40, 41, 23, 31, 175, 32, 42, 33, + 43, 179, 44, 175, 30, 45, 46, 184, 181, 47, + 18, 34, 185, 7, 8, 86, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 184, 87, 59, + 88, 146, 202, 7, 166, 149, 93, 94, 98, 100, + 18, 99, 101, 114, 123, 124, 131, 132, 89, 140, + 143, 147, 150, 151, 154, 155, 163, 164, 168, 165, + 180, 187, 169, 186, 183, 203, -10, 196, 220, 218, + 197, 204, 178, 188, 209, 215, -11, 205, 221, 208, + 133, 201, 222, 36 }; #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-121))) + (!!((Yystate) == (-129))) #define yytable_value_is_error(Yytable_value) \ YYID (0) -static const yytype_int16 yycheck[] = +static const yytype_uint8 yycheck[] = { - 12, 31, 62, 123, 123, 4, 5, 40, 4, 5, - 4, 5, 132, 8, 47, 5, 135, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 4, 5, 5, 8, - 1, 124, 8, 53, 5, 95, 4, 52, 58, 18, - 6, 57, 102, 8, 59, 13, 14, 15, 167, 0, - 16, 31, 4, 18, 4, 5, 51, 29, 30, 58, - 51, 94, 58, 34, 58, 98, 29, 30, 187, 4, - 5, 164, 51, 4, 51, 51, 32, 196, 57, 53, - 58, 57, 202, 143, 58, 205, 51, 22, 23, 5, - 150, 7, 57, 9, 3, 11, 12, 49, 50, 49, - 50, 17, 3, 19, 5, 21, 7, 52, 24, 25, - 140, 53, 28, 1, 49, 50, 58, 5, 19, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 53, 53, 48, 33, 53, 58, 58, 52, 54, 58, - 99, 56, 4, 5, 103, 4, 5, 3, 5, 161, - 7, 3, 9, 3, 11, 12, 20, 10, 57, 10, - 17, 57, 19, 26, 21, 20, 57, 24, 25, 51, - 57, 28, 3, 51, 8, 5, 18, 189, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 27, - 18, 48, 5, 4, 55, 4, 4, 57, 52, 5, - 4, 59, 51, 51, 90, 169, 144, 52, 55, 182, - 29, 52, 52, 59, -1, 59, 59, 52, 173, 52 + 12, 31, 62, 123, 132, 8, 40, 4, 5, 4, + 5, 4, 5, 47, 8, 135, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 5, 8, 4, 5, 8, + 6, 52, 124, 1, 4, 95, 18, 5, 59, 18, + 16, 5, 102, 13, 14, 15, 4, 5, 51, 169, + 57, 4, 5, 31, 57, 29, 30, 51, 4, 5, + 94, 58, 4, 58, 98, 58, 34, 29, 30, 51, + 190, 51, 51, 165, 0, 57, 22, 23, 57, 199, + 208, 58, 5, 143, 7, 51, 9, 32, 11, 12, + 150, 49, 50, 4, 17, 52, 19, 50, 21, 56, + 3, 24, 25, 49, 50, 28, 53, 49, 50, 52, + 140, 58, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 1, 53, 48, 5, 5, 7, 58, + 9, 54, 11, 12, 33, 3, 53, 5, 17, 7, + 19, 58, 21, 53, 3, 24, 25, 53, 58, 28, + 162, 19, 58, 4, 5, 3, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 53, 3, 48, + 20, 99, 58, 4, 5, 103, 57, 10, 10, 20, + 192, 57, 26, 57, 51, 57, 3, 51, 8, 5, + 18, 27, 18, 5, 55, 4, 4, 4, 52, 57, + 5, 4, 51, 55, 51, 4, 59, 52, 4, 205, + 171, 184, 144, 59, 52, 52, 59, 59, 52, 59, + 90, 175, 52, 29 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 5, 61, 109, 57, 0, 31, 4, 5, 58, - 65, 69, 70, 29, 30, 110, 51, 58, 69, 32, - 4, 3, 52, 33, 1, 5, 105, 106, 107, 108, - 3, 3, 5, 7, 19, 34, 107, 5, 7, 9, + 0, 5, 61, 110, 57, 0, 31, 4, 5, 58, + 65, 70, 71, 29, 30, 111, 51, 58, 70, 32, + 4, 3, 52, 33, 1, 5, 106, 107, 108, 109, + 3, 3, 5, 7, 19, 34, 108, 5, 7, 9, 11, 12, 17, 19, 21, 24, 25, 28, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 48, - 54, 72, 73, 76, 77, 78, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 93, 94, 95, 96, - 97, 101, 102, 103, 104, 97, 3, 3, 20, 8, - 51, 79, 80, 57, 10, 18, 57, 80, 10, 57, - 20, 26, 18, 57, 80, 80, 80, 80, 80, 80, - 80, 80, 80, 80, 57, 4, 13, 14, 15, 71, - 29, 30, 96, 51, 57, 4, 49, 50, 62, 63, - 64, 3, 51, 79, 5, 51, 67, 68, 80, 96, - 5, 99, 100, 18, 57, 80, 100, 27, 96, 100, - 18, 5, 91, 92, 55, 4, 4, 5, 64, 65, - 75, 70, 4, 4, 57, 65, 52, 51, 64, 53, - 58, 97, 98, 53, 58, 96, 92, 58, 5, 58, - 96, 51, 53, 58, 55, 59, 52, 56, 58, 70, - 52, 59, 64, 52, 67, 6, 16, 74, 99, 58, - 4, 91, 59, 64, 58, 59, 52, 5, 22, 23, - 64, 66, 52, 65, 65, 52, 52 + 54, 73, 74, 77, 78, 79, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 94, 95, 96, 97, + 98, 102, 103, 104, 105, 98, 3, 3, 20, 8, + 51, 80, 81, 57, 10, 18, 57, 81, 10, 57, + 20, 26, 18, 57, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 57, 4, 13, 14, 15, 72, + 29, 30, 97, 51, 57, 4, 49, 50, 62, 63, + 64, 3, 51, 80, 5, 51, 68, 69, 81, 97, + 5, 100, 101, 18, 57, 81, 101, 27, 97, 101, + 18, 5, 92, 93, 55, 4, 4, 5, 50, 64, + 66, 76, 71, 4, 4, 57, 5, 65, 52, 51, + 64, 53, 58, 98, 99, 53, 58, 97, 93, 58, + 5, 58, 97, 51, 53, 58, 55, 4, 59, 52, + 56, 58, 71, 52, 59, 64, 52, 68, 6, 16, + 75, 100, 58, 4, 92, 59, 64, 58, 59, 52, + 5, 22, 23, 64, 67, 52, 4, 50, 66, 65, + 4, 52, 52 }; #define yyerrok (yyerrstatus = 0) @@ -1705,7 +1712,7 @@ yyreduce: { case 2: /* Line 1792 of yacc.c */ -#line 137 "ASN1.y" +#line 138 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_DEFINITIONS|(yyvsp[(3) - (8)].constant)); _asn1_set_name((yyval.node),_asn1_get_name((yyvsp[(1) - (8)].node))); _asn1_set_name((yyvsp[(1) - (8)].node),""); @@ -1718,573 +1725,572 @@ yyreduce: case 3: /* Line 1792 of yacc.c */ -#line 147 "ASN1.y" - {strcpy((yyval.str),(yyvsp[(1) - (1)].str));} +#line 148 "ASN1.y" + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[(1) - (1)].str));} break; case 4: /* Line 1792 of yacc.c */ -#line 148 "ASN1.y" - {strcpy((yyval.str),(yyvsp[(2) - (2)].str));} +#line 149 "ASN1.y" + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[(2) - (2)].str));} break; case 5: /* Line 1792 of yacc.c */ -#line 151 "ASN1.y" - {strcpy((yyval.str),"-"); - strcat((yyval.str),(yyvsp[(2) - (2)].str));} +#line 152 "ASN1.y" + {snprintf((yyval.str),sizeof((yyval.str)),"-%s",(yyvsp[(2) - (2)].str));} break; case 6: /* Line 1792 of yacc.c */ #line 155 "ASN1.y" - {strcpy((yyval.str),(yyvsp[(1) - (1)].str));} + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[(1) - (1)].str));} break; case 7: /* Line 1792 of yacc.c */ #line 156 "ASN1.y" - {strcpy((yyval.str),(yyvsp[(1) - (1)].str));} + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[(1) - (1)].str));} break; case 8: /* Line 1792 of yacc.c */ #line 159 "ASN1.y" - {strcpy((yyval.str),(yyvsp[(1) - (1)].str));} + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[(1) - (1)].str));} break; case 9: /* Line 1792 of yacc.c */ #line 160 "ASN1.y" - {strcpy((yyval.str),(yyvsp[(1) - (1)].str));} + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[(1) - (1)].str));} break; case 10: /* Line 1792 of yacc.c */ #line 163 "ASN1.y" - {strcpy((yyval.str),(yyvsp[(1) - (1)].str));} + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[(1) - (1)].str));} break; case 11: /* Line 1792 of yacc.c */ #line 164 "ASN1.y" - {strcpy((yyval.str),(yyvsp[(1) - (1)].str));} + {snprintf((yyval.str),sizeof((yyval.str)),"-%s",(yyvsp[(2) - (2)].str));} break; case 12: /* Line 1792 of yacc.c */ -#line 167 "ASN1.y" - {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT); - _asn1_set_value((yyval.node),(yyvsp[(2) - (3)].str),strlen((yyvsp[(2) - (3)].str))+1);} +#line 165 "ASN1.y" + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[(1) - (1)].str));} break; case 13: /* Line 1792 of yacc.c */ +#line 168 "ASN1.y" + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[(1) - (1)].str));} + break; + + case 14: +/* Line 1792 of yacc.c */ #line 169 "ASN1.y" + {snprintf((yyval.str),sizeof((yyval.str)),"%s",(yyvsp[(1) - (1)].str));} + break; + + case 15: +/* Line 1792 of yacc.c */ +#line 172 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT); + _asn1_set_value((yyval.node),(yyvsp[(2) - (3)].str),strlen((yyvsp[(2) - (3)].str))+1);} + break; + + case 16: +/* Line 1792 of yacc.c */ +#line 174 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT); _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str)); _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);} break; - case 14: + case 17: /* Line 1792 of yacc.c */ -#line 174 "ASN1.y" +#line 179 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; - case 15: + case 18: /* Line 1792 of yacc.c */ -#line 175 "ASN1.y" +#line 180 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (3)].node); _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (3)].node)),(yyvsp[(3) - (3)].node));} break; - case 16: + case 19: /* Line 1792 of yacc.c */ -#line 179 "ASN1.y" +#line 184 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT); _asn1_set_value((yyval.node),(yyvsp[(1) - (1)].str),strlen((yyvsp[(1) - (1)].str))+1);} break; - case 17: + case 20: /* Line 1792 of yacc.c */ -#line 181 "ASN1.y" +#line 186 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT); _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str)); _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);} break; - case 18: + case 21: /* Line 1792 of yacc.c */ -#line 186 "ASN1.y" +#line 191 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; - case 19: + case 22: /* Line 1792 of yacc.c */ -#line 187 "ASN1.y" +#line 192 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (2)].node); _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (2)].node)),(yyvsp[(2) - (2)].node));} break; - case 20: + case 23: /* Line 1792 of yacc.c */ -#line 191 "ASN1.y" +#line 196 "ASN1.y" {(yyval.constant)=CONST_UNIVERSAL;} break; - case 21: + case 24: /* Line 1792 of yacc.c */ -#line 192 "ASN1.y" +#line 197 "ASN1.y" {(yyval.constant)=CONST_PRIVATE;} break; - case 22: + case 25: /* Line 1792 of yacc.c */ -#line 193 "ASN1.y" +#line 198 "ASN1.y" {(yyval.constant)=CONST_APPLICATION;} break; - case 23: + case 26: /* Line 1792 of yacc.c */ -#line 196 "ASN1.y" +#line 201 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TAG); _asn1_set_value((yyval.node),(yyvsp[(2) - (3)].str),strlen((yyvsp[(2) - (3)].str))+1);} break; - case 24: + case 27: /* Line 1792 of yacc.c */ -#line 198 "ASN1.y" +#line 203 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TAG | (yyvsp[(2) - (4)].constant)); _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);} break; - case 25: + case 28: /* Line 1792 of yacc.c */ -#line 202 "ASN1.y" +#line 207 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; - case 26: + case 29: /* Line 1792 of yacc.c */ -#line 203 "ASN1.y" +#line 208 "ASN1.y" {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_EXPLICIT);} break; - case 27: + case 30: /* Line 1792 of yacc.c */ -#line 204 "ASN1.y" +#line 209 "ASN1.y" {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_IMPLICIT);} break; - case 28: + case 31: /* Line 1792 of yacc.c */ -#line 207 "ASN1.y" +#line 212 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_DEFAULT); _asn1_set_value((yyval.node),(yyvsp[(2) - (2)].str),strlen((yyvsp[(2) - (2)].str))+1);} break; - case 29: + case 32: /* Line 1792 of yacc.c */ -#line 209 "ASN1.y" +#line 214 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_DEFAULT|CONST_TRUE);} break; - case 30: + case 33: /* Line 1792 of yacc.c */ -#line 210 "ASN1.y" +#line 215 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_DEFAULT|CONST_FALSE);} break; - case 33: + case 36: /* Line 1792 of yacc.c */ -#line 219 "ASN1.y" +#line 224 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER);} break; - case 34: + case 37: /* Line 1792 of yacc.c */ -#line 220 "ASN1.y" +#line 225 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER|CONST_LIST); _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));} break; - case 35: + case 38: /* Line 1792 of yacc.c */ -#line 222 "ASN1.y" +#line 227 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER);} break; - case 36: + case 39: /* Line 1792 of yacc.c */ -#line 224 "ASN1.y" +#line 229 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER|CONST_MIN_MAX); _asn1_set_down((yyval.node),_asn1_add_static_node(ASN1_ETYPE_SIZE)); _asn1_set_value(_asn1_get_down((yyval.node)),(yyvsp[(6) - (7)].str),strlen((yyvsp[(6) - (7)].str))+1); _asn1_set_name(_asn1_get_down((yyval.node)),(yyvsp[(3) - (7)].str));} break; - case 37: + case 40: /* Line 1792 of yacc.c */ -#line 230 "ASN1.y" +#line 235 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BOOLEAN);} break; - case 38: + case 41: /* Line 1792 of yacc.c */ -#line 233 "ASN1.y" +#line 238 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UTC_TIME);} break; - case 39: + case 42: /* Line 1792 of yacc.c */ -#line 234 "ASN1.y" +#line 239 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_GENERALIZED_TIME);} break; - case 40: + case 43: /* Line 1792 of yacc.c */ -#line 237 "ASN1.y" +#line 242 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SIZE|CONST_1_PARAM); _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);} break; - case 41: + case 44: /* Line 1792 of yacc.c */ -#line 240 "ASN1.y" +#line 245 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SIZE|CONST_MIN_MAX); _asn1_set_value((yyval.node),(yyvsp[(3) - (7)].str),strlen((yyvsp[(3) - (7)].str))+1); _asn1_set_name((yyval.node),(yyvsp[(6) - (7)].str));} break; - case 42: + case 45: /* Line 1792 of yacc.c */ -#line 245 "ASN1.y" +#line 250 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; - case 43: + case 46: /* Line 1792 of yacc.c */ -#line 246 "ASN1.y" +#line 251 "ASN1.y" {(yyval.node)=(yyvsp[(2) - (3)].node);} break; - case 44: + case 47: /* Line 1792 of yacc.c */ -#line 249 "ASN1.y" +#line 254 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_GENERALSTRING);} break; - case 45: + case 48: /* Line 1792 of yacc.c */ -#line 250 "ASN1.y" +#line 255 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_GENERALSTRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));} break; - case 46: + case 49: /* Line 1792 of yacc.c */ -#line 254 "ASN1.y" +#line 259 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_NUMERIC_STRING|CONST_UNIVERSAL);} break; - case 47: + case 50: /* Line 1792 of yacc.c */ -#line 255 "ASN1.y" +#line 260 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_NUMERIC_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));} break; - case 48: + case 51: /* Line 1792 of yacc.c */ -#line 259 "ASN1.y" +#line 264 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IA5_STRING);} break; - case 49: + case 52: /* Line 1792 of yacc.c */ -#line 260 "ASN1.y" +#line 265 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IA5_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));} break; - case 50: + case 53: /* Line 1792 of yacc.c */ -#line 264 "ASN1.y" +#line 269 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TELETEX_STRING);} break; - case 51: + case 54: /* Line 1792 of yacc.c */ -#line 265 "ASN1.y" +#line 270 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_TELETEX_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));} break; - case 52: + case 55: /* Line 1792 of yacc.c */ -#line 269 "ASN1.y" +#line 274 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_PRINTABLE_STRING);} break; - case 53: + case 56: /* Line 1792 of yacc.c */ -#line 270 "ASN1.y" +#line 275 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_PRINTABLE_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));} break; - case 54: + case 57: /* Line 1792 of yacc.c */ -#line 274 "ASN1.y" +#line 279 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UNIVERSAL_STRING);} break; - case 55: + case 58: /* Line 1792 of yacc.c */ -#line 275 "ASN1.y" +#line 280 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UNIVERSAL_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));} break; - case 56: + case 59: /* Line 1792 of yacc.c */ -#line 279 "ASN1.y" +#line 284 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BMP_STRING);} break; - case 57: + case 60: /* Line 1792 of yacc.c */ -#line 280 "ASN1.y" +#line 285 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BMP_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));} break; - case 58: + case 61: /* Line 1792 of yacc.c */ -#line 284 "ASN1.y" +#line 289 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UTF8_STRING);} break; - case 59: + case 62: /* Line 1792 of yacc.c */ -#line 285 "ASN1.y" +#line 290 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_UTF8_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));} break; - case 60: + case 63: /* Line 1792 of yacc.c */ -#line 289 "ASN1.y" +#line 294 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_VISIBLE_STRING);} break; - case 61: + case 64: /* Line 1792 of yacc.c */ -#line 290 "ASN1.y" +#line 295 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_VISIBLE_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));} break; - case 62: + case 65: /* Line 1792 of yacc.c */ -#line 294 "ASN1.y" +#line 299 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OCTET_STRING);} break; - case 63: + case 66: /* Line 1792 of yacc.c */ -#line 295 "ASN1.y" +#line 300 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OCTET_STRING|CONST_SIZE); _asn1_set_down((yyval.node),(yyvsp[(3) - (3)].node));} break; - case 64: + case 67: /* Line 1792 of yacc.c */ -#line 299 "ASN1.y" +#line 304 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CONSTANT); _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str)); _asn1_set_value((yyval.node),(yyvsp[(3) - (4)].str),strlen((yyvsp[(3) - (4)].str))+1);} break; - case 65: + case 68: /* Line 1792 of yacc.c */ -#line 304 "ASN1.y" +#line 309 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; - case 66: + case 69: /* Line 1792 of yacc.c */ -#line 305 "ASN1.y" +#line 310 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (3)].node); _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (3)].node)),(yyvsp[(3) - (3)].node));} break; - case 67: + case 70: /* Line 1792 of yacc.c */ -#line 309 "ASN1.y" +#line 314 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BIT_STRING);} break; - case 68: + case 71: /* Line 1792 of yacc.c */ -#line 310 "ASN1.y" +#line 315 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BIT_STRING|CONST_SIZE);} break; - case 69: + case 72: /* Line 1792 of yacc.c */ -#line 312 "ASN1.y" +#line 317 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_BIT_STRING|CONST_LIST); _asn1_set_down((yyval.node),(yyvsp[(4) - (5)].node));} break; - case 70: + case 73: /* Line 1792 of yacc.c */ -#line 317 "ASN1.y" +#line 322 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_ENUMERATED|CONST_LIST); _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));} break; - case 71: + case 74: /* Line 1792 of yacc.c */ -#line 322 "ASN1.y" +#line 327 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID);} break; - case 72: + case 75: /* Line 1792 of yacc.c */ -#line 325 "ASN1.y" +#line 330 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IDENTIFIER); _asn1_set_value((yyval.node),(yyvsp[(1) - (1)].str),strlen((yyvsp[(1) - (1)].str))+1);} break; - case 73: + case 76: /* Line 1792 of yacc.c */ -#line 327 "ASN1.y" +#line 332 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_IDENTIFIER|CONST_SIZE); _asn1_set_value((yyval.node),(yyvsp[(1) - (2)].str),strlen((yyvsp[(1) - (2)].str))+1); _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));} break; - case 74: -/* Line 1792 of yacc.c */ -#line 330 "ASN1.y" - {(yyval.node)=(yyvsp[(1) - (1)].node);} - break; - - case 75: -/* Line 1792 of yacc.c */ -#line 331 "ASN1.y" - {(yyval.node)=(yyvsp[(1) - (1)].node);} - break; - - case 76: + case 77: /* Line 1792 of yacc.c */ -#line 332 "ASN1.y" +#line 335 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; case 78: /* Line 1792 of yacc.c */ -#line 334 "ASN1.y" +#line 336 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; case 79: /* Line 1792 of yacc.c */ -#line 335 "ASN1.y" - {(yyval.node)=(yyvsp[(1) - (1)].node);} - break; - - case 80: -/* Line 1792 of yacc.c */ -#line 336 "ASN1.y" +#line 337 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; case 81: /* Line 1792 of yacc.c */ -#line 337 "ASN1.y" +#line 339 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; case 82: /* Line 1792 of yacc.c */ -#line 338 "ASN1.y" +#line 340 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; case 83: /* Line 1792 of yacc.c */ -#line 339 "ASN1.y" +#line 341 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; case 84: /* Line 1792 of yacc.c */ -#line 340 "ASN1.y" +#line 342 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; case 85: /* Line 1792 of yacc.c */ -#line 341 "ASN1.y" +#line 343 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; case 86: /* Line 1792 of yacc.c */ -#line 342 "ASN1.y" +#line 344 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; case 87: /* Line 1792 of yacc.c */ -#line 343 "ASN1.y" +#line 345 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; case 88: /* Line 1792 of yacc.c */ -#line 344 "ASN1.y" +#line 346 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; case 89: /* Line 1792 of yacc.c */ -#line 345 "ASN1.y" +#line 347 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; case 90: /* Line 1792 of yacc.c */ -#line 346 "ASN1.y" +#line 348 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; case 91: /* Line 1792 of yacc.c */ -#line 347 "ASN1.y" +#line 349 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; case 92: /* Line 1792 of yacc.c */ -#line 348 "ASN1.y" +#line 350 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; case 93: /* Line 1792 of yacc.c */ -#line 349 "ASN1.y" +#line 351 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; case 94: /* Line 1792 of yacc.c */ -#line 350 "ASN1.y" - {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_NULL);} +#line 352 "ASN1.y" + {(yyval.node)=(yyvsp[(1) - (1)].node);} break; case 95: @@ -2296,214 +2302,232 @@ yyreduce: case 96: /* Line 1792 of yacc.c */ #line 354 "ASN1.y" + {(yyval.node)=(yyvsp[(1) - (1)].node);} + break; + + case 97: +/* Line 1792 of yacc.c */ +#line 355 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_NULL);} + break; + + case 98: +/* Line 1792 of yacc.c */ +#line 358 "ASN1.y" + {(yyval.node)=(yyvsp[(1) - (1)].node);} + break; + + case 99: +/* Line 1792 of yacc.c */ +#line 359 "ASN1.y" {(yyval.node)=_asn1_mod_type((yyvsp[(2) - (2)].node),CONST_TAG); _asn1_set_right((yyvsp[(1) - (2)].node),_asn1_get_down((yyval.node))); _asn1_set_down((yyval.node),(yyvsp[(1) - (2)].node));} break; - case 97: + case 100: /* Line 1792 of yacc.c */ -#line 359 "ASN1.y" +#line 364 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; - case 98: + case 101: /* Line 1792 of yacc.c */ -#line 360 "ASN1.y" +#line 365 "ASN1.y" {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_DEFAULT); _asn1_set_right((yyvsp[(2) - (2)].node),_asn1_get_down((yyval.node))); _asn1_set_down((yyval.node),(yyvsp[(2) - (2)].node));} break; - case 99: + case 102: /* Line 1792 of yacc.c */ -#line 363 "ASN1.y" +#line 368 "ASN1.y" {(yyval.node)=_asn1_mod_type((yyvsp[(1) - (2)].node),CONST_OPTION);} break; - case 100: + case 103: /* Line 1792 of yacc.c */ -#line 366 "ASN1.y" +#line 371 "ASN1.y" {(yyval.node)=_asn1_set_name((yyvsp[(2) - (2)].node),(yyvsp[(1) - (2)].str));} break; - case 101: + case 104: /* Line 1792 of yacc.c */ -#line 369 "ASN1.y" +#line 374 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; - case 102: + case 105: /* Line 1792 of yacc.c */ -#line 370 "ASN1.y" +#line 375 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (3)].node); _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (3)].node)),(yyvsp[(3) - (3)].node));} break; - case 103: + case 106: /* Line 1792 of yacc.c */ -#line 374 "ASN1.y" +#line 379 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SEQUENCE); _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));} break; - case 104: + case 107: /* Line 1792 of yacc.c */ -#line 376 "ASN1.y" +#line 381 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SEQUENCE_OF); _asn1_set_down((yyval.node),(yyvsp[(3) - (3)].node));} break; - case 105: + case 108: /* Line 1792 of yacc.c */ -#line 378 "ASN1.y" +#line 383 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SEQUENCE_OF|CONST_SIZE); _asn1_set_right((yyvsp[(2) - (4)].node),(yyvsp[(4) - (4)].node)); _asn1_set_down((yyval.node),(yyvsp[(2) - (4)].node));} break; - case 106: + case 109: /* Line 1792 of yacc.c */ -#line 383 "ASN1.y" +#line 388 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SET); _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));} break; - case 107: + case 110: /* Line 1792 of yacc.c */ -#line 385 "ASN1.y" +#line 390 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SET_OF); _asn1_set_down((yyval.node),(yyvsp[(3) - (3)].node));} break; - case 108: + case 111: /* Line 1792 of yacc.c */ -#line 387 "ASN1.y" +#line 392 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_SET_OF|CONST_SIZE); _asn1_set_right((yyvsp[(2) - (4)].node),(yyvsp[(4) - (4)].node)); _asn1_set_down((yyval.node),(yyvsp[(2) - (4)].node));} break; - case 109: + case 112: /* Line 1792 of yacc.c */ -#line 392 "ASN1.y" +#line 397 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_CHOICE); _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node));} break; - case 110: + case 113: /* Line 1792 of yacc.c */ -#line 396 "ASN1.y" +#line 401 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_ANY);} break; - case 111: + case 114: /* Line 1792 of yacc.c */ -#line 397 "ASN1.y" +#line 402 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_ANY|CONST_DEFINED_BY); _asn1_set_down((yyval.node),_asn1_add_static_node(ASN1_ETYPE_CONSTANT)); _asn1_set_name(_asn1_get_down((yyval.node)),(yyvsp[(4) - (4)].str));} break; - case 112: + case 115: /* Line 1792 of yacc.c */ -#line 402 "ASN1.y" +#line 407 "ASN1.y" {(yyval.node)=_asn1_set_name((yyvsp[(3) - (3)].node),(yyvsp[(1) - (3)].str));} break; - case 113: + case 116: /* Line 1792 of yacc.c */ -#line 404 "ASN1.y" +#line 409 "ASN1.y" {(yyval.node)=_asn1_set_name((yyvsp[(3) - (3)].node), last_error_token);} break; - case 114: + case 117: /* Line 1792 of yacc.c */ -#line 408 "ASN1.y" +#line 413 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID|CONST_ASSIGN); _asn1_set_name((yyval.node),(yyvsp[(1) - (7)].str)); _asn1_set_down((yyval.node),(yyvsp[(6) - (7)].node));} break; - case 115: + case 118: /* Line 1792 of yacc.c */ -#line 412 "ASN1.y" +#line 417 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID|CONST_ASSIGN|CONST_1_PARAM); _asn1_set_name((yyval.node),(yyvsp[(1) - (6)].str)); _asn1_set_value((yyval.node),(yyvsp[(2) - (6)].str),strlen((yyvsp[(2) - (6)].str))+1); _asn1_set_down((yyval.node),(yyvsp[(5) - (6)].node));} break; - case 116: + case 119: /* Line 1792 of yacc.c */ -#line 417 "ASN1.y" +#line 422 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_INTEGER|CONST_ASSIGN); _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str)); _asn1_set_value((yyval.node),(yyvsp[(4) - (4)].str),strlen((yyvsp[(4) - (4)].str))+1);} break; - case 117: + case 120: /* Line 1792 of yacc.c */ -#line 422 "ASN1.y" +#line 427 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; - case 118: + case 121: /* Line 1792 of yacc.c */ -#line 423 "ASN1.y" +#line 428 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; - case 119: + case 122: /* Line 1792 of yacc.c */ -#line 426 "ASN1.y" +#line 431 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (1)].node);} break; - case 120: + case 123: /* Line 1792 of yacc.c */ -#line 427 "ASN1.y" +#line 432 "ASN1.y" {(yyval.node)=(yyvsp[(1) - (2)].node); _asn1_set_right(_asn1_get_last_right((yyvsp[(1) - (2)].node)),(yyvsp[(2) - (2)].node));} break; - case 121: + case 124: /* Line 1792 of yacc.c */ -#line 431 "ASN1.y" +#line 436 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID); _asn1_set_down((yyval.node),(yyvsp[(3) - (4)].node)); _asn1_set_name((yyval.node),(yyvsp[(1) - (4)].str));} break; - case 122: + case 125: /* Line 1792 of yacc.c */ -#line 434 "ASN1.y" +#line 439 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID); _asn1_set_name((yyval.node),(yyvsp[(1) - (3)].str));} break; - case 123: + case 126: /* Line 1792 of yacc.c */ -#line 436 "ASN1.y" +#line 441 "ASN1.y" {(yyval.node)=_asn1_add_static_node(ASN1_ETYPE_OBJECT_ID); _asn1_set_name((yyval.node),(yyvsp[(1) - (1)].str));} break; - case 124: + case 127: /* Line 1792 of yacc.c */ -#line 460 "ASN1.y" +#line 465 "ASN1.y" {(yyval.constant)=CONST_EXPLICIT;} break; - case 125: + case 128: /* Line 1792 of yacc.c */ -#line 461 "ASN1.y" +#line 466 "ASN1.y" {(yyval.constant)=CONST_IMPLICIT;} break; /* Line 1792 of yacc.c */ -#line 2507 "ASN1.c" +#line 2531 "ASN1.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2735,7 +2759,7 @@ yyreturn: /* Line 2055 of yacc.c */ -#line 465 "ASN1.y" +#line 470 "ASN1.y" @@ -2782,7 +2806,7 @@ _asn1_yylex () if (c == EOF) { - strcpy (last_token, "End Of File"); + snprintf (last_token, sizeof(last_token), "End Of File"); return 0; } @@ -2813,7 +2837,7 @@ _asn1_yylex () lastc = c; if (c == EOF) { - strcpy (last_token, "End Of File"); + snprintf (last_token, sizeof(last_token), "End Of File"); return 0; } else @@ -2840,7 +2864,7 @@ _asn1_yylex () } ungetc (c, file_asn1); string[counter] = 0; - strcpy (last_token, string); + snprintf (last_token, sizeof(last_token), "%s", string); /* Is STRING a number? */ for (k = 0; k < counter; k++) @@ -2848,7 +2872,7 @@ _asn1_yylex () break; if (k >= counter) { - strcpy (yylval.str, string); + snprintf (yylval.str, sizeof(yylval.str), "%s", string); return NUM; /* return the number */ } @@ -2858,7 +2882,7 @@ _asn1_yylex () return key_word_token[i]; /* STRING is an IDENTIFIER */ - strcpy (yylval.str, string); + snprintf (yylval.str, sizeof(yylval.str), "%s", string); return IDENTIFIER; } } @@ -2885,7 +2909,7 @@ _asn1_create_errorDescription (int error, char *error_desc) snprintf(error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE, "%s file was not found", file_name); break; case ASN1_SYNTAX_ERROR: - strcpy(error_desc, last_error); + snprintf(error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE, "%s", last_error); break; case ASN1_NAME_TOO_LONG: snprintf (error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE, @@ -126,6 +126,7 @@ static int _asn1_yylex(void); %type <node> type_assig_right_tag_default enumerated_def %type <str> pos_num neg_num pos_neg_num pos_neg_identifier pos_neg_list %type <str> num_identifier +%type <str> int_identifier %type <constant> class explicit_implicit %% @@ -144,24 +145,28 @@ definitions: definitions_id } ; -pos_num : NUM {strcpy($$,$1);} - | '+' NUM {strcpy($$,$2);} +pos_num : NUM {snprintf($$,sizeof($$),"%s",$1);} + | '+' NUM {snprintf($$,sizeof($$),"%s",$2);} ; -neg_num : '-' NUM {strcpy($$,"-"); - strcat($$,$2);} +neg_num : '-' NUM {snprintf($$,sizeof($$),"-%s",$2);} ; -pos_neg_num : pos_num {strcpy($$,$1);} - | neg_num {strcpy($$,$1);} +pos_neg_num : pos_num {snprintf($$,sizeof($$),"%s",$1);} + | neg_num {snprintf($$,sizeof($$),"%s",$1);} ; -num_identifier : NUM {strcpy($$,$1);} - | IDENTIFIER {strcpy($$,$1);} +num_identifier : NUM {snprintf($$,sizeof($$),"%s",$1);} + | IDENTIFIER {snprintf($$,sizeof($$),"%s",$1);} ; -pos_neg_identifier : pos_neg_num {strcpy($$,$1);} - | IDENTIFIER {strcpy($$,$1);} +int_identifier : NUM {snprintf($$,sizeof($$),"%s",$1);} + | '-' NUM {snprintf($$,sizeof($$),"-%s",$2);} + | IDENTIFIER {snprintf($$,sizeof($$),"%s",$1);} +; + +pos_neg_identifier : pos_neg_num {snprintf($$,sizeof($$),"%s",$1);} + | IDENTIFIER {snprintf($$,sizeof($$),"%s",$1);} ; constant: '(' pos_neg_num ')' {$$=_asn1_add_static_node(ASN1_ETYPE_CONSTANT); @@ -220,7 +225,7 @@ integer_def: INTEGER {$$=_asn1_add_static_node(ASN1_ETYPE_INT | INTEGER'{'constant_list'}' {$$=_asn1_add_static_node(ASN1_ETYPE_INTEGER|CONST_LIST); _asn1_set_down($$,$3);} | integer_def'(' pos_neg_list ')' {$$=_asn1_add_static_node(ASN1_ETYPE_INTEGER);} - | integer_def'('num_identifier'.''.'num_identifier')' + | integer_def'('int_identifier'.''.'int_identifier')' {$$=_asn1_add_static_node(ASN1_ETYPE_INTEGER|CONST_MIN_MAX); _asn1_set_down($$,_asn1_add_static_node(ASN1_ETYPE_SIZE)); _asn1_set_value(_asn1_get_down($$),$6,strlen($6)+1); @@ -508,7 +513,7 @@ _asn1_yylex () if (c == EOF) { - strcpy (last_token, "End Of File"); + snprintf (last_token, sizeof(last_token), "End Of File"); return 0; } @@ -539,7 +544,7 @@ _asn1_yylex () lastc = c; if (c == EOF) { - strcpy (last_token, "End Of File"); + snprintf (last_token, sizeof(last_token), "End Of File"); return 0; } else @@ -566,7 +571,7 @@ _asn1_yylex () } ungetc (c, file_asn1); string[counter] = 0; - strcpy (last_token, string); + snprintf (last_token, sizeof(last_token), "%s", string); /* Is STRING a number? */ for (k = 0; k < counter; k++) @@ -574,7 +579,7 @@ _asn1_yylex () break; if (k >= counter) { - strcpy (yylval.str, string); + snprintf (yylval.str, sizeof(yylval.str), "%s", string); return NUM; /* return the number */ } @@ -584,7 +589,7 @@ _asn1_yylex () return key_word_token[i]; /* STRING is an IDENTIFIER */ - strcpy (yylval.str, string); + snprintf (yylval.str, sizeof(yylval.str), "%s", string); return IDENTIFIER; } } @@ -611,7 +616,7 @@ _asn1_create_errorDescription (int error, char *error_desc) snprintf(error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE, "%s file was not found", file_name); break; case ASN1_SYNTAX_ERROR: - strcpy(error_desc, last_error); + snprintf(error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE, "%s", last_error); break; case ASN1_NAME_TOO_LONG: snprintf (error_desc, ASN1_MAX_ERROR_DESCRIPTION_SIZE, |