[erlang-patches] [PATCH] asn1rt_check: Fix transform_to_EXTERNAL1990 for binary input

Henrik Nord henrik@REDACTED
Tue Oct 18 11:53:14 CEST 2011


On 10/15/2011 10:43 PM, Harald Welte wrote:
> 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.
> ---
>   lib/asn1/src/asn1rt_check.erl |    3 ++-
>   1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/lib/asn1/src/asn1rt_check.erl b/lib/asn1/src/asn1rt_check.erl
> index 24a2a38..1c5ec89 100644
> --- a/lib/asn1/src/asn1rt_check.erl
> +++ b/lib/asn1/src/asn1rt_check.erl
> @@ -313,7 +313,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])).
>
>
Thank you for the contribution.
I will include this in 'pu'

-- 
/Henrik Nord Erlang/OTP




More information about the erlang-patches mailing list