Repository: couchdb Updated Branches: refs/heads/1.6.x 59e4bdace -> 6acdb2203
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/ed825d36 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/ed825d36 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/ed825d36 Branch: refs/heads/1.6.x Commit: ed825d362ff237981ef15e4a28e326c79bd1367f Parents: 59e4bda Author: Robert Newson <[email protected]> Authored: Fri Jun 6 20:38:14 2014 +0100 Committer: Dave Cottlehuber <[email protected]> Committed: Mon Aug 18 17:44:32 2014 +0200 ---------------------------------------------------------------------- src/couchdb/couch_passwords.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/ed825d36/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(),
