Age | Commit message (Collapse) | Author |
|
|
|
* maint-20:
Updated OTP version
Prepare release
Accept non-binary options as socket-options
Bump version
Fix broken handling of default values in extensions for PER
compiler: Fix live regs update on allocate in validator
Take fail labels into account when determining liveness in block ops
Check for overflow when appending binaries, and error out with system_limit
|
|
Default values have never worked in extension for PER.
Note that for default values in the root part of SEQUENCE,
giving a value equal to the DEFAULT value, will result in
the same encoding as if asn1_DEFAULT was given. However,
that behavior is not promised by the documentation. The
documentation says that asn1_DEFAULT should be used for
default values. For DEFAULT in extensions, only implement
what the documentation promises and nothing more.
ERIERL-60
|
|
EnumTypeName contains a hypen like fore example Cause-Misc. This caused
syntax errors when compiling the generated Erlang code.
|
|
|
|
Tags number above 16383 were not decoded correctly in
ber_decode_tag().
We could fix the problem, but there does not seem to be any need.
First, the only way that high tag numbers can be created is with
manual tagging; after 1994 manual tagging is no longer recommended.
Second, the ASN.1 playground (http://asn1-playground.oss.com) only
supports tags up to 16383 (the same is presumably true for OSS
Nokalva's other tools).
Therefore, clean up the existing code and make it an explicit
'invalid_tag' error when tags above 13383 are encountered
(instead of an implicit 'wrong_tag' error).
|
|
* bjorn/cuddle-with-tests:
ets_tough_SUITE: Add the gen_server behavior
ets_tough_SUITE: Remove functions that are never called
ets_SUITE: Eliminate internal exports used for spawn/apply
lists_SUITE: Run the droplast/1 test case
random_{iolist,unicode_list}: Remove unused functions
stdlib test: Eliminate export_all from re_SUITE and friends
asn1_SUITE: Make sure that there are no unused functions
Simplify running of asn1 app tests
asn1_SUITE: Remove unused functions
|
|
Add xref_export_all/1 to make sure that all functions in the
asn1_SUITE module are actually called (directly or indirectly).
|
|
Instead of initiating running of the app tests for asn1 from
asn1_SUITE, put the tests in asn1_app_SUITE and let it take care
of itself.
While we are it, eliminate 'export_all' in the new module and
use lists:keyfind/3 instead of lists:keysearch/3.
|
|
In 8a39672af4d9, the testX420/1 test case is no longer run. Remove the
unused functions.
|
|
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.
|
|
* henrik/update-copyrightyear:
update copyright-year
|
|
Some test machines have quite small hard drives. Help them by
remove temporary files in end_per_test_case/2.
|
|
|
|
|
|
|
|
|
|
* maint:
asn1_SUITE_value: Don't test the LDAP module
|
|
asn1ct:test(Mod) will generate sample values for data types
in an ASN.1 modules. The following definition from LDAP
can cause problems for asn1ct:test/1:
Filter ::= CHOICE {
and [0] SET SIZE (1..MAX) OF filter Filter,
or [1] SET SIZE (1..MAX) OF filter Filter,
not [2] Filter,
equalityMatch [3] AttributeValueAssertion,
substrings [4] SubstringFilter,
greaterOrEqual [5] AttributeValueAssertion,
lessOrEqual [6] AttributeValueAssertion,
present [7] AttributeDescription,
approxMatch [8] AttributeValueAssertion,
extensibleMatch [9] MatchingRuleAssertion,
... }
If we were unlucky (which we were on some computers), the construction
of sample values would not terminate.
Eliminate the problem for now by not testing the LDAP module. This
workaround should be removed when we have added some limitation to the
recursion in asn1ct_value when generating values.
|
|
As a first step to removing the test_server application as
as its own separate application, change the inclusion of
test_server.hrl to an inclusion of ct.hrl and remove the
inclusion of test_server_line.hrl.
|
|
|
|
|
|
Errors were reported using a throw like this:
throw({asn1_error,{get_line(hd(Tokens)),get(asn1_module),
[got,get_token(hd(Tokens)),expected,typereference]}}).
The attempt to tell the user what was expected was often mis-leading.
It is time-consuming and non-trival to provide correct information
of what is expected. Therefore, we will not even try. Instead we will
spend more effort to report the token where the error was discovered.
We will replace each throw with a function call:
parse_error(Tokens).
Also add the syntax_SUITE test suite to test error reporting and to
cover all error reporting code. Remove the old c_syntax/1 test case.
Also remove all out-commented code.
|
|
|
|
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).
|
|
|
|
Instead of only compiling to the abstract format using 'abs',
also compile to each of the back-ends.
|
|
The warnings in the ASN.1 are being eliminated one by one and
replaced with errors. Therefore, it is no longer possible to test
warnings_as_errors. We will reimplement this test case in the future
if we will introduce some new sensible warnings.
|
|
Changed the following from the original copies:
PKCS-5 (renamed from PKCS-v21)
PKCS-9 Import from CryptographicMessageSyntax-2009 instead
of CryptographicMessageSyntax
Since most of the files from the x420 directory are needed,
copy all of them into the rfcs directory and remove the
x420 directory and test case. Copy the test of OTP-7759 to
the testRfcs test case.
|
|
Add the ASN.1 specs from RFC-5911 and RFC-5912.
|
|
Wrong fields in the record where checked when sorting, which caused
duplicate objects to exist in constructed object sets and later caused
an error.
|
|
Refactor and clean up code. While at it, add error handling and
test cases. (Also add test cases for the existing values in
ValueTest.asn while we are it.)
Add support for defining INTEGER constants by extracting
fields from objects. Example:
int-from-object INTEGER ::= object.&id
When extracting values from objects in constraints, only one
level of extraction would work. That is, the following would
work:
SomeName ::= INTEGER (object.&int)
but not:
SomeName ::= INTEGER (object.&obj.&int)
|
|
We only tested that ValueTest.asn1 would compile, no that the
values were correct.
|
|
|
|
Attempting to compile:
SomeType{SOME-CLASS-NAME, SOME-CLASS-NAME:SomeSet} ::= ...
SEQUENCE {
something SOME-CLASS-NAME.&id({SomeSet})
}
would crash the compiler, because the actual parameter for
SOME-CLASS-NAME was not substituted into the governor for
the SomeSet parameter.
While we are at it, combine the functionality of is_class/2
and get_class_def/2 (eliminating is_class/2). Most callers
call both function.
|
|
Running dialyzer on test suites is good for finding both bugs and
useless dialyzer warnings. Add a mechanism in asn1_test_lib for
turning on running of dialyzer on all generated code.
Turned off by default, because it is slow and because there are
still a few dialyzer warnings left.
|
|
We need to test DEFAULT values both with and without
legacy_erlang_types.
|
|
|
|
Commit e5c71b7 deprecated several all functions in the asn1rt
module. As a result, calls to those functions from test suites
caused warnings, and as the warnings_as_errors option was active,
two test files failed to compile.
|
|
|
|
|
|
|
|
|
|
For DER/PER/UPER, a value equal to the DEFAULT is not supposed to
be encoded.
BIT STRINGs values can be represented as Erlang terms in four
different ways: as an integer, as a list of zeroes and ones,
as a {Unused,Binary} tuple, or as an Erlang bitstring.
When encoding a BIT STRING, only certain representations of
BIT STRINGs values were recognized. All representations must
be recognized.
When decoding a DEFAULT value for a BIT STRING, the actual value
given in the decoding would be either an integer or a list
of zeroes and one (depending on how the literal was written in
the specification). We expect that the default value should be
in the same representation as any other BIT STRING value (i.e.
by default an Erlang bitstring, or a list if the 'legacy_bitstring'
option has been given, or as compact bitstring if 'compact_bitstring'
has been given).
|
|
Add the no_ok_wrapper option so that the generated M:encode/2 and
M:decode/2 functions will not wrap a successful return value in an
{ok,...} tuple. Errors will cause exceptions.
Eliminating the wrapping tuple allows simpler nesting of calls.
|
|
We used to compile the X420 specs for both DER and PER, but
9ec0a0ba changed that to compile for DER and plain BER (probably
accidentally).
Since the X420 suite contains 99 source files and compilations
takes more than 40 seconds on my computer for one backend, we only
want to do compilations that are likely to find bugs.
Compiling with the BER backend after having compiled for the DER
backend is very unlikely to detect any bugs.
Compiling for PER (as well as DER) is slightly more likely to expose
bugs, but I don't think it is worth the extra running time for the
test suite.
|
|
They use the same ASN.1 spec.
|
|
The asn1_wrapper made some sense when encode functions
could either produce a list or a binary, depending on the
backend. Now encode functions always produce a binary.
To improve readbility of the test suites, eliminate the asn1_wrapper
functions by replacing them with calls to one of the roundtrip
functions in asn1_test_lib. When it is not possible to use
the roundtrip functions, call the module in question directly.
While at it, also remove ?line macros that are near to the
touched code and use asn1_test_lib:hex_to_bin/1 instead of
home-brewn hex conversion routines.
|
|
Test ChoOptional and ChoOptionalImplicitTag with the same test code
and data.
|
|
To keep the test case clean, add an xref test case to ensure that
there are no unused functions in the any of the test case helper
modules. Eliminate 4 functions that were exported just so that
timer:tc/3 could be used (use timer:tc/1 with a fun instead).
|