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 2014/07/02 18:23:19 UTC

couchdb commit: updated refs/heads/master to d43f69d

Repository: couchdb
Updated Branches:
  refs/heads/master 7221f7036 -> d43f69d90


hash admin passwords on startup when list


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

Branch: refs/heads/master
Commit: d43f69d90740d5a230b0054fa32b6843b33691bc
Parents: 7221f70
Author: Robert Newson <rn...@apache.org>
Authored: Fri Jun 6 20:38:14 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Jul 2 17:20:45 2014 +0100

----------------------------------------------------------------------
 src/couchdb/couch_passwords.erl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/d43f69d9/src/couchdb/couch_passwords.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_passwords.erl b/src/couchdb/couch_passwords.erl
index bbf6d9a..9abf31b 100644
--- a/src/couchdb/couch_passwords.erl
+++ b/src/couchdb/couch_passwords.erl
@@ -26,7 +26,9 @@ simple(Password, Salt) when is_binary(Password), is_binary(Salt) ->
     ?l2b(couch_util:to_hex(crypto:sha(<<Password/binary, Salt/binary>>))).
 
 %% CouchDB utility functions
--spec hash_admin_password(binary()) -> binary().
+-spec hash_admin_password(binary() | list()) -> binary().
+hash_admin_password(ClearPassword) when is_list(ClearPassword) ->
+    hash_admin_password(?l2b(ClearPassword));
 hash_admin_password(ClearPassword) when is_binary(ClearPassword) ->
     Iterations = couch_config:get("couch_httpd_auth", "iterations", "10000"),
     Salt = couch_uuids:random(),