aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1
diff options
context:
space:
mode:
Diffstat (limited to 'lib/asn1')
-rw-r--r--lib/asn1/src/asn1rtt_per.erl4
-rw-r--r--lib/asn1/src/asn1rtt_uper.erl4
-rw-r--r--lib/asn1/test/testConstraints.erl4
3 files changed, 8 insertions, 4 deletions
diff --git a/lib/asn1/src/asn1rtt_per.erl b/lib/asn1/src/asn1rtt_per.erl
index b30a7aebd2..b8971b7c33 100644
--- a/lib/asn1/src/asn1rtt_per.erl
+++ b/lib/asn1/src/asn1rtt_per.erl
@@ -359,8 +359,8 @@ encode_length({{Lb,Ub}=Vr,Ext}, Len)
when Ub =< 65535 ,Lb >= 0,Len=<Ub, is_list(Ext) ->
%% constrained extensible
[0|encode_constrained_number(Vr,Len)];
-encode_length({{Lb,_},Ext},Len) when is_list(Ext) ->
- [1|encode_semi_constrained_number(Lb, Len)];
+encode_length({{_,_},Ext},Len) when is_list(Ext) ->
+ [1|encode_length(Len)];
encode_length(SingleValue, _Len) when is_integer(SingleValue) ->
[].
diff --git a/lib/asn1/src/asn1rtt_uper.erl b/lib/asn1/src/asn1rtt_uper.erl
index e55535860f..3f362d227e 100644
--- a/lib/asn1/src/asn1rtt_uper.erl
+++ b/lib/asn1/src/asn1rtt_uper.erl
@@ -358,8 +358,8 @@ encode_length({{Lb,Ub}=Vr,Ext},Len)
when Ub =< 65535, Lb >= 0, Len =< Ub, is_list(Ext) ->
%% constrained extensible
[<<0:1>>,encode_constrained_number(Vr,Len)];
-encode_length({{Lb,_Ub},Ext}, Len) when is_list(Ext) ->
- [<<1:1>>,encode_semi_constrained_number(Lb, Len)];
+encode_length({{_Lb,_Ub},Ext}, Len) when is_list(Ext) ->
+ [<<1:1>>,encode_length(Len)];
encode_length(SingleValue, _Len) when is_integer(SingleValue) ->
[].
diff --git a/lib/asn1/test/testConstraints.erl b/lib/asn1/test/testConstraints.erl
index ef6c1b3486..d6db1c2b91 100644
--- a/lib/asn1/test/testConstraints.erl
+++ b/lib/asn1/test/testConstraints.erl
@@ -128,7 +128,11 @@ int_constraints(Rules) ->
%%==========================================================
roundtrip('T', "IA"),
+ roundtrip('T', "IAB"),
+ roundtrip('T', "IABC"),
roundtrip('T2', "IA"),
+ roundtrip('T2', "IAB"),
+ roundtrip('T2', "IABC"),
%%==========================================================
%% More SIZE Constraints