# Asn1 Release Notes

## Asn1 1.4.1

### Fixed errors and malfunctions

- Now is the Default value for an ENUMERATED returned as the name from the NamedList when decoding. (Own Id: OTP-4633)

- It was an internal failure when permitted alphabet constraint existed together with for instance a size constraint. E.g. when a referenced type is constrained by a size constraint and the defined type in turn is constrained by a permitted alphabet constraint.
  (Own Id: OTP-4559)

- Record is generated in hrl file for a CHOICE with extension mark that has an internal SEQUENCE/SET definition. (Own Id: OTP-4560)

- Now is the length of a SEQUENCE/SET OF correctly encoded/decoded (PER). (Own Id: OTP-4590)

- The problem with unordered decoded terms when a component is a ObjectClassFieldType has been solved. (Own Id: OTP-4591)

### Improvements and new features

- More complex definitions with TableConstraints where the SimpleTable and ComponentRelation are on different levels is now fully supported. (Own Id: OTP-4631)

## Asn1 1.4

### Fixed errors and malfunctions

### Improvements and new features

- Each generated .erl file have now a function info/0 that returns information about the used compiler version and options.
  (Own Id: OTP-4373)

- When compiling an ASN.1 module the compiler generates an Erlang module that is compiled by the Erlang compiler. Earlier it was not possible to add options to the final step, the Erlang compilation. By adding any option that is not recognized as a specific ASN.1 option it will be passed to the final step like: `erlc +debug_info Mymodule.asn` or `asn1ct:compile('Mymodule',[debug_info])`.
  (Own Id: OTP-4491)

- Earlier one couldn't multi file compile modules that had different tagdefaul, which now is possible. Equal Type/Value names in different modules are resolved by renaming (concatenate type name and module name): If two types with the same name T exist in module A and module B they will get the new names TA and TB.
  (Own Id: OTP-4492)
  (Aux Id: OTP-3983)

- BER: Encode/decode of data have been significantly improved. By use of the compiler options `ber_bin` and `optimize`, optimized code will be generated and the optimized run-time module will be used.
  (Own Id: OTP-4493)

## Asn1 1.3.3.1

### Fixed errors and malfunctions

- Proper length encoding and padding implemented for a <c>BIT STRING</c> with NamedNumberList and size constraint as value range. This functionality didn't work in the rare occasion when the NamedNumberList is shorter than the lower bound of the constraint.As in this example: <c>TestS ::= BIT STRING {a (0),b (1)} (SIZE (3..8))</c>
  (Own Id: OTP-4353)

- Bug in compiler, when an <c>OBJECT IDENTIFIER</c> value consisting of two identifiers (Defined values or Name form identifiers) was falsely interpreted causing a compiling error is now corrected.
  (Own Id: OTP-4354)

- Internal error in check phase that caused crash on <c>ObjectClassFieldType</c> in ber_bin is corrected.
  (Own Id: OTP-4390)

- Tags for open types are handled according to <c>x.680 30.6c</c>, i.e. open types shall not be tagged <c>IMPLICIT.</c>
  (Own Id: OTP-4395)
  (Aux Id: OTP-4390)

## Asn1 1.3.3

### Fixed errors and malfunctions

- Now gives the compiler an apropriate error report when exported undefined types are detected.
  (Own Id: OTP-4129)

- The type `ObjectDescriptor` is now supported, previously the implementation of encode/decode for this rarely used type was incomplete.
  (Own Id: OTP-4161)
  (Aux Id: seq7165)

- In case of per and compact_bit_string the rightmost byte were erronous truncated when the rightmost bits of that byte were zeros. This is now corrected.
  (Own Id: OTP-4200)

- Bad match of returnvalue from decode_length in skipvalue/3 has now been fixed.
  (Own Id: OTP-4232)

- Now is decode of ENUMERATED handled correctly, when tagged EXPLICIT.
  (Own Id: OTP-4234)

- The compiler now parses and handles the ValueFromObject construct.
  (Own Id: OTP-4242)

- Now does the compiler handle the case when the object set in simple table and componentrelation constraints is of a CLASS without a UNIQUE field. In this case is the octets, which is assumed to be encoded, encoded as an open type.
  (Own Id: OTP-4248)
  (Aux Id: OTP-4242)

- Compiler handles objects in AdditionalElementSetSpec in ObjectSetSpec, i.e. the objects that are referred to after the ellipses in an object set.
  (Own Id: OTP-4275)
- Now are values with a component of type CHOICE encoded with indefinite length correctly decoded.
  (Own Id: OTP-4358)

### Improvements and new features

- The language constructs (from the old 1988 standard) `ANY` and `ANY DEFINED BY` are now implemented.
  (Own Id: OTP-2741)
  (Aux Id: seq 1188)

- Now it is checked in run-time if a <c>OBJECT IDENTIFIER</c> value is unvalid
  (Own Id: OTP-4235)
- The ASN.1 types EXTERNAL,EMBEDDED PDV and CHARACTER STRING now have full support in the compiler.
  (Own Id: OTP-4247)
