Age | Commit message (Collapse) | Author |
|
Ensure that asn1ct_name:start/0 will call asn1ct_name:clear/0 if the
name server process is already running so that we can be sure that
the variables are cleared.
|
|
active/1 always returned 'true' (curr(Var) can never return 'nil',
except if Var =:= 'nil'). Therefore, we can eliminate its use and
remove it.
|
|
clean/1 is used quite lot; while not a bottleneck it does seem
unnecessary to stop and start the name server just to clear the
variables.
Since the change to clean/1 makes stop/1 unused, we can remove it.
|
|
Since new/1 does not return any useful value and cannot fail, there
is no reason to wait for a response from the name server process.
|
|
|
|
Since we no longer need to support push/1 and pop/1, we can simplify
the data structures used for keeping track of the variables.
Each entry in the list can be simply {Var,integer()} instead of
{Var,[integer()]}.
While at it, eliminate calls to the obsolete lists:keysearch/3
function, don't use integer_to_list/0 within a call to lists:concat/1,
and the catch all clause in get_prev/2 and get_next/2.
|
|
asn1ct_name:delete/1 is used from asn1ct_gen_ber_bin_v2:add_removed_bytes/1,
but that function is not used.
|
|
|
|
* bjorn/asn1/fix-lost-extension-mark/OTP-10995:
Prevent loss of objects after the extension marker
Don't lose the extension mark for object set parameters
|
|
In an object set with a single root object, objects after
the extension marker would be lost.
|
|
When an object set is an actual parameter, the extension marker
for the object set could get lost.
|
|
If the encoding is empty (i.e. if a top-level type is single-valued
and therefore not encoding), the result should be a single zero
byte.
|
|
An ENUMERATED with as single value is not encoded. The decoder
incorrectly assumed that it was encoded in one bit.
|
|
|
|
Also teach otp_SUITE:call_to_size/1 that calls to size/1 is no
longer allowed within the asn1 application.
|
|
It is recommended to use byte_size/1 or tuple_size/1 instead of
size/1.
|
|
|
|
The ASN.1 compiler would generate an Erlang module with
incorrect syntax for:
T DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
Empty ::= SET {
}
S ::= SEQUENCE {
e Empty DEFAULT {}
}
END
|
|
Commit f16f43446a04c459486356c0b4ad517cc9201895 broke compilation
of InformationFramework for per and uper.
|
|
|
|
* bjorn/asn1/further-cleanup/OTP-10588: (28 commits)
Don't export encode_disp/2 and decode_disp/2 in generated modules
Remove vestiges of support for the {TypeName,Value} notation
Simplify the functions for decoding lengths
per,uper: Optimize decoding of the remaining data types
per,uper: Optimize decoding of the remaining string types
Share all code for dec_gen_prim/3 between per/uper back-ends
per,uper: Optimize decoding of the string data types
testPrimStrings: Test some constraints
By default, encode BIT STRING to bitstrings
Teach encode functions to accept a bitstring term for a BIT STRING
Fix EXTERNAL 1990/1994 conversion information loss
uper: Look up some SizeConstraints at compile-time
Enumeration decoding: Don't emit a default clause if it cannot match
Slightly optimize per encoding of large INTEGERs with constraints
BER run-time: Refactor decoding of string data types
Refactor decoding of BIT STRINGs
Optimize encoding of ENUMERATED in per and uper
Remove the unused run-time modules
eldap: Remove calls to undocumented asn1rt* functions
BER: Correct bug in 'undec_rest'
...
|
|
Those functions were exported for no good reason.
|
|
Support in BER was removed in 3d1279f3cebfdd2483c3afea9f225613fe45cd00.
|
|
Now that the decoding of all types are generated inline, we can
take out most of the code for decoding lengths.
|
|
|
|
|
|
|
|
|
|
Add the option 'legacy_bit_string' to decode to the old list format.
|
|
|
|
We do it in the simplest possible way by converting the bitstring
to a compact bitstring tuple.
The encoding of BIT STRINGs should be cleaned up and optimized.
|
|
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]>
|
|
|
|
Dialyzer will warn for default clauses that cannot possible match.
|
|
|
|
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.
|
|
Always pre-encode the values for the enumeration. Clean up the
code and let the per and uper back-ends share the code.
|
|
|
|
Also make sure that the error handling is contained within the
asn1rt_nif module and does not leak out to generated code.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
* nox/enable-silent-rules/OTP-10726:
Implement ./otp_build configure --enable-silent-rules
|
|
With silent rules, the output of make is less verbose and compilation
warnings are easier to spot. Silent rules are disabled by default and
can be disabled or enabled at will by make V=0 and make V=1.
|
|
* bjorn/asn1/extension-addition-groups/OTP-10664:
Fix a bug for multiple extension addition groups
|