Age | Commit message (Collapse) | Author |
|
|
|
a1260b2ffa60581ce3af0728320b593cca3fd7b0 fixed a problem with
expansion of parameterized types, but it didn't go all the way.
The compiler would still crash if we attempted to define a value
using the instantiated type.
|
|
|
|
|
|
To be sure that indirect references to classes are solved.
|
|
|
|
The parser handled the builtin ABSTRACT-SYNTAX and TYPE-IDENTIFIER
classes specially, which caused problems. It turns out that there
is no longer any need to handle those classes specially.
|
|
|
|
An optional group must not contain mandatory class fields. All
mandatory fields must be included in the simplified syntax.
|
|
Add the ASN.1 specs from RFC-5911 and RFC-5912.
|
|
|
|
Besides simplifying the code and doing better error checking
and error reporting, fix the following bugs:
Support retrieving an OBJECT IDENTIFIER/RELATIVE-OID from an
object. Example:
oid OBJECT IDENTIFIER ::= some-object.&some-field
Allow an integer constant first in an OBJECT IDENTIFIER:
integer INTEGER ::= 0
oid OBJECT IDENTIFIER ::= {integer 1}
|
|
Wrong fields in the record where checked when sorting, which caused
duplicate objects to exist in constructed object sets and later caused
an error.
|
|
|
|
|
|
PKIX1Explicit-2009 did not compile.
|
|
Also add proper error handling.
|
|
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.
|
|
Rewrite the confusing and buggy matching of an object definition
against the simplified syntax.
While we are at it, we will also add proper error handling.
|
|
When the parser sees:
something SOMETHING ::= {}
it has no way of knowing whether 'something' is an value or an
object. It depends on how SOMETHING is defined. For example:
SOMETHING ::= SEQUENCE {}
or
SOMETHING ::= CLASS { &id OPTIONAL }
Because of that ambiguity, there is no way to avoid a special case
when we check an object definition. However, there is no need to
invent an entire new checking function for this special case. It is
much easier to just pretend that the parser gave us
{object,defaultsyntax,[]} and let check_objectdefn/3 check it in the
usual way.
|
|
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)
|
|
There is duplicated effort in that validate_integer() checks
whether the integer value is valid, and then normalize_integer()
does mostly the same work in order to convert the value to an
integer.
Eliminate the validate_integer() function and incorporate
its checks into normalize_integer(). Also produce proper
error messages.
|
|
Class names must start with an uppercase letter and only contain
uppercase letters, digits, or hyphens. The parser will not allow
class names that don't start with an uppercase letter, so we don't
have to check that.
|
|
We only tested that ValueTest.asn1 would compile, no that the
values were correct.
|
|
* dgud/asn1/fix-seqtag/OTP-12326:
asn1: Fix EXTERNAL (1994 variant) type conversion
|
|
Missed to add seqtag handling for EXTERNAL type conversion,
bug introduced in c266196c016fc1156c7a18cfeec4920ee4075519
|
|
|
|
According to the BER encoding rules, only constructed values may
have indefinite lengths. A primitive value must be encoded with
a definite length.
Reported-by: Simon Cornish
|
|
* bjorn/asn1/misc-bug-fixes/OTP-12125:
Workaround for combining two object sets separated by extension
Clean up and correct handling of parameters for parameterized types
Check the formal parameter for parameterized type definitions
Report errors also for unused parameterized types
Remove unused code for ABSTRACT-SYNTAX and TYPE-IDENTIFIER
Correct expansion of parameterized types
Add the module name to the #classdef{} record
Eliminate the use of #identifier{} outside the tokeniser and parser
Fix problem with object identifiers in external modules
Rewrite get_referenced_type/2
Teach the ASN.1 compiler to handle objects in field names
Teach the ASN.1 compiler to understand "EXPORTS ALL"
Teach the ASN.1 compiler the parse option
|
|
The following type of code would crash the compiler:
OSET SOME-CLASS ::= {OSET1, ..., OSET2}
|
|
Check the formal parameters for a parameterized type definition.
If the governor for a formal parameter is absent, the formal parameter
must be in upper case.
|
|
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.
|
|
When an indefinite length was given, the decoder could look beyond
the end of the buffer for the 0,0 that signals the end of the value.
|
|
The BER encoder always encodes length as definite lengths. Therefore
indefinite lengths are not well-tested. Add code to the roundtrip
functions in asn1_test_list to automatically rewrite definite
lengths to indefinite length and call the decoder again.
|
|
|
|
The code generator would crash.
|
|
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.
|
|
|
|
The default value for an OCTET STRING when legacy_erlang_types was
active would be a binary instead of a list.
|
|
The old code for testing DEFAULT values is messy, inefficient, and
causes dialyzer warnings.
|
|
We need to test DEFAULT values both with and without
legacy_erlang_types.
|
|
If SetIn is defined like this:
SetIn ::= SET {
boolIn BOOLEAN,
intIn INTEGER
}
then it may not be used with an empty DEFAULT value like this:
SetDef1 ::= SET {
set1 SetIn DEFAULT {}
}
The ASN.1 compiler prints an warning message, but still generates
code. (That should be fixed.)
Fix the incorrect ASN.1 specification by making the
components in SetIn optional:
SetIn ::= SET
{
boolIn BOOLEAN OPTIONAL,
intIn INTEGER OPTIONAL
}
|
|
|
|
This will also eliminate a dialyzer warning for unmatched returns,
and increase the coverage.
|
|
The error checking code for INTEGER and BIT STRING was broken,
since it built an error tuple that was never returned.
Rewrite the error checking code, sharing most of the code between
INTEGER and BIT STRING. Make sure that we test for both duplicated
names and number, as well as for negative bit numbers for
BIT STRING.
This rewrite will eliminate two dialyzer warnings for unmatched
returns.
|
|
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.
|
|
* schlagert/fix_basic_appups:
Dynamically configure typer_SUITE according to environment
Disable hipe_SUITE when environment doesn't support it
Make hipe non-upgradable by setting appup file empty
Fix missing module on hipe app file template
Add test suites performing app and appup file checks
Introduce appup test utility
Fix library application appup files
Fix non-library appup files according to issue #240
OTP-11744
|
|
Add the mentioned test suites for *all* library and touched
non-library applications.
|
|
* bjorn/asn1/cleanup/OTP-11727:
asn1ct_check: Use a return value to silence a dialyzer warning
asn1ct_check: Remove useless call to check_integer/3
asn1ct_check: Correct error handling for illegal OCTET STRING values
asn1ct: Silence dialyzer warnings for unmatched returns
asn1ct_table: Remove unused flexibility in table creation
asn1ct_table: Silence a dialyzer warning for unmatched return
asn1ct_gen: Silence dialyzer warnings for unmatched returns
asn1ct_value: Silence a dialyzer warning for unmatched return
asn1ct_tok: Check return value from file:close/1
|
|
Attempting to subtype an extensible ENUMERATED like this:
BaseType ::= { foo, bar, ... }
SubType ::= BaseType ( foo )
would fail to compile with a message that 'foo' was undefined.
Reported-by: Morten Nygaard Åsnes
|