From 1749a097ef9871124e6d2eecf2c6644f0c133fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 12 Dec 2012 15:12:25 +0100 Subject: per: Fix encoding of OCTET STRINGs with fixed length of 256 or more --- lib/asn1/src/asn1ct_gen_per_rt2ct.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/asn1/src') 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"); -- cgit v1.2.3