ASN1C 7.7.3 was released on May 8, 2024. Changes in this release include the following:
- Modified ASN1C to display a message if no syntax errors are detected in a .asn file and only a syntax check is being done (A1C-1242).
- Fixed a bug that could cause an exception during some memory free operations (A1C-1239).
- Changed the behavior of the "asn1c -licfiles" command so it will display a message if OSLICDIR is defined but contains no license file.
- Fixed a bug that prevented .xsd files from being added to a project in the ASN1C GUI (A1C-1206).
- Make it possible to use -compat ( <770 ) to avoid applying global-level dynamic config to BIT STRING types, or any level config to OCTET STRING types, and to not use the smallest integer type possible for ENUMERATED types (A1C-1197).
- Fixed a bug where non-compilable Go code would be generated (A1C-1184).
- Modified ASN1C to display an error message if -genreader or -genwriter is specified with no language (A1C-1174).
- ASN1C v7.7.2 included some changes related to PER encoding of BIT STRINGs with named bits and extensible size constraints. Those changes caused some values to be encoded with length zero where previously they wouldn't be. Further analysis has shown that the previous behavior was more correct, so in v7.7.3 these changes have been reverted (A1C-1123, A1C-1234).
ASN1C 7.7.2 was released on October 13, 2023. Changes in this release include the following:
- Fixed a bug in C PER decoder where a dynamic array is not initialized to null, as it should be, which could lead to a crash (A1C-1190).
- Fixed a bug in C/C++ PER code generation in which an element in a SEQUENCE with a size constraint that referenced a named type that also had size constraint was not producing correct code for encoding and decoding (A1C-1183).
- Fixed Go code generation to not use configured module-level enumPrefix in constants generated for CHOICE tags or ENUMERATED identifiers. (A1C-1173).
- Fixed generation of *Enum.h files to be in the folder specified by the -oh option, when that option is used (A1C-1167).
- Fixed a problem that could cause an element-level maxSize storage setting in a configuration file to be ignored (A1C-1157).
- Added missing return value checks for calls to rtxEncBit for C/C++ PER encoding (A1C-1151).
- Fixed a problem that prevented Go code from being generated from the ASN1C GUI on a Mac (A1C-1101).
- Fixed C/C++/Java/C# PER encoding for BIT STRING defined with named bits and an extensible size constraint, where values of length zero are not in the extension root. In such a case, values were not trimmed down to the correct size (A1C-1123).
- Fixed Go PER encoding for BIT STRING defined with named bits. Values with trailing zero bits were not trimmed as required (A1C-1123).
- Fixed a bug in C/C++ DER code generation for BIT STRING with named bits and an extensible constraint on size. The generated code had a function call with the wrong number of arguments (A1C-1098).
- Fixed a bug in Go code generation. Using -per and -ber together would result in generating Go code that would not compile (SALES-2144).
- Fixed a bug that could cause some invalid syntax in generated C or C++ XER/XML decode logic if the index for a table constraint was at one level in the ASN.1, but the open type was at a different level (e.g, in a CHOICE) (A1C-1106).
- Fixed a bug that could cause some confusing (though harmless) extraneous output in some code generation scenarios (A1C-1106).
- Fixed a bug that could cause an exception when generating C or C++ code for JSON when the ASN.1 included an EXTERNAL item (A1C-1109).
- Fixed a bug that could result in an erroneous memory allocation call in generated C or C++ code for JSON when the ASN.1 included an OBJECT IDENTIFIER (A1C-1109).
ASN1C 7.7.1 was released on June 22, 2023. Changes in this release include the following:
- Fixed a bug affecting C/C++ print to string functionality. A print to string function might incorrectly return an error for buffer overflow when there is no overflow (A1C-1064).
- Fixed errors reported when a table constraint on a CHOICE component uses a reference of the form @.abc (A1C-1068).
- Fixed C/C++ code generation errors for the case where X ::= Y and Y::= NULL (A1C-1068).
- Fixed C/C++ code PER table constraint decoding for cases where the open type and the key component are at different levels (A1C-1068).
- Eliminated an unnecessary call, in generated C/C++ code, to memset (OSCRTLMEMSET) an element in a dynamically allocated array, where the array as a whole was already initialized with memset (A1C-1060).
- Fixed an error caused by an ENUMERATED definition using a defined value.
- Fixed a crash for C++ OER decoders caused by a failure to properly initialize objects in a SEQUENCE OF T decoding where the -pdu option was used to force type T to be treated as a PDU type (A1C-1031).
- Fixed Go JER encoding of open type to follow X.697 and not to wrap the open type value in a JSON object.
- Fixed -compact 729 support for JSON, for Java and C#, for certain character string types, to be consistent with the behavior before asn1c 7.3.0 (i.e. to encode as character strings). These strings are encoded as octet string (hexadecimal) under X.697 but were encoded as character strings under the custom Obj-Sys encoding rules that predated X.697 (A1C-1011).
- Fixed a bug in the C NAS addon. 24.008 TFT decoding failed to set paramList.n to zero for an empty parameter list (A1C-982).
- (Enhancement) The C/C++ raw event handlers can now respond with ASN1RER_STOP_PARSE to stop any further parsing.
- Fixed a bug that could cause generated code to reference a non-existent element of a union (A1C-996).
- (Enhancement) Added a -noaccomment option to suppress the generation of the asn1c command line comment. The ASN1C GUI now also has a checkbox to do this suppression (A1C-1004).
- Fixed a bug in C OER length decoding in which a 0x80 byte was being interpreted as an indefinite length. OER only supports short and long forms, not indefinite.
ASN1C 7.7.0 was released on February 1, 2023. New features in this release include the following:
- Support has been added for generating code in Go to support the Basic and Distinguished Encoding Rules (BER and DER). For BER, this includes support for 3GPP TS 32.297 headers for CDR processing.
- The -go-rt-inc (Go run-time include) command-line option has been added to allow a user to force inclusion of a Go run-time module in the compiled module set. Normally Go compilation includes only the dependent modules for a given compilation. The main purpose of this is to allow a user to include a module that they may be interested in using in their main.go file (for example, TS 32.297, TBCD, BCD, or BER dump utility functions).
- The default version of Visual Studio for Windows SDKs is now Visual Studio 2019. The libraries in the c and cpp (or c_64 and cpp_64) hierarchies are now built with Visual Studio 2019. The default format for Visual Studio project files that ASN1C generates is now Visual Studio 2019.
- C# project file generation (the -vcproj qualifier) has been changed so the default version is Visual Studio 2019.
- C# run-time assemblies that target .Net v5 and .Net v6 have been added.
- New asn1c command line qualifiers named -dotnetv5 and -dotnetv6 have been added that will cause a .Net v5 or .Net v6 .csproj file to be generated if used with the -csharp and -vcproj qualifiers. If neither of these new qualifiers is specified, a generated .csproj file will target .Net v4.
- ASN1C will now recognize a production named PLMNidentity (e.g., from the RANAP specifications) and will treat it as an OCTET STRING. A command line option -noPLMN has been added to disable this special recognition and treat the production as it's defined in the ASN.1. An <isPLMNidentity> configuraton file item has also been added at production level to identify any production as a PLMNidentity. This new functionality is supported for all languages.
- In line with the PLMNidentity changes, the following functions and
methods have been added:
- C/C++: rtStringToPLMNidentity(), rtGetMCCFromPLMNidentity(), and rtGetMNCFromPLMNidentity().
- Java: Asn1Util.stringToPLMNidentity() and Asn1Util.PLMNidentityToString().
- C#: Asn1Util.StringToPLMNidentity() and Asn1Util.PLMNidentityToString().
- Python: plmnidentity_str_to_bin() and plmnidentity_bin_to_str() in util.py.
- Go: StrToPLMNidentity() and PLMNidentityToStr() in PLMNidentityUtils.go
- Java XML parser options (XMLPull and StAX) have been added to the GUI. (A1C-727)
- Generated code will now contain a comment with the asn1c command that was used to do the generation. (A1C-678)
- Tags can now use defined values for the tag value. The value must be INTEGER type and non-negative.
- The -dynamic command-line option has been added which has the same effect as adding <storage>dynamic</storage> at the global level in a configuration file. It will cause dynamic memory to be used for all binary and character string types whether the type has a size constraint or not. It will also cause dynamic arrays to be used for repeating types. In addition, this will also now cause a dynamic array to be used for the set of subidentifiers in an OBJECT IDENTIFIER or RELATIVE-OID structure.
- The ASN1C 64-bit Windows SDK now includes run-time libraries built with 64-bit mingw.
- Code generated for C or C++ with print to stream or print to string enabled will now print names of bits in BIT STRINGs where applicable. This feature was already present in code generated for regular printing.
- Distribution files for macOS now have names that more accurately convey the target platform. For macOS on x64 the distribution file will have macos_x64 in the name, and for macOS on M1 the distribution file will have macos_m1 in the name.
- In v7.6 C/C++ decoding the only non-fatal decoding errors that would be reported at the end of the decode step would be constraint violations. In v7.7 any non-fatal decoding errors will be reported, not just constraint violations.
- The File -> Open Folder menu option was added to the ASN1C GUI to allow a folder containing ASN.1 files to be opened. If a project file is present in the folder, this is opened; otherwise, all ASN.1 files are opened and added to a new project.
- The Edit -> Find in Files and Edit -> Replace in Files menu options were added to the GUI to allow search or search-and-replace to be done on multiple files.
- Added java/sample_ber/TS32297Encode that shows how to encode TS 32.297 headers using Java.
- Added csharp/sample_ber/TS32297Encode that shows how to encode TS 32.297 headers using C#.
- Added BCDString support for Python. The util.py file in the ASN1C Python run-time now contains functions named bcd_bin_to_str() and bcd_str_to_bin().
- There is no longer an SDK for Windows 32-bit. Instead, there is a single Windows SDK that contains both 32 and 64 bit run-time libraries. The compiler and ASN1C GUI are built for use on Windows 64-bit systems and will not work on 32-bit.
The following defects were fixed in this release:
- Fixed Java and C# integer bounds checking. In some cases, we were missing constraint checks (A1C-952).
- Fixed a defect in C/C++ raw event handlers where a runtime function for decoding integers (pd_ConsUInt64 and others) did not handle receiving a null pointer (A1C-924).
- Fixed a bug in C/C++ JER decoding for SEQUENCE OF using a dynamic array in which a crash could occur due to initializing a element before expanding the temporary buffer (A1C-913).
- Fixed generation of C/C++ raw events parser to eliminate some uses of an undeclared identifier (A1C-894).
- Fixed a bug in C/C++ test code generation where, if a file name is specified with the -gentest option, the generated C file could be missing some #includes. (A1C-889)
- Fixed a bug in C/C++ generation where comments were prematurely closed as a result of having */ in ASN.1 comment text. (A1C-889)
- Fixed Golang PER encode of fixed size BIT STRING to not override the number of bits provided by user (A1C-815).
- Fixed Golang aligned PER open type decoding to consume padding bits. Prior to this, if the actual type in the open type did not use a full number of bytes, the decoder's position would be off after decoding the open type and subsequent data would be incorrectly decoded (A1C-815).
- Fixed C/C++ unaligned PER decoding of ENUMERATED to include a check for invalid values in cases where an invalid value could be decoded (A1C-814).
- Fixed a bug in the GUI that resulted in an application fault if AVN encoding rules were used with an open type, and the table constraint handling option (-tables) was not checked. (A1C-708)
- Fixed a bug that resulted in the .so and .dylib libraries in the lib directories of non-Windows distributions being built without debug symbols. (A1C-802)
- Added generation of new_* functions for SEQUENCE OF types for C++ (A1C-383). These are especially helpful when -c++11 is used, to make sure the constructor is invoked for the std::list or std::vector.
- Fixed problems that resulted in the <isTBCDString> configuraton file item only being recognized for NAS code generation and in invalid code sometimes being generated if TBCD-STRING or TBCDSTRING was specified in the ASN.1 as a type. Part of this effort was the addition of Go utilities for TBCD strings in TBCDUtils.go. (A1C-824)
- Fixed problems that resulted in invalid code sometimes being generated if BCDString was specified in the ASN.1 as a type. Part of this effort was the addition of Go utilities for BCD Strings in BCDUtils.go. (A1C-824)
- The rtStringToBCD() function in the C/C++ run-time was previously accepting F as a possible character in the input string. This behavior was incorrect; valid characters for BCD strings are "0" through "9" and "A" through "E". This defect has been fixed. Note that there is a slight chance of backward incompatibility if customer code was previously calling the function and specifying a string that contained "F".