Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added OBJECT IDENTIFIER and RELATIVE-OID value emission #9

Open
wants to merge 76 commits into
base: master
Choose a base branch
from

Commits on Dec 6, 2010

  1. Started modifications of asn1c skeletons, adding OBJECT_IDENTIFIER_* …

    …and RELATIVE_OID_* functions.
    
    Decided on standardized terminology:
     ASN.1 notation
     dot notation
     BER encoding
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    23a8a70 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f84b258 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f35f39b View commit details
    Browse the repository at this point in the history
  4. Finished implementing cmp.

    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    af0ada7 View commit details
    Browse the repository at this point in the history
  5. Implemented RELATIVE-OID cmp, eq.

    Cleaned up OBJECT_IDENTIFIER.h.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    063c538 View commit details
    Browse the repository at this point in the history
  6. Implemented compute_reverse_lengt, which provides the appropriate len…

    …gth of bytes to use/allocate for a given range of OID dot notation data.
    
    Worked on reverse double dabble algorithm.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    29f4f2c View commit details
    Browse the repository at this point in the history
  7. Finished implementing reverse double-dabble algorithm with perform_bc…

    …d2ber.
    
    Tested reverse double-dabble algorithm. It just about works! The one issue has to do with improper counting of the number of bytes to allocate initially.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    d890356 View commit details
    Browse the repository at this point in the history
  8. Finished implementing reverse double-dabble algorithm.

    Fixed allocation logic error.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    bbf057d View commit details
    Browse the repository at this point in the history
  9. Added comment.

    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    754bcf6 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1fbf6d3 View commit details
    Browse the repository at this point in the history
  11. Added build to svn:ignore.

    Added asn1c Xcode project. The Xcode project uses the Makefile external build system.
    Changed number in asn1p_oid from integer to char* (base 10).
    Added a new type, TOK_arcnumber, which is a string, and lexical rules for handling it.
    Fixed a coding error in enber.c regarding the tag class.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    84e742b View commit details
    Browse the repository at this point in the history
  12. Messed with asn1c quite a bit to try to get the dumb thing to work.

    Improved Xcode project.
    After much effort, got Value type to parse ObjectIdentifier data.
    Changed ObjectIdentifier token data to TOK_arcnumber, and made asn1p_oid_t contain a string with the base10-encoded number.
    Fixed up the asn1print stuff to handle printing Object Identifiers.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    486c4ae View commit details
    Browse the repository at this point in the history
  13. Added and tested output (compilation) using asn1c_lang_C_value_OBJECT…

    …_IDENTIFIER. It works, except for actual BER encoding.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    8df1926 View commit details
    Browse the repository at this point in the history
  14. Removed trailing ; from being emitted.

    Emitted RELATIVE-OID code.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    6553dd0 View commit details
    Browse the repository at this point in the history
  15. Cleaned up more code.

    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    906890a View commit details
    Browse the repository at this point in the history
  16. Added ModuleName.h and ModuleName.c output preamble, epilogue, and mi…

    …ddle code.
    
    Tested the code and got it to output the OBJECT IDENTIFIER and RELATIVE-OID structures correctly! Now the only thing missing is the actual BER encoding data.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    fa100d6 View commit details
    Browse the repository at this point in the history
  17. Added asn1c_oid.c and .h, which contain asn1c_oid_ber_encode, to conv…

    …ert the arg into an appropriate array of bytes.
    
    Added code to output the right sequence of uint8_t bytes in C.
    Adjusted Makefiles so that asn1c_oid compiles.
    Removed the warning "unber.c:395: warning: format not a string literal and no format arguments".
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    c77692c View commit details
    Browse the repository at this point in the history
  18. Fixed stylistic issues in OBJECT_IDENTIFIER.c.

    Started work on asn1c_oid_ber_encode.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    3113956 View commit details
    Browse the repository at this point in the history
  19. Fixed stylistic issues in RELATIVE-OID.c/.h and OBJECT_IDENTIFIER.h.

    Added declarations of new functions OBJECT_IDENTIFIER_eq1 and 1eq1.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    e91f517 View commit details
    Browse the repository at this point in the history
  20. Wrote asn1c_oid_ber_encode.

    Fixed output issues with asn1c_print_ber.
    Tested the code, and it works great for both OID and R-OID cases! The next step is to handle symbolic references.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    8090268 View commit details
    Browse the repository at this point in the history
  21. Implemented the first part of symbolic references for OIDs.

    Implemented a static function, get_len_of_oid, that encapsulates the recursion. (Careful: a malformed OID value definition may cause infinite recursion!)
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    bd8df8b View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    96c0aab View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    95d7290 View commit details
    Browse the repository at this point in the history
  24. Finished asn1c_oid.c's handling of identifiers in the same module.

    Adjusted hexademcial output so that it is capitalized.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    29fc9fa View commit details
    Browse the repository at this point in the history
  25. Got the general code for symbolic lookups to work for getting the OID…

    … length, when the symbol is in an import.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    1c62168 View commit details
    Browse the repository at this point in the history
  26. Finished implementing OID and ROID compiling, including with referenc…

    …es to other modules.
    
    Changed sizeof DEF_### to sizeof(DEF_###).
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    8abc8c4 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    979588a View commit details
    Browse the repository at this point in the history
  28. Removed TOK_arcnumber, replacing it with TOK_number.

    Changed TOK_number so that it stores both the int (in a_int/tv_int.a_int) and the ascii representation (tv_int.ascii_int).
    Spelunked through the .y code and .l code to figure out what was wrong with parsing.
    Determined that ObjectIdentifier: is accepting {}, but that is wrong per X.208 and X.680.
    Modified the lexer/parser so that only true (non-empty) ObjectIdentifier values are accepted.
    Added ATV_EMPTY value type, so that {} can be parsed correctly.
    Noted that {} can only appear for BIT STRING, SEQUENCE [OF], and SET [OF].
    Added {} handling for BIT STRING since otherwise the parser/fixer dies on ASN1C-UsefulInformationObjectClasses.asn1.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    79cd062 View commit details
    Browse the repository at this point in the history
  29. Removed printf debug statements.

    Removed old {} from ObjectIdentifier.
    Added ATV_EMPTY switch cases.
    Cleaned up other parts of the code.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    772ca3d View commit details
    Browse the repository at this point in the history
  30. Fixed output so that it includes <OBJECT_IDENTIFIER.h> or <RELATIVE-O…

    …ID.h> as-needed in the module headers.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    015203c View commit details
    Browse the repository at this point in the history
  31. Added support for iterating over all AMT_VALUE data inside each modul…

    …e, and emitting appropriate headers when those values are present, in the module header file.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    46eb597 View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    6b6e92c View commit details
    Browse the repository at this point in the history
  33. Reverted prior changes because the code was getting unmanageable and …

    …it didn't work anyway.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    dabc59e View commit details
    Browse the repository at this point in the history
  34. Added OBJECT IDENTIFIER emitting code for module OID directly to asn1…

    …c_save.c.
    
    Tested the code, and it works!
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    d775e95 View commit details
    Browse the repository at this point in the history
  35. Made progress on OBJECT_IDENTIFIER_eq1 and 1eq1.

    Added comments on utility functions.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    d79276f View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    48f1599 View commit details
    Browse the repository at this point in the history
  37. Fixed if ( -> if( styling throughout the code.

    Added copyright statements and increased the version.
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    db60f97 View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    91f5c01 View commit details
    Browse the repository at this point in the history
  39. Added change log notes.

    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    76dc927 View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    f000578 View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    e3f2689 View commit details
    Browse the repository at this point in the history
  42. Merged oid-value into master: now asn1c can parse and emit OBJECT IDE…

    …NTIFIER and RELATIVE-OID values.
    
    Merge branch 'oid-value'
    
    Conflicts:
    	configure
    	configure.ac
    	libasn1parser/asn1p_l.c
    seantek committed Dec 6, 2010
    Configuration menu
    Copy the full SHA
    f2dc826 View commit details
    Browse the repository at this point in the history

Commits on Dec 17, 2010

  1. Added support for OBJECT IDENTIFIER valuereferences, namely:

     id-foo OBJECT IDENTIFIER ::= {1 2 3 4}
     id-fooref OBJECT IDENTIFIER ::= id-foo
    Value references are output as #define id_fooref id_foo
    preprocessor directives. The equivalent in C++ would be to use the
    reference & type, but the reference type is unavailable in C.
    seantek committed Dec 17, 2010
    Configuration menu
    Copy the full SHA
    dd2c6ef View commit details
    Browse the repository at this point in the history
  2. Added notes on the operation of asn1fix_compat.c.

    Added notes and changes so that OBJECT IDENTIFIER -> OBJECT IDENTIFIER
    and RELATIVE-OID -> RELATIVE-OID value references are passed through as-is, rather than being
    converted to their actual values, so that the compiler can optimize and save space.
    Added support for RELATIVE-OID value references, and tested the code. It works!
    seantek committed Dec 17, 2010
    Configuration menu
    Copy the full SHA
    83a0df2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b772ef5 View commit details
    Browse the repository at this point in the history
  4. Fixed ASN_EXPR_TYPE2STR so that it no longer causes gcc to emit the w…

    …arnings.
    
    Fixed numbers in the asn1fix_retrieve.c file, so that the numbers are stored as "3" not 3 (per the new format).
    seantek committed Dec 17, 2010
    Configuration menu
    Copy the full SHA
    07cb01a View commit details
    Browse the repository at this point in the history
  5. Ported the changes to ASN_EXPR_TYPE2STR to the Perl file (not sure wh…

    …at it does exactly, though).
    seantek committed Dec 17, 2010
    Configuration menu
    Copy the full SHA
    e3e7ae3 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    18b852b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    ab17322 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    ca15be6 View commit details
    Browse the repository at this point in the history
  9. Wrote the specialization OBJECT_IDENTIFIER_common1r1, which is slight…

    …ly more efficient than the general case, OBJECT_IDENTIFIER_common1r.
    
    Tested the code.
    seantek committed Dec 17, 2010
    Configuration menu
    Copy the full SHA
    27a9368 View commit details
    Browse the repository at this point in the history
  10. Implemented the RELATIVE-OID constructor functions, which construct a…

    … RELATIVE_OID_t structure from differentials between
    
     two OIDs;
     a base number of arcs and a full OID;
     a base size in bytes (arc-aligned) and a full OID.
    Added RELATIVE_OID_get_arcs_count, which performs the equivalent operation as OBJECT_IDENTIFIER_get_arcs_count but with RELATIVE-OID semantics.
    Tested the code.
    Added documentation.
    seantek committed Dec 17, 2010
    Configuration menu
    Copy the full SHA
    bfe34d7 View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2011

  1. Added asn1fix_oid.c and asn1fix_oid.h to turn ATV_UNPARSED OBJECT IDE…

    …NTIFIERs and RELATIVE-OIDs into actual parsed values.
    seantek committed Jun 15, 2011
    Configuration menu
    Copy the full SHA
    7964d0a View commit details
    Browse the repository at this point in the history
  2. Reverted parser in libasn1parser so that OBJECT IDENTIFIERs and other…

    … values are left as ATV_UNPARSED.
    
    Added dependencies on OBJECT_IDENTIFIER.h and RELATIVE-OID.h when values of those types are emitted.
    seantek committed Jun 15, 2011
    Configuration menu
    Copy the full SHA
    da57952 View commit details
    Browse the repository at this point in the history
  3. Fixed an uninitialized res variable.

    Moved the definition of struct RELATIVE_OID from OBJECT_IDENTIFIER.h to RELATIVE-OID.h, because functions in OBJECT_IDENTIFIER.h rely on that definition.
    seantek committed Jun 15, 2011
    Configuration menu
    Copy the full SHA
    9b5cd6e View commit details
    Browse the repository at this point in the history
  4. Removed #include <RELATIVE-OID.h> from OBJECT_IDENTIFIER.c.

    Fixed some warnings encountered during make check with gcc, specifically around pointer sizes:
     Fixed warning: format %d expects type int, but long int in INTEGER.c.
     Fixed warning: cast from pointer to integer of different size in constr_SET_OF.c and per_support.c.
    seantek committed Jun 15, 2011
    Configuration menu
    Copy the full SHA
    8324207 View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2011

  1. Cleaned up the code.

    Fixed printf signs in check-03.c.
    Fixed initialization of rval, fprintf formatting, missing switches, unused variables, and signs in check-119.-fnative-types.-gen-PER.c.
    Fixed signs in check-30.c.
    Added intermediate cast to (size_t) in libasn1compiler output for const OID and RELATIVE-OID values to prevent gcc from complaining about const being discarded (after consultation with vlm). It is intentional that the source array is const, because it is an optimization and a check (possibly OS-enforced) to prevent the program from writing to a constant value at runtime.
    Noted that when the constraint check is ignored, because the constraint matches the natural range of the variable, gcc complains that the variable is not referenced.
    Fixed the above warning by introducing a comma operator and the void operator, so that cv (or whatever variable name) is referenced.
    seantek committed Jun 16, 2011
    Configuration menu
    Copy the full SHA
    83a8bd6 View commit details
    Browse the repository at this point in the history
  2. Fixed check-119 and check-126 warnings regarding printf format type m…

    …ismatches, uninitialized variables, and overshadowed global declarations.
    seantek committed Jun 16, 2011
    Configuration menu
    Copy the full SHA
    d2a176b View commit details
    Browse the repository at this point in the history
  3. Fixed printf formatting sizes, overshadowed declarations, and other w…

    …arnings in check-131 and check-35.
    seantek committed Jun 16, 2011
    Configuration menu
    Copy the full SHA
    110dc7b View commit details
    Browse the repository at this point in the history
  4. Fixed check-35 (overshadowing), check-41 (signed, overshadowing), che…

    …ck-42 (signed, printf sizing), and check-70 (signed, missing ctype.h for isspace).
    seantek committed Jun 16, 2011
    Configuration menu
    Copy the full SHA
    4e0b018 View commit details
    Browse the repository at this point in the history
  5. Added er.encoded = 0 in BOOLEAN.c to deal with the fact that the enco…

    …ded member is not initialized when the struct is returned.
    
    This appears to be the correct behavior based on INTEGER.c and OCTET_STRING.c's handling of encoding uper.
    seantek committed Jun 16, 2011
    Configuration menu
    Copy the full SHA
    832c258 View commit details
    Browse the repository at this point in the history
  6. Advanced the version to 0.9.25 (temporarily--work is still in progress).

    Added -fmodule-oids flag, which means that module OIDs will only be emitted when this flag is set. By default, module OIDs are not emitted.
    Added documentation on -fmodule-oids.
    Implemented A1C_MODULE_OIDS to emit module OIDs when the flag is present.
    Discovered that changes to keep track of ASN_MODULE_SOURCES= and ASN_MODULE_HEADERS= was lost from asn1c_save.c, so began to rewrite those changes with the "used_modules" technique.
    Added attribution and advanced copyright date to 2011.
    seantek committed Jun 16, 2011
    Configuration menu
    Copy the full SHA
    b844b86 View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2011

  1. Added module_emitted boolean (enum) and removed used_modules iteratio…

    …n in asn1c_save.c.
    
    Tested the code: it appears to work, for the most part.
    seantek committed Jun 17, 2011
    Configuration menu
    Copy the full SHA
    3e12f24 View commit details
    Browse the repository at this point in the history
  2. In support of check-50 (which has value references for types that der…

    …ive from INTEGER), added asn1c_lang_C_value_REFERENCE to handle AMT_VALUE A1TC_REFERENCE data. The code does not actually output the value (as that is "complicated") but it does output the declaration for the value.
    
    Changed () to <> for the asn1c URL.
    Added output to ModuleName.h so that it includes the referenced type headers, which is necessary for compiling A1TC_REFERENCE values successfully.
    seantek committed Jun 17, 2011
    Configuration menu
    Copy the full SHA
    acd5a52 View commit details
    Browse the repository at this point in the history
  3. Suppressed output of ; when dealing with references.

    Fixed an off-by-one error.
    Used quotation marks all the time, not <>, for referenced types.
    Emitted "Including external dependencies" comment.
    seantek committed Jun 17, 2011
    Configuration menu
    Copy the full SHA
    ba3370f View commit details
    Browse the repository at this point in the history
  4. Updated ChangeLog to include a discussion of emission of headers for …

    …values of type references and values of raw INTEGERs.
    
    Updated the asn1c man page.
    Moved value reference code into a common, static function, emit_value_reference.
    Implemented output for INTEGER values (headers only, no definitions).
    Cleaned up commented-out code.
    Added stderr output that indicates that the ModuleName.c and ModuleName.h files are compiled.
    seantek committed Jun 17, 2011
    Configuration menu
    Copy the full SHA
    fa48781 View commit details
    Browse the repository at this point in the history
  5. Prevented emission of ModuleName sources for ASN.1 values when the mo…

    …dules are standard modules (marked interally as MT_STANDARD_MODULE).
    
    Added more stuff to .gitignore in support of playing nice with Xcode.
    seantek committed Jun 17, 2011
    Configuration menu
    Copy the full SHA
    b333bb4 View commit details
    Browse the repository at this point in the history
  6. Merge remote branch 'upstream/master'

    Synchronized with vlm master, resolving the asn1c ASN1C_ENVIRONMENT_VERSION to 925 in the process.
    
    Conflicts:
    	skeletons/asn_internal.h
    seantek committed Jun 17, 2011
    Configuration menu
    Copy the full SHA
    65599f2 View commit details
    Browse the repository at this point in the history
  7. Updated some copyright years.

    seantek committed Jun 17, 2011
    Configuration menu
    Copy the full SHA
    6e23ca9 View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2011

  1. Added validity checks to make sure that the dot notation OID is in th…

    …e proper format for OBJECT_IDENTIFIER_fromDotNotation. No invalid dot notation OIDs allowed.
    seantek committed Aug 22, 2011
    Configuration menu
    Copy the full SHA
    0609f6a View commit details
    Browse the repository at this point in the history
  2. Added a check in OBJECT_IDENTIFIER__dump_body to ensure that invalidl…

    …y-encoded OID arcs cause a failure to be noted.
    seantek committed Aug 22, 2011
    Configuration menu
    Copy the full SHA
    55b8a8b View commit details
    Browse the repository at this point in the history
  3. Added check in OBJECT_IDENTIFIER__dump_arc that reports an invalid ra…

    …nge (beyond the range of the accumulator) as <INVALID ERANGE>.
    
    Added check in OBJECT_IDENTIFIER__dump_body for <INVALID 0-LENGTH> (0-length OID) and <INVALID & 0x80> (where the last octet is >= 0x80).
    Changed output of original <INVALID> to <INVALID 0x80>.
    seantek committed Aug 22, 2011
    Configuration menu
    Copy the full SHA
    5790fd4 View commit details
    Browse the repository at this point in the history
  4. Replaced der_encode_primitive with OBJECT_IDENTIFIER_encode_der in OB…

    …JECT_IDENTIFIER.c.
    
    Added checks for the three evils: 0-length OID, OID ending in >= 0x80, and first octet in subidentifier series (aka arc) == 0x80.
    seantek committed Aug 22, 2011
    Configuration menu
    Copy the full SHA
    93111e5 View commit details
    Browse the repository at this point in the history
  5. Added OBJECT_IDENTIFIER_encode_uper.

    Added OBJECT_IDENTIFIER__check_valid.
    Added support for checking for invalid OID values when encoding uper.
    Tested code for invalid OID values when encoding xer. It works.
    seantek committed Aug 22, 2011
    Configuration menu
    Copy the full SHA
    d13326b View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2011

  1. Added checks in OBJECT_IDENTIFIER_constraint to handle 0x80 at start …

    …of arc (subidentifier) and >= 0x80 at end, since _constraint already checks for size <= 0 (aka size < 1).
    seantek committed Aug 23, 2011
    Configuration menu
    Copy the full SHA
    b5d3d3b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4793836 View commit details
    Browse the repository at this point in the history