couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beno...@apache.org
Subject git commit: make sure that ClearPassword string is handled.
Date Mon, 07 May 2012 12:58:54 GMT
Updated Branches:
  refs/heads/master 7d540c6e6 -> af7441d8d


make sure that ClearPassword string is handled.

When you set a clear password in the config, the
`couch_passwords:hash_admin_password/1` get a string instead of a
binary.


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

Branch: refs/heads/master
Commit: af7441d8dc48ecaee4d66322fbc1e0ce5426cf19
Parents: 7d540c6
Author: Benoit Chesneau <bchesneau@gmail.com>
Authored: Mon May 7 14:56:35 2012 +0200
Committer: Benoit Chesneau <bchesneau@gmail.com>
Committed: Mon May 7 14:56:35 2012 +0200

----------------------------------------------------------------------
 src/couchdb/couch_passwords.erl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/af7441d8/src/couchdb/couch_passwords.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_passwords.erl b/src/couchdb/couch_passwords.erl
index ce87f2c..57e5193 100644
--- a/src/couchdb/couch_passwords.erl
+++ b/src/couchdb/couch_passwords.erl
@@ -30,8 +30,8 @@ simple(Password, Salt) ->
 hash_admin_password(ClearPassword) ->
     Iterations = couch_config:get("couch_httpd_auth", "iterations", "10000"),
     Salt = couch_uuids:random(),
-    DerivedKey = couch_passwords:pbkdf2(?b2l(ClearPassword), Salt,
-        list_to_integer(Iterations)),
+    DerivedKey = couch_passwords:pbkdf2(couch_util:to_binary(ClearPassword),
+                                        Salt ,list_to_integer(Iterations)),
     ?l2b("-pbkdf2-" ++ ?b2l(DerivedKey) ++ ","
         ++ ?b2l(Salt) ++ ","
         ++ Iterations).


Mime
View raw message