diff options
author | Björn Gustavsson <[email protected]> | 2017-03-06 14:28:31 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-03-14 09:47:40 +0100 |
commit | 3334c0c7b831ecf47738c713fd764eef891a298a (patch) | |
tree | bae651bf04cb7a5dead1a87bc8b6f896c4a23705 /lib/asn1/test | |
parent | 7cb3d41d40dbe6d72c8d3f5724b62da088dbf189 (diff) | |
download | otp-3334c0c7b831ecf47738c713fd764eef891a298a.tar.gz otp-3334c0c7b831ecf47738c713fd764eef891a298a.tar.bz2 otp-3334c0c7b831ecf47738c713fd764eef891a298a.zip |
asn1_erl_nif.c: Correct handling of tags >= 16384
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).
Diffstat (limited to 'lib/asn1/test')
-rw-r--r-- | lib/asn1/test/asn1_SUITE.erl | 1 | ||||
-rw-r--r-- | lib/asn1/test/asn1_SUITE_data/HighTagNumbers.asn1 | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl index 580c919b9d..d99190b6b0 100644 --- a/lib/asn1/test/asn1_SUITE.erl +++ b/lib/asn1/test/asn1_SUITE.erl @@ -1108,6 +1108,7 @@ test_modules() -> "From", "H235-SECURITY-MESSAGES", "H323-MESSAGES", + "HighTagNumbers", "Import", "Int", "MAP-commonDataTypes", diff --git a/lib/asn1/test/asn1_SUITE_data/HighTagNumbers.asn1 b/lib/asn1/test/asn1_SUITE_data/HighTagNumbers.asn1 new file mode 100644 index 0000000000..b681063965 --- /dev/null +++ b/lib/asn1/test/asn1_SUITE_data/HighTagNumbers.asn1 @@ -0,0 +1,17 @@ +HighTagNumbers DEFINITIONS ::= +BEGIN + +S ::= SEQUENCE { + a [127] INTEGER, + b [128] INTEGER, + c [150] INTEGER, + d [207] INTEGER, + e [255] INTEGER, + f [256] INTEGER, + g [7777] INTEGER, + h [9999] INTEGER, + i [16382] INTEGER, + j [16383] INTEGER +} + +END |