Skip to content

Commit

Permalink
Merge branch 'master' into merge_mouse07410_aper_implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
brchiu committed Nov 15, 2017
2 parents 1fcb51a + 07f8c3e commit 5912147
Show file tree
Hide file tree
Showing 63 changed files with 4,155 additions and 3,506 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,24 @@ stamp-h*
# /skeletons
/skeletons/check-*

# /tests/
/tests/tests-asn1c-smoke/Makefile.am.libasncodec
/tests/tests-asn1c-smoke/Makefile.am.sample
/tests/tests-asn1c-smoke/*.[acho]
/tests/tests-asn1c-smoke/*.asn
/tests/tests-asn1c-smoke/*.txt
/tests/tests-asn1c-smoke/converter-example

# /tests/
/tests/tests-c-compiler/test-*

# /tests/tests-skeletons
/tests/tests-skeletons/check-*
!/tests/tests-skeletons/check-*.c

# /tests/tests-randomized
/tests/tests-randomized/test-param-helper

# /doc/docsrc
doc/docsrc/*.aux
doc/docsrc/*.dvi
Expand Down
4 changes: 3 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@

NOTABLE:
* converter-sample.c renamed into converter-example.c.
* OBJECT IDENTIFIER and RELATIVE-OID API simplified.
* asn1c -no-gen-example option to disable converter-example generation.
* Added random value generation (-R option to converter-example).
* Added LibFuzzer-based randomized tests for supported transfer syntaxes
(DER, OER, UPER, XER) into tests/tests-randomized. See the following
article to get the latest LibFuzzer-enabled clang on macOS:
https://medium.com/@levwalkin/compile-llvm-clang-libfuzzer-b61e82718430
then ensure the new clang is in the way:
CC=clang CXX=clang++ ./configure --enable-Werror --enable-test-fuzzer
* OBJECT IDENTIFIER and RELATIVE-OID API simplified.
* uper_encode() API got new argument (breaks API compatibility).
* asn1c -gen-XXX flags are deprecated. Use -no-gen-XXX to disable codecs.

FIXES:
* CVE-2017-12966 verified not present.
Expand Down
28 changes: 22 additions & 6 deletions asn1c/asn1c.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ int
main(int ac, char **av) {
enum asn1p_flags asn1_parser_flags = A1P_NOFLAGS;
enum asn1f_flags asn1_fixer_flags = A1F_NOFLAGS;
enum asn1c_flags asn1_compiler_flags = A1C_NO_C99;
enum asn1c_flags asn1_compiler_flags =
A1C_NO_C99 | A1C_GEN_OER | A1C_GEN_PER | A1C_GEN_EXAMPLE;
enum asn1print_flags asn1_printer_flags = APF_NOFLAGS;
int print_arg__print_out = 0; /* Don't compile, just print parsed */
int print_arg__fix_n_print = 0; /* Fix and print */
Expand All @@ -71,7 +72,7 @@ main(int ac, char **av) {
/*
* Process command-line options.
*/
while((ch = getopt(ac, av, "EFf:g:hLPp:RS:vW:X")) != -1) switch(ch) {
while((ch = getopt(ac, av, "EFf:g:hn:LPp:RS:vW:X")) != -1) switch(ch) {
case 'E':
print_arg__print_out = 1;
break;
Expand Down Expand Up @@ -121,13 +122,27 @@ main(int ac, char **av) {
asn1_compiler_flags |= A1C_GEN_PER;
} else if(strcmp(optarg, "en-OER") == 0) {
asn1_compiler_flags |= A1C_GEN_OER;
} else if(strcmp(optarg, "en-example") == 0) {
asn1_compiler_flags |= A1C_GEN_EXAMPLE;
} else {
fprintf(stderr, "-g%s: Invalid argument\n", optarg);
exit(EX_USAGE);
}
break;
case 'h':
usage(av[0]);
case 'n':
if(strcmp(optarg, "o-gen-PER") == 0) {
asn1_compiler_flags &= ~A1C_GEN_PER;
} else if(strcmp(optarg, "o-gen-OER") == 0) {
asn1_compiler_flags &= ~A1C_GEN_OER;
} else if(strcmp(optarg, "o-gen-example") == 0) {
asn1_compiler_flags &= ~A1C_GEN_EXAMPLE;
} else {
fprintf(stderr, "-n%s: Invalid argument\n", optarg);
exit(EX_USAGE);
}
break;
case 'P':
asn1_compiler_flags |= A1C_PRINT_COMPILED;
asn1_compiler_flags &= ~A1C_NO_C99;
Expand Down Expand Up @@ -500,14 +515,15 @@ usage(const char *av0) {
" -fincludes-quoted Generate #includes in \"double\" instead of <angle> quotes\n"
" -fknown-extern-type=<name> Pretend the specified type is known\n"
" -fline-refs Include ASN.1 module's line numbers in comments\n"
" -fno-constraints Do not generate constraint checking code\n"
" -fno-include-deps Do not generate courtesy #includes for dependencies\n"
" -fno-constraints Do not generate the constraint checking code\n"
" -fno-include-deps Do not generate the courtesy #includes for dependencies\n"
" -funnamed-unions Enable unnamed unions in structures\n"
" -fwide-types Use INTEGER_t instead of \"long\" by default, etc.\n"
"\n"

" -gen-OER Generate OER (X.696) support code\n"
" -gen-PER Generate PER (X.691) support code\n"
" -no-gen-OER Do not generate the OER (X.696) support code\n"
" -no-gen-PER Do not generate the PER (X.691) support code\n"
" -no-gen-example Do not generate the ASN.1 format converter example\n"
" -pdu={all|auto|Type} Generate PDU table (discover PDUs automatically)\n"
"\n"

Expand Down
Loading

0 comments on commit 5912147

Please sign in to comment.