This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU libtasn1".
http://git.savannah.gnu.org/cgit/libtasn1.git/commit/?id=546930508edce93729d41c87901b20b2eb3631fc The branch, master has been updated via 546930508edce93729d41c87901b20b2eb3631fc (commit) via d154578295f0fda35cf0a1ec78648f7ec581bbed (commit) from 22dd88046a752020c9b7aec5710231da92cdbeb7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 546930508edce93729d41c87901b20b2eb3631fc Author: Nikos Mavrogiannopoulos <n...@gnutls.org> Date: Tue Oct 9 19:49:13 2012 +0200 Silence tests. commit d154578295f0fda35cf0a1ec78648f7ec581bbed Author: Nikos Mavrogiannopoulos <n...@gnutls.org> Date: Tue Oct 9 19:30:05 2012 +0200 Allow empty IDENTIFIERS in ASN1 definitions. Suggested by Ivan Shmakov. ----------------------------------------------------------------------- Summary of changes: lib/ASN1.c | 38 +++++++++++++++++++++++++------------- lib/ASN1.y | 2 ++ tests/Test_encoding.c | 16 +++++++++++----- tests/Test_errors.c | 7 ++++++- tests/Test_indefinite.c | 15 +++++++++++---- tests/Test_overflow.c | 27 +++++++++++++++++++++------ tests/Test_parser.c | 22 ++++++++++++++++------ tests/Test_tree.c | 44 +++++++++++++++++++++++++++++--------------- tests/crlf | 2 +- 9 files changed, 122 insertions(+), 51 deletions(-) diff --git a/lib/ASN1.c b/lib/ASN1.c index 48da82f..179d762 100644 --- a/lib/ASN1.c +++ b/lib/ASN1.c @@ -491,7 +491,7 @@ union yyalloc /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 43 /* YYNRULES -- Number of rules. */ -#define YYNRULES 99 +#define YYNRULES 100 /* YYNRULES -- Number of states. */ #define YYNSTATES 190 @@ -551,7 +551,8 @@ static const yytype_uint16 yyprhs[] = 195, 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 222, 224, 227, 230, 233, 235, 239, 244, 248, 253, 258, 262, 267, 272, 274, 279, 283, - 291, 298, 303, 305, 307, 309, 312, 317, 321, 323 + 291, 298, 303, 305, 307, 309, 312, 317, 321, 323, + 325 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -589,7 +590,7 @@ static const yytype_int8 yyrhs[] = -1, 5, 5, 3, 49, 62, 50, -1, 5, 7, 3, 56, -1, 89, -1, 90, -1, 91, -1, 92, 91, -1, 5, 49, 62, 50, -1, 5, 49, 50, - -1, 29, -1, 30, -1 + -1, 5, -1, 29, -1, 30, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -604,7 +605,8 @@ static const yytype_uint16 yyrline[] = 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 289, 290, 295, 296, 299, 302, 305, 306, 310, 312, 314, 319, 321, 323, 328, 332, 333, 338, 341, - 345, 350, 356, 357, 360, 361, 365, 368, 392, 393 + 345, 350, 356, 357, 360, 361, 365, 368, 370, 394, + 395 }; #endif @@ -661,7 +663,8 @@ static const yytype_uint8 yyr1[] = 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 81, 81, 82, 82, 82, 83, 84, 84, 85, 85, 85, 86, 86, 86, 87, 88, 88, 89, 90, - 90, 90, 91, 91, 92, 92, 93, 93, 94, 94 + 90, 90, 91, 91, 92, 92, 93, 93, 93, 94, + 94 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -676,7 +679,8 @@ static const yytype_uint8 yyr2[] = 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, 7, - 6, 4, 1, 1, 1, 2, 4, 3, 1, 1 + 6, 4, 1, 1, 1, 2, 4, 3, 1, 1, + 1 }; /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. @@ -684,8 +688,8 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 0, 0, 0, 0, 0, 1, 0, 8, 9, 97, - 16, 18, 0, 98, 99, 0, 0, 96, 19, 0, + 0, 98, 0, 0, 0, 1, 0, 8, 9, 97, + 16, 18, 0, 99, 100, 0, 0, 96, 19, 0, 0, 0, 17, 0, 0, 92, 93, 94, 0, 0, 0, 0, 0, 2, 95, 56, 33, 0, 0, 0, 0, 0, 37, 70, 86, 0, 38, 39, 44, 0, @@ -2382,21 +2386,29 @@ yyreduce: case 98: /* Line 1806 of yacc.c */ -#line 392 "ASN1.y" - {(yyval.constant)=CONST_EXPLICIT;} +#line 370 "ASN1.y" + {(yyval.node)=_asn1_add_static_node(TYPE_OBJECT_ID); + _asn1_set_name((yyval.node),(yyvsp[(1) - (1)].str));} break; case 99: /* Line 1806 of yacc.c */ -#line 393 "ASN1.y" +#line 394 "ASN1.y" + {(yyval.constant)=CONST_EXPLICIT;} + break; + + case 100: + +/* Line 1806 of yacc.c */ +#line 395 "ASN1.y" {(yyval.constant)=CONST_IMPLICIT;} break; /* Line 1806 of yacc.c */ -#line 2400 "ASN1.c" +#line 2412 "ASN1.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2627,7 +2639,7 @@ yyreturn: /* Line 2067 of yacc.c */ -#line 397 "ASN1.y" +#line 399 "ASN1.y" diff --git a/lib/ASN1.y b/lib/ASN1.y index 66df21a..18c93b3 100644 --- a/lib/ASN1.y +++ b/lib/ASN1.y @@ -367,6 +367,8 @@ definitions_id : IDENTIFIER '{' obj_constant_list '}' {$$=_asn1_add_static_no _asn1_set_name($$,$1);} | IDENTIFIER '{' '}' {$$=_asn1_add_static_node(TYPE_OBJECT_ID); _asn1_set_name($$,$1);} + | IDENTIFIER {$$=_asn1_add_static_node(TYPE_OBJECT_ID); + _asn1_set_name($$,$1);} ; /* diff --git a/tests/Test_encoding.c b/tests/Test_encoding.c index 370864b..6b3e7bb 100644 --- a/tests/Test_encoding.c +++ b/tests/Test_encoding.c @@ -36,18 +36,24 @@ int data_size = sizeof (data); int main (int argc, char *argv[]) { - int result; + int result, verbose = 0; asn1_node_t definitions = NULL; asn1_node_t asn1_element = NULL; char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE]; const char *treefile = getenv ("ASN1ENCODING"); + if (argc > 1) + verbose = 1; + if (!treefile) treefile = "Test_encoding.asn"; - printf ("\n\n/****************************************/\n"); - printf ("/* Test sequence : coding-decoding */\n"); - printf ("/****************************************/\n\n"); + if (verbose != 0) + { + printf ("\n\n/****************************************/\n"); + printf ("/* Test sequence : coding-decoding */\n"); + printf ("/****************************************/\n\n"); + } /* Check version */ if (asn1_check_version ("0.3.3") == NULL) @@ -124,6 +130,6 @@ main (int argc, char *argv[]) asn1_delete_structure (&asn1_element); - printf ("Success\n"); + if (verbose) printf ("Success\n"); exit (0); } diff --git a/tests/Test_errors.c b/tests/Test_errors.c index 8480b22..fcd1704 100644 --- a/tests/Test_errors.c +++ b/tests/Test_errors.c @@ -25,11 +25,16 @@ main (int argc, char *argv[]) { int ec = 0; const char *errstr; + int verbose = 0; + + if (argc > 1) + verbose = 1; do { errstr = asn1_strerror (ec); - asn1_perror (ec); + if (verbose != 0) + asn1_perror (ec); ec++; } while (errstr); diff --git a/tests/Test_indefinite.c b/tests/Test_indefinite.c index 3387a11..e951b46 100644 --- a/tests/Test_indefinite.c +++ b/tests/Test_indefinite.c @@ -48,6 +48,10 @@ main (int argc, char *argv[]) ssize_t size; const char *treefile = getenv ("ASN1PKIX"); const char *indeffile = getenv ("ASN1INDEF"); + int verbose = 0; + + if (argc > 1) + verbose = 1; if (!treefile) treefile = "pkix.asn"; @@ -55,10 +59,13 @@ main (int argc, char *argv[]) if (!indeffile) indeffile = "TestIndef.p12"; - printf ("\n\n/****************************************/\n"); - printf ("/* Test sequence : Test_indefinite */\n"); - printf ("/****************************************/\n\n"); - printf ("ASN1TREE: %s\n", treefile); + if (verbose) + { + printf ("\n\n/****************************************/\n"); + printf ("/* Test sequence : Test_indefinite */\n"); + printf ("/****************************************/\n\n"); + printf ("ASN1TREE: %s\n", treefile); + } /* Check version */ if (asn1_check_version ("0.2.11") == NULL) diff --git a/tests/Test_overflow.c b/tests/Test_overflow.c index cbf9381..6f81dc5 100644 --- a/tests/Test_overflow.c +++ b/tests/Test_overflow.c @@ -28,10 +28,15 @@ #include "libtasn1.h" int -main (void) +main (int argc, char** argv) { /* Test that values larger than long are rejected. This has worked fine with all versions of libtasn1. */ + int verbose = 0; + + if (argc > 1) + verbose = 1; + { unsigned char der[] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"; long l; @@ -40,7 +45,9 @@ main (void) l = asn1_get_length_der (der, sizeof der, &len); if (l == -2L) - puts ("OK: asn1_get_length_der bignum"); + { + if (verbose) puts ("OK: asn1_get_length_der bignum"); + } else { printf ("ERROR: asn1_get_length_der bignum (l %ld len %d)\n", l, len); @@ -63,7 +70,9 @@ main (void) l = asn1_get_length_der (der, der_len, &len); if (l == -2L) - puts ("OK: asn1_get_length_der intnum"); + { + if (verbose) puts ("OK: asn1_get_length_der intnum"); + } else { printf ("ERROR: asn1_get_length_der intnum (l %ld len %d)\n", l, @@ -87,7 +96,9 @@ main (void) l = asn1_get_length_der (der, der_len, &len); if (l == -4L) - puts ("OK: asn1_get_length_der overflow-small"); + { + if (verbose) puts ("OK: asn1_get_length_der overflow-small"); + } else { printf ("ERROR: asn1_get_length_der overflow-small (l %ld len %d)\n", l, @@ -111,7 +122,9 @@ main (void) l = asn1_get_length_der (der, der_len, &len); if (l == -4L) - puts ("OK: asn1_get_length_der overflow-large1"); + { + if (verbose) puts ("OK: asn1_get_length_der overflow-large1"); + } else { printf ("ERROR: asn1_get_length_der overflow-large1 (l %ld len %d)\n", l, @@ -135,7 +148,9 @@ main (void) l = asn1_get_length_der (der, der_len, &len); if (l == -2L) - puts ("OK: asn1_get_length_der overflow-large2"); + { + if (verbose) puts ("OK: asn1_get_length_der overflow-large2"); + } else { printf ("ERROR: asn1_get_length_der overflow-large2 (l %ld len %d)\n", l, diff --git a/tests/Test_parser.c b/tests/Test_parser.c index 062fc2f..6b9ef70 100644 --- a/tests/Test_parser.c +++ b/tests/Test_parser.c @@ -152,15 +152,22 @@ main (int argc, char *argv[]) char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE]; test_type *test; int errorCounter = 0, testCounter = 0; + int verbose = 0; + + if (argc > 1) + verbose = 1; fileCorrectName = getenv ("ASN1PARSER"); if (!fileCorrectName) fileCorrectName = "Test_parser.asn"; - printf ("\n\n/****************************************/\n"); - printf ("/* Test sequence : Test_parser */\n"); - printf ("/****************************************/\n\n"); - printf ("ASN1PARSER: %s\n", fileCorrectName); + if (verbose != 0) + { + printf ("\n\n/****************************************/\n"); + printf ("/* Test sequence : Test_parser */\n"); + printf ("/****************************************/\n\n"); + printf ("ASN1PARSER: %s\n", fileCorrectName); + } result = asn1_parser2tree (fileCorrectName, &definitions, errorDescription); @@ -207,8 +214,11 @@ main (int argc, char *argv[]) } - printf ("Total tests : %d\n", testCounter); - printf ("Total errors: %d\n", errorCounter); + if (verbose != 0) + { + printf ("Total tests : %d\n", testCounter); + printf ("Total errors: %d\n", errorCounter); + } if (errorCounter > 0) return 1; diff --git a/tests/Test_tree.c b/tests/Test_tree.c index 32c57e1..70b6df4 100644 --- a/tests/Test_tree.c +++ b/tests/Test_tree.c @@ -442,17 +442,23 @@ main (int argc, char *argv[]) unsigned char value[1024], der[1024]; int valueLen, tag = 0, class = 0; int k; - int start, end; + int start, end, verbose = 0; const char *str_p = NULL; const char *treefile = getenv ("ASN1TREE"); + + if (argc > 1) + verbose = 1; if (!treefile) treefile = "Test_tree.asn"; - printf ("\n\n/****************************************/\n"); - printf ("/* Test sequence : Test_tree */\n"); - printf ("/****************************************/\n\n"); - printf ("ASN1TREE: %s\n", treefile); + if (verbose != 0) + { + printf ("\n\n/****************************************/\n"); + printf ("/* Test sequence : Test_tree */\n"); + printf ("/****************************************/\n\n"); + printf ("ASN1TREE: %s\n", treefile); + } /* Check version */ if (asn1_check_version ("0.2.11") == NULL) @@ -571,16 +577,22 @@ main (int argc, char *argv[]) str_p = asn1_find_structure_from_oid (definitions, test->par1); break; case ACT_VISIT: - asn1_print_structure (out, asn1_element, test->par1, test->par3); - fprintf (out, "\n"); + if (verbose) + { + asn1_print_structure (out, asn1_element, test->par1, test->par3); + fprintf (out, "\n"); + } result = ASN1_SUCCESS; break; case ACT_PRINT_DER: - printf ("DER encoding len:%i\n", der_len); - printf ("DER encoding: "); - for (k = 0; k < der_len; k++) - printf ("%02x ", der[k]); - printf ("\n\n"); + if (verbose) + { + printf ("DER encoding len:%i\n", der_len); + printf ("DER encoding: "); + for (k = 0; k < der_len; k++) + printf ("%02x ", der[k]); + printf ("\n\n"); + } result = ASN1_SUCCESS; break; case ACT_SET_DER: @@ -757,9 +769,11 @@ main (int argc, char *argv[]) } - printf ("Total tests : %d\n", testCounter); - printf ("Total errors: %d\n", errorCounter); - + if (verbose != 0) + { + printf ("Total tests : %d\n", testCounter); + printf ("Total errors: %d\n", errorCounter); + } /* Clear the definition structures */ asn1_delete_structure (&definitions); diff --git a/tests/crlf b/tests/crlf index be92dcf..7d74c8b 100755 --- a/tests/crlf +++ b/tests/crlf @@ -32,4 +32,4 @@ ASN1DECODING=../src/asn1Decoding${EXEEXT} $ASN1DECODING \ $srcdir/../examples/pkix.asn \ $srcdir/crlf.cer \ - PKIX1Implicit88.Certificate + PKIX1Implicit88.Certificate >/dev/null hooks/post-receive -- GNU libtasn1