aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-04-28 12:25:22 +0200
committerBjörn Gustavsson <[email protected]>2014-06-05 13:46:27 +0200
commit739ad067cf8775558fade616353f44d49a13a487 (patch)
treeddb83e2af2a8e069eb53260418e13e1521c6112c /lib/asn1/src
parent7929b72efed6b2f5dee18a0b758ae4d6f001f054 (diff)
downloadotp-739ad067cf8775558fade616353f44d49a13a487.tar.gz
otp-739ad067cf8775558fade616353f44d49a13a487.tar.bz2
otp-739ad067cf8775558fade616353f44d49a13a487.zip
Correct OCTET STRING default when legacy_erlang_types is active
The default value for an OCTET STRING when legacy_erlang_types was active would be a binary instead of a list.
Diffstat (limited to 'lib/asn1/src')
-rw-r--r--lib/asn1/src/asn1ct_gen.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl
index 149813c3aa..c6561bcdb4 100644
--- a/lib/asn1/src/asn1ct_gen.erl
+++ b/lib/asn1/src/asn1ct_gen.erl
@@ -1378,6 +1378,11 @@ conform_value(#type{def={'BIT STRING',[]}}, Bs) ->
bitstring when is_bitstring(Bs) ->
Bs
end;
+conform_value(#type{def='OCTET STRING'}, String) ->
+ case asn1ct:use_legacy_types() of
+ false -> String;
+ true -> binary_to_list(String)
+ end;
conform_value(_, Value) -> Value.
named_bitstring_value(List, Names) ->