Age | Commit message (Collapse) | Author |
|
|
|
|
|
The ASN.1 compiler would go into an infinite loop if a value
in an ENUMERATED was negative.
|
|
Split the test case duplicate_tags/1 into two parts. Do the
error checking test in error_SUITE. Keep the SeqOptional2
specification and compile it from the per/1 and ber_other/1
test cases (for coverage).
|
|
Object sets with extension mark and without optional fields was not
generated properly. It needs the default [enc|dec]_xxx function clause
for the open type but no other clauses.
|
|
|
|
|
|
This will also eliminate a dialyzer warning.
|
|
|
|
We don't want to touch the code used for encoding BIT STRINGs when
'legacy_erl_types' is active, since it will be removed within two
or three major releases. But we do want to suppress the dialyzer
warnings in the meantime. The easiest way is to call
encode_bit_string/4 with unknown types from an exported function
that is never actually called like this:
-export(['dialyzer-suppressions'/0]).
'dialyzer-suppressions'(Arg) ->
{A,B,C,D} = Arg,
encode_bit_string(A, B, C, D),
ok.
|
|
Calling library routines for validation of constraints may cause
dialyzer warnings if some type of constraints handled by the library
routine are not used in a specific ASN.1 module. To avoid those
warnings (and slightly speed up the decoding), inline the constraint
checking.
|
|
|
|
Make the source code a little bit cleaner.
|
|
|
|
|
|
|
|
|
|
According to the ASN.1 standard, having multiple UNIQUE in class
is allowed. For example:
C ::= CLASS {
&id1 INTEGER UNIQUE,
&id2 INTEGER UNIQUE
}
In practice, no one uses multiple UNIQUE.
The ASN.1 compiler will crash if a class with multiple UNIQUE
is used, but the backends have half-hearted support for multiple
UNIQUE in that they generate helper functions similar to:
getenc_OBJECT_SET(id1, 42) ->
fun enc_XXX/3;
...
Since we have no plans to implement support for multiple UNIQUE
(no one seems to have missed it), simplify the helper functions
like this:
getenc_OBJECT_SET(42) ->
fun enc_XXX/3;
...
|
|
To facilitate optimizing PER encoding using an intermediate
format, we must change asn1rtt_real_common:encode_real/1 so that
it only returns the encoded binary.
|
|
Simplify the backends by letting asn1ct_check replacing a
with the actual type.
|
|
|
|
asn1ct_check does not pass #pobjectdef{} records on to the backends
(all the original #pobjectdef{} records have been instantiated and
changed to #objectdef{} records).
|
|
Dialyzer issued two new warnings when the 'catch' was removed in
the previous commit.
|
|
|
|
ObjectDescriptor, UTCTime, and GeneralizedTime are not special and
can be handled in the same way as all other restricted string types.
|
|
This slight optimization will also eliminate some Dialyzer warnings.
|
|
asn1ct_check has translated all occurrences of 'ANY' to 'ASN1_OPEN_TYPE'.
|
|
|
|
The record #typereference{} is only used internally within
the asn1ct_parser2 module (the parser translates it to
an #'Externaltypereference{} record).
|
|
|
|
|
|
|
|
asn1ct_name:delete/1 is used from asn1ct_gen_ber_bin_v2:add_removed_bytes/1,
but that function is not used.
|
|
It is recommended to use byte_size/1 or tuple_size/1 instead of
size/1.
|
|
|
|
Add the option 'legacy_bit_string' to decode to the old list format.
|
|
In the BER run-time code (asn1rtt_ber), there is a general function
for decoding a string:
decode_restricted_string(Tlv, Range, StringType, TagsIn)
But the StringType argument is not important. It is only used
internally in asn1rtt_ber to distinguish universal strings and BMP
strings from other strings. By slightly refactoring the string
decoding code, we can eliminate the StringType argument and a
subsequent run-time test on the string type. That will slightly reduce
code size, slightly increase speed, and eliminate Dialyzer warnings.
|
|
Refactor decoding of BIT STRINGs so that the run-time code does
not spend testing conditions that are known already at compile-time
(which wastes time and produces unnecessary Dialyzer warnings).
There are three ways to decode BIT STRINGs:
1) To a list of bit names (and {bit,Position} for unnamed positions)
if the BIT STRING type has any bit names.
2a) To a list of ones and zeros if there are no named bits, and the
compact_bit_string option was NOT given.
2b) To a {Unused,Bin} tuple if there are no named bits compact_bit_string
option WAS given.
Structure the decoding functions in the same way.
|
|
The template modules (asn1rtt_*.erl) are based on the existing
run-time modules, but with some simplifications and improvements,
for example:
The run-time functions for BER encoding took a Constraint argument which
was not used. It has been eliminated, along with the unused StringType
argument for the encode_restricted_string function.
The Range argument for decode_enumerated() has been dropped since it
was not used.
|
|
Support for the notation was removed in 6ef8cbdaaaa1c30a7dc462063.
|
|
It is time to clean up the mess of back-ends.
Remove all the obsolete back-ends and simplify the options used
to select them.
New Option Old Equivalent
---------- --------------
ber ber_bin,optimize,nif
per per,optimize,nif
uper uper_bin
The old options will still be recognized and translated to the
new options, but will also print a warning.
That implies that deprecated features that only are implemented
in the old 'ber' back-end will no longer work (e.g. the
{Typename,Value} notation).
Also make the return type for the generated encode/2 function
consistent. It used to be a binary for per and uper, and an iolist
for ber. Always make it a binary.
|
|
The 'keyed_list' was only supported for the 'ber' and 'ber_bin'
backends and has been undocumented for a long time. Also remove
the note in the documentation about the feature.
|
|
|
|
All table access is now performed in a separate module. This will allow
changes to how ETS is handled by changing only this module. Note that
the module exports a very ETS-like interface for now which would have to
be maintained even if the data format would change (to a hash map for
example).
|
|
|
|
|
|
|
|
* kenneth/asn1/nested_extaddgroup/OTP-8797:
Add support for ExtensionAdditionGroup notation in nested types as well
Conflicts:
lib/asn1/test/test_undecoded_rest.erl
|
|
In the previous version support for ExtensionAdditionGroups (i.e [[...]])
was added but it did not handle the occurence of the notation in nested types.
Now this is handled as well and the support is hopefully complete.
Also cleanup of warnings for obsolete guard functions in test suites.
|
|
* ta/asn1-verbose:
Add test for verbose option to asn1_SUITE
Teach asn1ct verbose option
OTP-8565 ta/asn1-verbose
By default, the ASN.1 compiler is now silent in the absence of warnings or
errors. The new 'verbose' option or the '-v' option for erlc can be given
to show extra information (for instance, about the files that are generated).
(Thanks to Tuncer Ayaz.)
|