diff options
author | Björn Gustavsson <[email protected]> | 2012-12-12 15:12:25 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-12-19 11:52:12 +0100 |
commit | 1749a097ef9871124e6d2eecf2c6644f0c133fcc (patch) | |
tree | ab91b262c0f62bcdc9490e6ca6c570acdcb94774 /lib/asn1/test | |
parent | 3d1279f3cebfdd2483c3afea9f225613fe45cd00 (diff) | |
download | otp-1749a097ef9871124e6d2eecf2c6644f0c133fcc.tar.gz otp-1749a097ef9871124e6d2eecf2c6644f0c133fcc.tar.bz2 otp-1749a097ef9871124e6d2eecf2c6644f0c133fcc.zip |
per: Fix encoding of OCTET STRINGs with fixed length of 256 or more
Diffstat (limited to 'lib/asn1/test')
-rw-r--r-- | lib/asn1/test/asn1_SUITE_data/PrimStrings.asn1 | 13 | ||||
-rw-r--r-- | lib/asn1/test/testPrimStrings.erl | 5 |
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/asn1/test/asn1_SUITE_data/PrimStrings.asn1 b/lib/asn1/test/asn1_SUITE_data/PrimStrings.asn1 index 7cb47e9792..9b6b34a776 100644 --- a/lib/asn1/test/asn1_SUITE_data/PrimStrings.asn1 +++ b/lib/asn1/test/asn1_SUITE_data/PrimStrings.asn1 @@ -59,6 +59,19 @@ BS1024 ::= BIT STRING (SIZE (1024)) FixedOs65536 ::= OCTET STRING (SIZE (65536)) FixedOs65537 ::= OCTET STRING (SIZE (65537)) + OsFixedStrings ::= SEQUENCE { + b1 BOOLEAN, -- Unalign + s0 OCTET STRING (SIZE (0)), + s1 OCTET STRING (SIZE (1)), + s2 OCTET STRING (SIZE (2)), + s3 OCTET STRING (SIZE (3)), + b2 BOOLEAN, -- Unalign + s255 OCTET STRING (SIZE (255)), + s256 OCTET STRING (SIZE (256)), + s257 OCTET STRING (SIZE (257)), + i INTEGER (0..1024) + } + OsAlignment ::= SEQUENCE { b1 BOOLEAN, s1 Os, diff --git a/lib/asn1/test/testPrimStrings.erl b/lib/asn1/test/testPrimStrings.erl index 9a640a2cb1..263d9e5ed2 100644 --- a/lib/asn1/test/testPrimStrings.erl +++ b/lib/asn1/test/testPrimStrings.erl @@ -372,6 +372,11 @@ octet_string(Rules) -> end, fragmented_octet_string(Rules), + + S255 = lists:seq(1, 255), + FixedStrings = {'OsFixedStrings',true,"","1","12","345",true, + S255,[$a|S255],[$a,$b|S255],397}, + roundtrip('OsFixedStrings', FixedStrings), ok. fragmented_octet_string(Erules) -> |