Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68398 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65548 invoked from network); 7 Aug 2013 11:53:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Aug 2013 11:53:17 -0000 Authentication-Results: pb1.pair.com header.from=keisial@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=keisial@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.180 as permitted sender) X-PHP-List-Original-Sender: keisial@gmail.com X-Host-Fingerprint: 209.85.212.180 mail-wi0-f180.google.com Received: from [209.85.212.180] ([209.85.212.180:50835] helo=mail-wi0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 50/87-06453-C2532025 for ; Wed, 07 Aug 2013 07:53:16 -0400 Received: by mail-wi0-f180.google.com with SMTP id f14so1579108wiw.7 for ; Wed, 07 Aug 2013 04:53:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=p0af7mFzLp2QnTPKPmIcdEkzD+BhOolTC11SwMx1cy0=; b=NHypVo0sCENiIYLEmVgQhNnqLfLOSDGYGz2fI0RlPZ0lwOy3xoTxNlep3h4egrlh9l /SSuRcWpFePu3ZkB2rNSmNhyxNyrkcCyr/9cULFa9rejpcETnuwIdqgqqzUN05bDNk09 WHeihlgsRis8U8nzdVkacxun7nH390dxnJeNNdRZVamIGxZzxWiwRjDg4H9GvoAFARpm dvVFk2ZmAIeYW/z7uIUlZtXQIPmXQ7QzqPf0eQY67YSbr9vmRgsALfu9SICQUaSAieQG TMHjRoKtkqFeqDll9pMKqjQs/tyzzYf+DzIQCd6Lza1AEd+dNVeJ+CSUQjmzxItt8qEF N89w== X-Received: by 10.180.75.164 with SMTP id d4mr1314311wiw.58.1375876393450; Wed, 07 Aug 2013 04:53:13 -0700 (PDT) Received: from [192.168.1.26] (226.Red-81-34-93.dynamicIP.rima-tde.net. [81.34.93.226]) by mx.google.com with ESMTPSA id lp4sm8580424wic.2.2013.08.07.04.53.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 Aug 2013 04:53:12 -0700 (PDT) Message-ID: <52023668.8090909@gmail.com> Date: Wed, 07 Aug 2013 13:58:32 +0200 User-Agent: Thunderbird MIME-Version: 1.0 To: Leigh CC: Yasuo Ohgaki , "internals@lists.php.net" References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] crypt() should raise error without 2nd parameter From: keisial@gmail.com (=?ISO-8859-1?Q?=C1ngel_Gonz=E1lez?=) On 07/08/13 13:00, Leigh wrote: > On 7 August 2013 11:18, Yasuo Ohgaki wrote: > >> A user requested that crypt() should raise error without 2nd(slat) >> parameter. >> >> https://bugs.php.net/bug.php?id=55036 >> >> crypt() without salt generates extremely weak password hash. >> > The docs seem to indicate that some implementations generate their own > random salt if one is not supplied? It doesn't seem right to raise a > warning if it doesn't apply to _all_ cases. I do get a md5 with a salt when calling crypt, and looking at php that seems to be the intended behavior, not something system dependant (that's done since 5.3, according to the docs). I see a problem in that it uses php_rand() to generate the salt, but the solution should be to use php_password_make_salt for creating the salt, not the warning.