aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1ct_imm.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-01-21 16:12:46 +0100
committerBjörn Gustavsson <[email protected]>2014-01-24 16:24:56 +0100
commitaaa4ea283b2b7dad74fdcdd5963558e9d03d80b0 (patch)
tree765382e19e86d86a897daec07e7335571285966d /lib/asn1/src/asn1ct_imm.erl
parent4bda9201055daf3abbdb5ef48bbdd0efacfd1fbc (diff)
downloadotp-aaa4ea283b2b7dad74fdcdd5963558e9d03d80b0.tar.gz
otp-aaa4ea283b2b7dad74fdcdd5963558e9d03d80b0.tar.bz2
otp-aaa4ea283b2b7dad74fdcdd5963558e9d03d80b0.zip
Fix OCTET STRING
Diffstat (limited to 'lib/asn1/src/asn1ct_imm.erl')
-rw-r--r--lib/asn1/src/asn1ct_imm.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/asn1/src/asn1ct_imm.erl b/lib/asn1/src/asn1ct_imm.erl
index 9da8658f19..fde39c674e 100644
--- a/lib/asn1/src/asn1ct_imm.erl
+++ b/lib/asn1/src/asn1ct_imm.erl
@@ -32,6 +32,7 @@
per_enc_integer/3,per_enc_integer/4,
per_enc_null/2,
per_enc_k_m_string/4,per_enc_octet_string/3,
+ per_enc_legacy_octet_string/3,
per_enc_open_type/2,
per_enc_restricted_string/3,
per_enc_small_number/2]).
@@ -305,7 +306,13 @@ per_enc_open_type(Imm0, Aligned) ->
{call,erlang,byte_size,[Bin],Len}|
per_enc_length(Bin, 8, Len, Aligned)].
-per_enc_octet_string(Val0, Constraint0, Aligned) ->
+per_enc_octet_string(Bin, Constraint0, Aligned) ->
+ {B,[[],Len]} = mk_vars([], [len]),
+ Constraint = effective_constraint(bitstring, Constraint0),
+ B ++ [{call,erlang,byte_size,[Bin],Len}|
+ per_enc_length(Bin, 8, Len, Constraint, Aligned, 'OCTET STRING')].
+
+per_enc_legacy_octet_string(Val0, Constraint0, Aligned) ->
{B,[Val,Bin,Len]} = mk_vars(Val0, [bin,len]),
Constraint = effective_constraint(bitstring, Constraint0),
B ++ [{call,erlang,iolist_to_binary,[Val],Bin},
@@ -903,6 +910,9 @@ dcg_list_outside([{call,Fun,{V,Buf},{Dst,DstBuf}}|T]) ->
emit(["{",Dst,",",DstBuf,"} = "]),
Fun(V, Buf),
iter_dcg_list_outside(T);
+dcg_list_outside([{convert,{M,F},V,Dst}|T]) ->
+ emit([Dst," = ",{asis,M},":",{asis,F},"(",V,")"]),
+ iter_dcg_list_outside(T);
dcg_list_outside([{convert,Op,V,Dst}|T]) ->
emit([Dst," = ",Op,"(",V,")"]),
iter_dcg_list_outside(T);