aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-12-12 15:12:25 +0100
committerBjörn Gustavsson <[email protected]>2012-12-19 11:52:12 +0100
commit1749a097ef9871124e6d2eecf2c6644f0c133fcc (patch)
treeab91b262c0f62bcdc9490e6ca6c570acdcb94774 /lib/asn1/src
parent3d1279f3cebfdd2483c3afea9f225613fe45cd00 (diff)
downloadotp-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/src')
-rw-r--r--lib/asn1/src/asn1ct_gen_per_rt2ct.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/asn1/src/asn1ct_gen_per_rt2ct.erl b/lib/asn1/src/asn1ct_gen_per_rt2ct.erl
index 2f47f6efb8..fa9c3645b3 100644
--- a/lib/asn1/src/asn1ct_gen_per_rt2ct.erl
+++ b/lib/asn1/src/asn1ct_gen_per_rt2ct.erl
@@ -416,7 +416,7 @@ emit_enc_octet_string(_Erules,Constraint,Value) ->
{next,tmpval},"]]",nl}),
emit(" end"),
asn1ct_name:new(tmpval);
- Sv when is_integer(Sv),Sv =< 256 ->
+ Sv when is_integer(Sv),Sv < 256 ->
asn1ct_name:new(tmpval),
emit({" begin",nl}),
emit({" case length(",Value,") of",nl}),
@@ -430,7 +430,7 @@ emit_enc_octet_string(_Erules,Constraint,Value) ->
emit({" begin",nl}),
emit({" case length(",Value,") of",nl}),
emit([" ",{curr,tmpval}," when ",{curr,tmpval}," == ",Sv," ->"]),
- emit([" [2,21,",{curr,tmpval},",",Value,"];",nl]),
+ emit([" [<<21,",{curr,tmpval},":16>>|",Value,"];",nl]),
emit({" _ -> exit({error,{value_out_of_bounds,",
Value,"}})",nl," end",nl}),
emit(" end");