aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src
diff options
context:
space:
mode:
authorHarald Welte <[email protected]>2011-10-15 22:43:58 +0200
committerHenrik Nord <[email protected]>2011-10-18 11:48:36 +0200
commit6a69602985c9da9fc105cf4ce1cb434ae5f00f07 (patch)
treee0580cb80fd4a4fef3ab17e9f497fc10eda55bb1 /lib/asn1/src
parent7f6d6349514a62fa7a66dae9b01a8e5f364826fb (diff)
downloadotp-6a69602985c9da9fc105cf4ce1cb434ae5f00f07.tar.gz
otp-6a69602985c9da9fc105cf4ce1cb434ae5f00f07.tar.bz2
otp-6a69602985c9da9fc105cf4ce1cb434ae5f00f07.zip
asn1rt_check: Fix transform_to_EXTERNAL1990 for binary input
If ber_bin is used, decoded EXTERNAL types will include a binary Data_value in the {'EXTERNAL', ...} tuple. When handing such a tuple to the encoder again, we should properly encode it. To do so, we treat a binary data part just like a list data part.
Diffstat (limited to 'lib/asn1/src')
-rw-r--r--lib/asn1/src/asn1rt_check.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/asn1/src/asn1rt_check.erl b/lib/asn1/src/asn1rt_check.erl
index d9856901b8..35b993fc71 100644
--- a/lib/asn1/src/asn1rt_check.erl
+++ b/lib/asn1/src/asn1rt_check.erl
@@ -311,7 +311,8 @@ transform_to_EXTERNAL1990([Data_val_desc,Data_value],Acc)
when is_binary(Data_value)->
list_to_tuple(lists:reverse([{'single-ASN1-type',Data_value},
Data_val_desc|Acc]));
-transform_to_EXTERNAL1990([Data_value],Acc) when is_list(Data_value)->
+transform_to_EXTERNAL1990([Data_value],Acc)
+ when is_list(Data_value); is_binary(Data_value) ->
list_to_tuple(lists:reverse([{'octet-aligned',Data_value}|Acc])).