Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/processone/ejabberd.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2011-09-04 16:56:56 +0400
committerBadlop <badlop@process-one.net>2011-09-04 16:56:56 +0400
commitd6fcee4faadfe5e54486d96f6aefc303ca6e79ab (patch)
tree2cdef17f2be0ba12caaf6d561376c335ebbeed70 /src/scram.erl
parent41d028d101cd5bd134315a652942c7256032e7ed (diff)
Replace calls of OTP's Binary, since they would require R14
Diffstat (limited to 'src/scram.erl')
-rw-r--r--src/scram.erl20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/scram.erl b/src/scram.erl
index 30bd6bb27..dc1490189 100644
--- a/src/scram.erl
+++ b/src/scram.erl
@@ -53,29 +53,29 @@ client_signature(StoredKey, AuthMessage) ->
crypto:sha_mac(StoredKey, AuthMessage).
client_key(ClientProof, ClientSignature) ->
- binary:list_to_bin(lists:zipwith(fun(X, Y) ->
+ list_to_binary(lists:zipwith(fun(X, Y) ->
X bxor Y
end,
- binary:bin_to_list(ClientProof),
- binary:bin_to_list(ClientSignature))).
+ binary_to_list(ClientProof),
+ binary_to_list(ClientSignature))).
server_signature(ServerKey, AuthMessage) ->
crypto:sha_mac(ServerKey, AuthMessage).
hi(Password, Salt, IterationCount) ->
- U1 = crypto:sha_mac(Password, string:concat(binary:bin_to_list(Salt), [0,0,0,1])),
- binary:list_to_bin(lists:zipwith(fun(X, Y) ->
+ U1 = crypto:sha_mac(Password, string:concat(binary_to_list(Salt), [0,0,0,1])),
+ list_to_binary(lists:zipwith(fun(X, Y) ->
X bxor Y
end,
- binary:bin_to_list(U1),
- binary:bin_to_list(hi_round(Password, U1, IterationCount-1)))).
+ binary_to_list(U1),
+ binary_to_list(hi_round(Password, U1, IterationCount-1)))).
hi_round(Password, UPrev, 1) ->
crypto:sha_mac(Password, UPrev);
hi_round(Password, UPrev, IterationCount) ->
U = crypto:sha_mac(Password, UPrev),
- binary:list_to_bin(lists:zipwith(fun(X, Y) ->
+ list_to_binary(lists:zipwith(fun(X, Y) ->
X bxor Y
end,
- binary:bin_to_list(U),
- binary:bin_to_list(hi_round(Password, U, IterationCount-1)))).
+ binary_to_list(U),
+ binary_to_list(hi_round(Password, U, IterationCount-1)))).