- A driver in C does the final job (complete) of the PER encoding when files are compiled with <c>per_bin</c> and <c>optimize</c> flags. It gives significant faster encoding for PER. (Own Id: OTP-4355)
- Encode and decode of PER encoding has been made faster by moving analysis done in run-time to compile-time. These optimizations are available by compiling ASN.1 files with options <c>per_bin</c> and <c>optimize</c>.
  (Own Id: OTP-4381)
  (Aux Id: OTP-4355)

## Asn1 1.3.2

### Fixed errors and malfunctions

- Now does the compiler check values (including referenced values), and formats the value so it is suitable to use as input to encoding functions.
  (Own Id: OTP-3277)
  (Aux Id: OTP-4103)

- Unnecessary external function calls in generated code are now generated as internal function calls.
  (Own Id: OTP-4073)

### Improvements and new features

- Now is Information Objects supported in BER encoding.
  (Own Id: OTP-3980)
  (Aux Id: OTP-3979 OTP-3978)

- PER: A new option `per_bin` is now supported. When used the generated encode/decode functions use binaries and the bit syntax to get better performance than the old `per` variant which used lists. All values input to encode and returned from decode are compatible between `per` and `per_bin` except for open types which are represented as binaries with per_bin and octet lists with per. We recommend that you use per_bin instead of per from now on, the use of binaries will be the default in coming versions and all improvements and optimizations for PER will be concentrated to that solution.
  (Own Id: OTP-4094)

- Support for DER implemented. Used by flag +der when compiling. Include the full BER encoding plus: sorting of SET components, sorting of encoded elements in SET OF, full check of default values in SET and SEQUENCE. See new documentation on DER in user_guide sections 1.3.1; 1.4.11; 1.4.12; 1.4.14; 1.4.16 and 1.10, in the reference manual for asn1ct.
  (Own Id: OTP-4103)

## Asn1 1.3.1

### Fixed errors and malfunctions

- Do not generate record in .hrl file for SET types
  Own Id: OTP-4025
- Fixed internal error when using BIT STRINGs with Named Number List in combination with `compact_bit_string` and `ber_bin` options.
  Own Id: OTP-4026
  Aux Id: OTP-3982
- The atom 'com' can now be used in ENUMERATED as an EnumerationItem.
  Own Id: OTP-4037
  Aux Id: Seq 7036
- ber: Now it is possible (again) to encode data format "{Type,Value}" in a SEQUENCE OF RequestParameter, when RequestParameter is of type ENUMERATED. The {Type,Value} notation is not recommended for use, it is redundant and exist only for very ancient backwards compatibility reasons. The "feature" might be removed in forthcoming versions.
  Own Id: OTP-4057
  Aux Id: Seq 7066
- A bug in the parser, that caused failure on COMPONENTS OF is now removed.
  Own Id: OTP-4058

## Asn1 1.3

### Known problems

- The compiler will now check that a value referenced by name does exist.
  Own Id: OTP-3277
- BER:Decode of a type T ::= SEQUENCE OF C fails if C is encoded with indefinite length. This is know corrected.
  Own Id: OTP-3811
  Aux Id: seq5040

### Fixed errors and malfunctions

- The new parser handles imports when one import ends with FROM, a modulename and a reference to a objectidentifier followed by imports from other modules.
  Own Id: OTP-3463
- The compiler did not check that a name mentioned as EXPORTED actually is defined within the module. This is now corrected.
  Own Id: OTP-3659
- Removed bug caused by use of nested indefinite length
  Own Id: OTP-3994

### Improvements and new features

- Now supporting most common use of parameterization according to X.683
  (Own Id: OTP-3978)

- PER: Now supporting most common use of Information Objects according to X.681. A new parser has been implemented. The error messages due to syntax errors are slightly different than previous. TableConstraint part of X.682 now also supported.
  Own Id: OTP-3979
- New compiler option added: `ber_bin`. The compiler generates code with new bit syntax. Run time functions uses bit syntax when feasible. Higher encoding/decoding performance in most cases. Se also comments for Asn1 1.2.9.3.
  Own Id: OTP-3981
- A more compact format of BIT STRING in Erlang is now available by use of the compiler option `compact_bit_string`. It is much faster when large BIT STRINGs are used.
  Own Id: OTP-3982
- Now possible to merge many ASN.1 input files to one Erlang file by use of a configuration file that lists the ASN.1 files.
  Own Id: OTP-3983
- New documentation in User's Guide in section:
  3.1: New compile-time functions and options are described.
  4.6: New compact format of BIT STRING is described.
  4.8: Additional comments on character strings.
  7: New section describing ASN.1 Information Objects.
  8: New section describing Parameterization.
  Reference Manual/asn1ct New compile options are described.
  Own Id: OTP-3984
  Aux Id: OTP-3978, OTP-3979, OTP-3981, OTP-3982, OTP-3983
- Added the functionality to invoke ASN1Mod:encode (and decode).
  Own Id: OTP-3985
- Performance improvements by removing not necessary use of apply when calling asn1rt:encode. Also other general improvements.
  Own Id: OTP-3988

There are also release notes for older versions.