From eb764d6980aa7ad5ce03436c77e17e32a5dfdd81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 10 Jan 2013 14:22:41 +0100 Subject: eldap: Remove calls to undocumented asn1rt* functions We are about to remove the old asn1rt* modules, so we must remove the calls that eldap make to them. Since the calls are just a sanity check, we can just remove the calls. Just doing the decode will do roughly the same tests and generate similar exceptions. --- lib/eldap/src/eldap.erl | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/lib/eldap/src/eldap.erl b/lib/eldap/src/eldap.erl index 5753cc4749..855a4086ad 100644 --- a/lib/eldap/src/eldap.erl +++ b/lib/eldap/src/eldap.erl @@ -694,7 +694,6 @@ do_recv(S, #eldap{use_tls=true, timeout=Timeout}, Len) -> recv_response(S, Data) -> case do_recv(S, Data, 0) of {ok, Packet} -> - check_tag(Packet), case asn1rt:decode('ELDAPv3', 'LDAPMessage', Packet) of {ok,Resp} -> {ok,Resp}; Error -> throw(Error) @@ -703,21 +702,6 @@ recv_response(S, Data) -> throw({gen_tcp_error, Reason}) end. -%%% Sanity check of received packet -check_tag(Data) -> - try - {_Tag, Data1, _Rb} = asn1rt_ber_bin:decode_tag(l2b(Data)), - try - {{_Len, _Data2}, _Rb2} = asn1rt_ber_bin:decode_length(l2b(Data1)), - ok - catch - _ -> throw({error,decoded_tag_length}) - end - catch - _ -> - throw({error, decoded_tag}) - end. - %%% Check for expected kind of reply check_reply(Data, {ok,Msg}, Op) when Msg#'LDAPMessage'.messageID == Data#eldap.id -> @@ -1110,7 +1094,3 @@ get_head(Str,Tail) -> %%% Should always succeed ! get_head([H|Tail],Tail,Rhead) -> lists:reverse([H|Rhead]); get_head([H|Rest],Tail,Rhead) -> get_head(Rest,Tail,[H|Rhead]). - -l2b(B) when is_binary(B) -> B; -l2b(L) when is_list(L) -> list_to_binary(L). - -- cgit v1.2.3