diff options
author | Björn Gustavsson <[email protected]> | 2015-11-30 13:54:10 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-11-30 13:54:10 +0100 |
commit | b185ad94ac37e20c57d24fb0da4b46d923af53eb (patch) | |
tree | ebedb827618a017aad6b55d5e66470ad0d1a5ca9 /lib/asn1/test | |
parent | 53bfaec70f9f6daaae079a1c5cd852f4df214b57 (diff) | |
download | otp-b185ad94ac37e20c57d24fb0da4b46d923af53eb.tar.gz otp-b185ad94ac37e20c57d24fb0da4b46d923af53eb.tar.bz2 otp-b185ad94ac37e20c57d24fb0da4b46d923af53eb.zip |
BER: Fix encoding of empty named BIT STRING
Encoding an empty named BIT STRING would fail for BER.
Noticed-by: Svilen Ivanov
Diffstat (limited to 'lib/asn1/test')
-rw-r--r-- | lib/asn1/test/testPrimStrings.erl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/asn1/test/testPrimStrings.erl b/lib/asn1/test/testPrimStrings.erl index fa778765b1..46793c6bff 100644 --- a/lib/asn1/test/testPrimStrings.erl +++ b/lib/asn1/test/testPrimStrings.erl @@ -123,6 +123,7 @@ bit_string(Rules, Opts) -> %% Bs2 ::= BIT STRING {su(0), mo(1), tu(2), we(3), th(4), fr(5), sa(6) } (SIZE (7)) %%========================================================== + roundtrip('Bs2', []), roundtrip('Bs2', [mo,tu,fr]), bs_roundtrip('Bs2', <<2#0110010:7>>, [mo,tu,fr]), bs_roundtrip('Bs2', <<2#0110011:7>>, [mo,tu,fr,sa]), @@ -131,6 +132,7 @@ bit_string(Rules, Opts) -> %% Bs3 ::= BIT STRING {su(0), mo(1), tu(2), we(3), th(4), fr(5), sa(6) } (SIZE (1..7)) %%========================================================== + roundtrip('Bs3', []), roundtrip('Bs3', [mo,tu,fr]), bs_roundtrip('Bs3', <<2#0110010:7>>, [mo,tu,fr]), bs_roundtrip('Bs3', <<2#0110010:7>>, [mo,tu,fr]), @@ -139,6 +141,13 @@ bit_string(Rules, Opts) -> bs_roundtrip('Bs3', <<2#11:2>>, [su,mo]), %%========================================================== + %% Bs4 ::= BIT STRING {su(0), mo(1), tu(2), we(3), th(4), fr(5), sa(6) } + %%========================================================== + + roundtrip('Bs4', []), + roundtrip('Bs4', [mo,tu,fr,sa]), + + %%========================================================== %% Bs7 ::= BIT STRING (SIZE (24)) %%========================================================== |