aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1rtt_ext.erl
AgeCommit message (Collapse)Author
2017-05-04Update copyright yearRaimo Niskanen
2017-02-06Teach the ASN.1 compiler the 'maps' optionBjörn Gustavsson
When the 'maps' option is given, the SEQUENCE and SET types are represented as maps instead of as records. Optional and default values must be not be given as asn1_NOVALUE or asn1_DEFAULT in a map passed to the M:encode/2 function; they must be omitted from the map. Similarly, when decoding missing values will be omitted from the map. No .hrl files will be generated when the 'maps' options is used. That means values in an ASN.1 module must be retrieved by calling the appropriate function in generated module. Since we one day hope to get rid of the options 'compact_bit_string', 'legacy_bit_string', and 'legacy_erlang_types', we will not allow them to be combined with the 'maps' option.
2016-03-15update copyright-yearHenrik Nord
2015-06-18Change license text to APLv2Bruce Yinhe
2014-01-24Fix OCTET STRINGBjörn Gustavsson
2013-01-25Update copyright yearsBjörn-Egil Dahlberg
2013-01-22Fix EXTERNAL 1990/1994 conversion information lossBjörn Gustavsson
There are two different definitions of the EXTERNAL data type in ASN.1: the original from 1990 and an updated from 1994. Both defintions are encoded in the same way (in BER). There are still systems in use that use the old definition of EXTERNAL, so the asn1 application must still support both. It has been decided that the asn1 application should handle both the forms without any compiler options. Internally the asn1 application uses the 1990 definition. The encode functions will accept both definitions, but translate the 1994 format to the 1990 format if needed. When decoding, it will decode to the 1990 definition format first and then translate to the 1994 defintion format. One problem with this approach is that the conversion to the 1994 format may not be loss-less (where the 1990 defintion had a CHOICE between an OPEN TYPE, OCTET STRING, or BIT STRING, the 1994 definition only supports an OCTET STRING), and therefore it might not be possible to correctly re-encode the data in the 1990 format. It seems that the only reliable way to handle that problem is to not do the conversion to the 1994 format if the conversion is not loss-less. (There is an attempt when translating to the 1990 format to recover the CHOICE alternative based on the Erlang type of the data value, but that is neither reliable nor future-proof.) That is, when decoding an EXTERNAL value, the resulting tuple could either conform to the 1990 or 1994 definition, and applications must be prepared to handle that. The mail conversation where this issue was first reported can be found here: http://erlang.org/pipermail/erlang-questions/2011-April/057697.html Reported-by: Harald Welte <[email protected]>
2013-01-22Add and use asn1rtt_extBjörn Gustavsson