You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2015/09/25 13:06:20 UTC

couch-replicator commit: updated refs/heads/master to 73139f0

Repository: couchdb-couch-replicator
Updated Branches:
  refs/heads/master b695bb293 -> 73139f0eb


Fix crypto deprecations

COUCHDB-2825


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/commit/73139f0e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/tree/73139f0e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/diff/73139f0e

Branch: refs/heads/master
Commit: 73139f0ebaee1b7bb49f926aebb0c3106c21ce74
Parents: b695bb2
Author: Robert Newson <rn...@apache.org>
Authored: Wed Sep 23 19:28:10 2015 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Sep 23 19:28:10 2015 +0100

----------------------------------------------------------------------
 src/couch_replicator_utils.erl              |  2 +-
 test/couch_replicator_many_leaves_tests.erl |  2 +-
 test/couch_replicator_test_helper.erl       | 12 ++++++------
 3 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/73139f0e/src/couch_replicator_utils.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator_utils.erl b/src/couch_replicator_utils.erl
index ce73d90..9fc42df 100644
--- a/src/couch_replicator_utils.erl
+++ b/src/couch_replicator_utils.erl
@@ -130,7 +130,7 @@ maybe_append_filters(Base,
             [filter_code(Filter, Source, UserCtx),
                 get_value(query_params, Options, {[]})]
         end,
-    couch_util:to_hex(couch_util:md5(term_to_binary(Base2))).
+    couch_util:to_hex(couch_crypto:hash(md5, term_to_binary(Base2))).
 
 
 filter_code(Filter, Source, UserCtx) ->

http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/73139f0e/test/couch_replicator_many_leaves_tests.erl
----------------------------------------------------------------------
diff --git a/test/couch_replicator_many_leaves_tests.erl b/test/couch_replicator_many_leaves_tests.erl
index 73011dd..40ca611 100644
--- a/test/couch_replicator_many_leaves_tests.erl
+++ b/test/couch_replicator_many_leaves_tests.erl
@@ -137,7 +137,7 @@ add_doc_siblings(Db, _DocId, 0, AccDocs, AccRevs) ->
 
 add_doc_siblings(Db, DocId, NumLeaves, AccDocs, AccRevs) ->
     Value = ?l2b(?i2l(NumLeaves)),
-    Rev = couch_util:md5(Value),
+    Rev = couch_crypto:hash(md5, Value),
     Doc = #doc{
         id = DocId,
         revs = {1, [Rev]},

http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/73139f0e/test/couch_replicator_test_helper.erl
----------------------------------------------------------------------
diff --git a/test/couch_replicator_test_helper.erl b/test/couch_replicator_test_helper.erl
index 1c0ce3e..5b9d366 100644
--- a/test/couch_replicator_test_helper.erl
+++ b/test/couch_replicator_test_helper.erl
@@ -75,16 +75,16 @@ find_att([Att | Rest], Name) ->
 att_md5(Att) ->
     Md50 = couch_att:foldl(
         Att,
-        fun(Chunk, Acc) -> couch_util:md5_update(Acc, Chunk) end,
-        couch_util:md5_init()),
-    couch_util:md5_final(Md50).
+        fun(Chunk, Acc) -> couch_crypto:hash_update(md5, Acc, Chunk) end,
+        couch_crypto:hash_init(md5)),
+    couch_crypto:hash_final(md5, Md50).
 
 att_decoded_md5(Att) ->
     Md50 = couch_att:foldl_decode(
         Att,
-        fun(Chunk, Acc) -> couch_util:md5_update(Acc, Chunk) end,
-        couch_util:md5_init()),
-    couch_util:md5_final(Md50).
+        fun(Chunk, Acc) -> couch_crypto:hash_update(md5, Acc, Chunk) end,
+        couch_crypto:hash_init(md5)),
+    couch_crypto:hash_final(md5, Md50).
 
 db_url(DbName) ->
     iolist_to_binary([