diff options
author | Badlop <badlop@process-one.net> | 2009-06-16 17:48:08 +0000 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2009-06-16 17:48:08 +0000 |
commit | caf9c4f65ec552453bce24789575cbf715841e45 (patch) | |
tree | be1ab91ede43f62c42333a0dec01149e8a11f080 | |
parent | Replace TYPE/1 with is_TYPE/1 (EJAB-922) (diff) |
Replaced sha1 to hexadecimal transformation with sha:sha/1 call (thanks to Alexey Shchepin)
SVN Revision: 2254
-rw-r--r-- | src/web/ejabberd_http_bind.erl | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/web/ejabberd_http_bind.erl b/src/web/ejabberd_http_bind.erl index df2ba5c41..11431ab6e 100644 --- a/src/web/ejabberd_http_bind.erl +++ b/src/web/ejabberd_http_bind.erl @@ -4,7 +4,7 @@ %%% Purpose : Implements XMPP over BOSH (XEP-0205) (formerly known as %%% HTTP Binding) %%% Created : 21 Sep 2005 by Stefan Strigler <steve@zeank.in-berlin.de> -%%% Id : $Id: ejabberd_http_bind.erl 952 2009-05-06 17:29:39Z badlop $ +%%% Id : $Id: ejabberd_http_bind.erl 953 2009-05-07 10:40:40Z alexey $ %%%---------------------------------------------------------------------- -module(ejabberd_http_bind). @@ -589,9 +589,7 @@ process_http_put({http_put, Rid, Attrs, Payload, Hold, StreamTo, IP}, "" -> true; OldKey -> - NextKey = jlib:tolower( - hex(binary_to_list( - crypto:sha(Key)))), + NextKey = sha:sha(Key), ?DEBUG("Key/OldKey/NextKey: ~s/~s/~s", [Key, OldKey, NextKey]), if OldKey == NextKey -> @@ -1070,16 +1068,6 @@ cancel_timer(Timer) -> ok end. -hex(Bin) when is_binary(Bin) -> hex(binary_to_list(Bin)); -hex([]) -> ""; -hex([H|T]) -> - [A,B] = if - H == 0 -> "00"; - H < 16 -> [$0,element(H,{$1,$2,$3,$4,$5,$6,$7,$8,$9,$a,$b,$c,$d,$e,$f})]; - true -> erlang:integer_to_list(H,16) - end, - [A,B|hex(T)]. - elements_to_string([]) -> []; elements_to_string([El | Els]) -> |