Browse Source

use erlang:md5 instead of crypto:md5

Will 16 years ago
parent
commit
c8541a8e13
2 changed files with 2 additions and 3 deletions
  1. 2 2
      src/pgsql_connection.erl
  2. 0 1
      test_src/pgsql_tests.erl

+ 2 - 2
src/pgsql_connection.erl

@@ -148,8 +148,8 @@ auth({$R, <<3:?int32>>}, State) ->
 
 
 %% AuthenticationMD5Password
 %% AuthenticationMD5Password
 auth({$R, <<5:?int32, Salt:4/binary>>}, State) ->
 auth({$R, <<5:?int32, Salt:4/binary>>}, State) ->
-    Digest1 = hex(crypto:md5([get(password), get(username)])),
-    Str = ["md5", hex(crypto:md5([Digest1, Salt])), 0],
+    Digest1 = hex(erlang:md5([get(password), get(username)])),
+    Str = ["md5", hex(erlang:md5([Digest1, Salt])), 0],
     send(State, $p, Str),
     send(State, $p, Str),
     {next_state, auth, State};
     {next_state, auth, State};
 
 

+ 0 - 1
test_src/pgsql_tests.erl

@@ -382,7 +382,6 @@ encode_binary_format_test() ->
 %% -- run all tests --
 %% -- run all tests --
 
 
 run_tests() ->
 run_tests() ->
-    crypto:start(),
     Files = filelib:wildcard("test_ebin/*tests.beam"),
     Files = filelib:wildcard("test_ebin/*tests.beam"),
     Mods = [list_to_atom(filename:basename(F, ".beam")) || F <- Files],
     Mods = [list_to_atom(filename:basename(F, ".beam")) || F <- Files],
     eunit:test(Mods, []).
     eunit:test(Mods, []).