aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-06-10 09:30:59 +0200
committerBjörn Gustavsson <[email protected]>2013-06-10 09:30:59 +0200
commita33dbb822acb67cf071e606cd28d15090075202f (patch)
treed2d0500960450f46bdc72261ee72aad2d8aa70aa /lib/asn1/src
parent3785a3b673a3530c94b9ee3dc053dcb07b71e62f (diff)
parentac851623b548ac13ffc933516dae9db98626f0fe (diff)
downloadotp-a33dbb822acb67cf071e606cd28d15090075202f.tar.gz
otp-a33dbb822acb67cf071e606cd28d15090075202f.tar.bz2
otp-a33dbb822acb67cf071e606cd28d15090075202f.zip
Merge branch 'bjorn/asn1/not-small-bugs/OTP-11153' into maint
* bjorn/asn1/not-small-bugs/OTP-11153: PER/UPER: Correct decoding of SEQUENCEs with more than 64 extensions testConstraints: Improve tests of semi-constrained INTEGERs Test ENUMERATED with many extended values UPER: Correct encoding of ENUMERATED with more than 63 extended values Add asn1_test_lib:hex_to_bin/1
Diffstat (limited to 'lib/asn1/src')
-rw-r--r--lib/asn1/src/asn1ct_gen_per.erl3
-rw-r--r--lib/asn1/src/asn1ct_imm.erl7
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/asn1/src/asn1ct_gen_per.erl b/lib/asn1/src/asn1ct_gen_per.erl
index 30c9ab9365..69d9d51bf1 100644
--- a/lib/asn1/src/asn1ct_gen_per.erl
+++ b/lib/asn1/src/asn1ct_gen_per.erl
@@ -250,7 +250,8 @@ emit_enc_enumerated_case(Erules, C, EnumName, Count) ->
enc_ext_and_val(per, E, F, Args) ->
[E|apply(asn1ct_eval_per, F, Args)];
enc_ext_and_val(uper, E, F, Args) ->
- <<E:1,(apply(asn1ct_eval_uper, F, Args))/bitstring>>.
+ Bs = list_to_bitstring([apply(asn1ct_eval_uper, F, Args)]),
+ <<E:1,Bs/bitstring>>.
%% Object code generating for encoding and decoding
diff --git a/lib/asn1/src/asn1ct_imm.erl b/lib/asn1/src/asn1ct_imm.erl
index c6803a0f96..bf362db843 100644
--- a/lib/asn1/src/asn1ct_imm.erl
+++ b/lib/asn1/src/asn1ct_imm.erl
@@ -86,7 +86,7 @@ per_dec_enumerated(BaseNamedList, NamedListExt0, Aligned) ->
bit_case(Base, Ext).
per_dec_extension_map(Aligned) ->
- Len = {add,per_dec_normally_small_number(Aligned),1},
+ Len = per_dec_normally_small_length(Aligned),
{get_bits,Len,[1,bitstring]}.
per_dec_integer(Constraint0, Aligned) ->
@@ -240,6 +240,11 @@ per_dec_normally_small_number(Aligned) ->
Unlimited = per_decode_semi_constrained(0, Aligned),
bit_case(Small, Unlimited).
+per_dec_normally_small_length(Aligned) ->
+ Small = {add,{get_bits,6,[1]},1},
+ Unlimited = decode_unconstrained_length(false, Aligned),
+ bit_case(Small, Unlimited).
+
per_decode_semi_constrained(Lb, Aligned) ->
add_lb(Lb, {get_bits,decode_unconstrained_length(false, Aligned),[8]}).