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/06/06 21:38:31 UTC
couch commit: updated refs/heads/master to c9a3fc1
Repository: couchdb-couch
Updated Branches:
refs/heads/master 16af74eb8 -> c9a3fc150
hash admin passwords on startup when list
Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/c9a3fc15
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/c9a3fc15
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/c9a3fc15
Branch: refs/heads/master
Commit: c9a3fc150d8aed653b3b07e6dcc84893a390b452
Parents: 16af74e
Author: Robert Newson <rn...@apache.org>
Authored: Fri Jun 6 20:38:14 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Fri Jun 6 20:38:14 2014 +0100
----------------------------------------------------------------------
src/couch_passwords.erl | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/c9a3fc15/src/couch_passwords.erl
----------------------------------------------------------------------
diff --git a/src/couch_passwords.erl b/src/couch_passwords.erl
index f038031..2ab7cc3 100644
--- a/src/couch_passwords.erl
+++ b/src/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 = config:get("couch_httpd_auth", "iterations", "10000"),
Salt = couch_uuids:random(),