couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject [1/2] couchdb commit: updated refs/heads/1.6.x to 6acdb22
Date Mon, 18 Aug 2014 15:46:04 GMT
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 <rnewson@apache.org>
Authored: Fri Jun 6 20:38:14 2014 +0100
Committer: Dave Cottlehuber <dch@apache.org>
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(),


Mime
View raw message