Age | Commit message (Collapse) | Author |
|
|
|
PKIX1Explicit-2009 did not compile.
This commit was cherry-picked from 3ab3b07a already
merged into master.
|
|
* 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
|
|
This patch fixes a bug with compliance to X.680 (200811) s31.2.7
Basically, when TagDefault is AUTOMATIC then
tags are IMPLICIT unless EXPLICIT is given.
|
|
The following type of code would crash the compiler:
OSET SOME-CLASS ::= {OSET1, ..., OSET2}
|
|
The previous code looked at the actual parameters supplied when
instantiating the type to determine the type of the argument; the
correct way is to determine the type by looking at the governor and
case of the formal parameter.
|
|
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.
|
|
Definitions for parameterized types are verified once very early,
and one more time when they are instantiated.
Errors found during the first check were ignored, so errors for
unused parameterized types were not reported.
|
|
Before classes were fully implemented, there was support for
ABSTRACT-SYNTAX and TYPE-IDENTIFIER. Some of that code is still
there and is no longer used. Get rid of it and correct comments.
|
|
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.
|
|
If we want construct an #'Externaltypereference'{} from
a #classdef{} record, we will need the module name.
|
|
The only remaining use of #identifier{} in asn1ct_check was in a
temporary packaging of a value that would be ultimately be put
into #valuedef{}.
Therefore we can eliminate that last usage but putting the value
directly into a #valuedef{} and we can move the record definition
into asn1ct_parser2.
|
|
When parsing ASN.1, certain constructs can only be understood in
the full context of the entire ASN.1 module.
For instance, the value following ID in this simplified excerpt
from MTSAbstractService88:
administration-88 PORT ::= {
ID {id-pt-administration 88}
}
the value following "ID" can be interpreted either as value
for:
SEQUENCE {
id-pt-administration INTEGER
}
or as an OBJECT IDENTIFIER.
Our ASN.1 parser assumes that a SEQUENCE is meant, and if that
later turns out to be wrong, the SEQUENCE value is rewritten to
an OBJECT IDENTIFIER. The problem is that at the time of the
rewrite, we no longer know in which ASN.1 module id-pt-administration
was defined in, and we have to use the module name in the state{}
record. Unfortunately, the module name in the state{} record may
not always be correct.
While there are attempts in the code to keep the module name
up-to-date when checking imported types, it is not done consistently,
and it seems to be a difficult and error-prone task to attempt
to make it consistent.
A safer and less error-prone approach is to make sure that we
don't lose the module name while parsing. To make it clear what
we are doing, we will introduce a new #seqtag{} record that
are used for tags in SEQUENCE values. The name is based on its
primary use. The record also contains the module in case it happens
to be an OBJECT IDENTIFIER.
|
|
Make sure that we continue to follow external references until
we find a real type.
|
|
|
|
EXPORTS ALL is the same as leaving out the EXPORTS statement.
|
|
|
|
|
|
|
|
This will also eliminate a dialyzer warning.
|
|
The clause is just an optimization for a (extremly rare) special case.
Removing it will eliminate a dialyzer warning.
|
|
|
|
The code generator would crash.
|
|
If a named BIT STRING has a lower size bound of 0, treat it the same
way as if there was no constraint for the purposes of trailing zero
bits.
That change will eliminate a dialyzer warning.
|
|
The encoder for the following type would generate a dialyzer warning:
Ns ::= NumericString (FROM ("0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"))
Optimize this case to make it slightly faster as well as eliminate
the dialyzer warning.
|
|
|
|
|
|
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 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.
|
|
A newline was forgotten.
|
|
|
|
Most dependencies introduced are exactly the dependencies to other
applications found by xref. That is, there might be real dependencies
missing. There might also be pure debug dependencies listed that
probably should be removed. Each application has to be manually
inspected in order to ensure that all real dependencies are listed.
All dependencies introduced are to application versions used in
OTP 17.0. This since the previously used version scheme wasn't
designed for this, and in order to minimize the work of introducing
the dependencies.
|
|
|
|
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.
|
|
A named number list as used for ENUMERATED and INTEGER can never
have an {identifier,...} tuple in its third position like this:
{'NamedNumber',Id,{identifier,_,_}}
because asn1ct_parser2:parse_NamedNumber/1 will always replace
an identifier tuple with an #Externaluereference{} record.
|
|
Since most calls to asn1_error/3 throw its result, it makes more
sense to let asn1_error/3 itself throw the error tuple. Add the
return_asn1_error/3 to return the error tuple to use when we don't
want to throw it.
|
|
* bjorn/asn1/deprecations/OTP-11731:
Remove or de-emphasize references to the deprecated asn1rt module
Deprecate asn1 functions
|
|
* 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
|
|
Those asn1 functions are no longer needed because they all have
better alternatives.
|
|
* 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
|
|
As discussed in issue #240 *all* OTP library applications use the '.*'
wildcard as up and down version. This makes library applications
always up- and downgradeable. Using the wildcard version obsoletes
all maintenance tasks regarding library applications' appup files.
Additionally, it prevents upgrade problems caused by automatically
included application dependencies when using reltool to create
releases. Missing copyright headers are now consistently present.
|
|
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
|