diff options
author | Björn Gustavsson <[email protected]> | 2012-12-12 15:12:25 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-12-19 11:52:12 +0100 |
commit | 1749a097ef9871124e6d2eecf2c6644f0c133fcc (patch) | |
tree | ab91b262c0f62bcdc9490e6ca6c570acdcb94774 /lib/asn1/src/asn1ct_gen_per_rt2ct.erl | |
parent | 3d1279f3cebfdd2483c3afea9f225613fe45cd00 (diff) | |
download | otp-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/asn1ct_gen_per_rt2ct.erl')
-rw-r--r-- | lib/asn1/src/asn1ct_gen_per_rt2ct.erl | 4 |
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"); |