Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A92EB114C9 for ; Wed, 13 Aug 2014 23:25:58 +0000 (UTC) Received: (qmail 58496 invoked by uid 500); 13 Aug 2014 23:25:50 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 58368 invoked by uid 500); 13 Aug 2014 23:25:50 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 57181 invoked by uid 99); 13 Aug 2014 23:25:50 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Aug 2014 23:25:50 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 40461928892; Wed, 13 Aug 2014 23:25:50 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dch@apache.org To: commits@couchdb.apache.org Date: Wed, 13 Aug 2014 23:26:32 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [44/50] couchdb commit: updated refs/heads/1.6.x to eeb31cb 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/1.6.x Commit: d43f69d90740d5a230b0054fa32b6843b33691bc Parents: 7221f70 Author: Robert Newson Authored: Fri Jun 6 20:38:14 2014 +0100 Committer: Robert Newson 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(<>))). %% 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(),