Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54114 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48376 invoked from network); 21 Jul 2011 01:21:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jul 2011 01:21:21 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.143 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.143 smtp143.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.143] ([67.192.241.143:55531] helo=smtp143.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 44/90-39763-F0F772E4 for ; Wed, 20 Jul 2011 21:21:20 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp24.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 10FB7180271; Wed, 20 Jul 2011 21:21:17 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp24.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id C002218026B; Wed, 20 Jul 2011 21:21:16 -0400 (EDT) Message-ID: <4E277F0C.9010003@sugarcrm.com> Date: Wed, 20 Jul 2011 18:21:16 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Solar Designer CC: PHP Internals List References: <20110719234406.GB28946@openwall.com> In-Reply-To: <20110719234406.GB28946@openwall.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] CRYPT_SHA256 fails tests in trunk From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! On 7/19/11 4:44 PM, Solar Designer wrote: > Hi, > > These tests fail in trunk on my x86_64 build: > > crypt_sha256.phpt > crypt_variation1.phpt > > The differences are like this: > > Expected:<$5$saltstring$5B8vYYiY.CVt1RlTTf8KbXBH3hsxY/GNooZaBBGWEc5> > Got<$5$saltst$JTS/fkywz8NvjeCGmWDndJPi7ZrRFhQKBLNtQZWE2C3> > > That is, the salts are truncated. There's a relevant recent change in > crypt.c involving the line: Yes, we had buffer overflow error there since the buffer salt[] was PHP_MAX_SALT_LEN+1 but if salt was longer salt[salt_in_len] later wrote 0 into bad place. But for SHA max salt len should be something like 123, so I wonder how comes it got truncated in that case. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227