Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72235 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8519 invoked from network); 5 Feb 2014 02:39:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2014 02:39:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.46 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.46 mail-la0-f46.google.com Received: from [209.85.215.46] ([209.85.215.46:43021] helo=mail-la0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 00/00-08465-574A1F25 for ; Tue, 04 Feb 2014 21:39:50 -0500 Received: by mail-la0-f46.google.com with SMTP id b8so7218001lan.33 for ; Tue, 04 Feb 2014 18:39:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=DJwRYHMK4uus+fz547qd+ukiBHNIvOmxCR5XPWOeyDE=; b=XNi+xxtDZlPdVu1CDb9c47GqvnaWBYggAjpQoWBTbvMcO3OqzdsTxufsJoRLEr21UR lndtcpS3cOfkjj3yt+ZczHspdHAok9klj3tQVnUtC52sXPNRwrYxxNTSEVsxrw+j6jaE fBHP7/7E38xK8k/hizXn5GzKo8pCjj9DJSU1GU19PWeftUfgugQYI6gHMomT707Y32Ry lS/S4KpG/q58QwKlfbS0MoaNPMxaI3VxJX8OpA8jLN9wAMiYdiUD9TyZl8s9FQrKc8RP kRHGfWDhRqBEN7usqoU6xSNOu3WdIQJ16nb6gOAqvNA8hut95R2p6Bn8ucPftd6Y6vul RcJw== X-Received: by 10.152.170.135 with SMTP id am7mr20259951lac.23.1391567986714; Tue, 04 Feb 2014 18:39:46 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.199.37 with HTTP; Tue, 4 Feb 2014 18:39:06 -0800 (PST) In-Reply-To: References: <9E3AA302-1EC1-4497-996F-716555CAAB64@rouvenwessling.de> Date: Wed, 5 Feb 2014 11:39:06 +0900 X-Google-Sender-Auth: DRYStOxVFLQe7Fsl71S9ppUGjo8 Message-ID: To: Sara Golemon Cc: =?UTF-8?Q?Rouven_We=C3=9Fling?= , PHP internals Content-Type: multipart/alternative; boundary=089e0122797a876c1604f19fab7b Subject: Re: [PHP-DEV] [VOTE] Timing attack safe string comparison function From: yohgaki@ohgaki.net (Yasuo Ohgaki) --089e0122797a876c1604f19fab7b Content-Type: text/plain; charset=UTF-8 Hi all, On Tue, Feb 4, 2014 at 1:18 AM, Sara Golemon wrote: > Voted yes, but IMO the comparison function should behave a little more > like ===. That is: something like hash_compare(null,"") should return > false. Possibly be even more strict and require both input parameters > to be string (e.g. hash_compare(123,123) would return false as well). > Good point! Comment just to make sure we have better implementation. hash_compare() should not accept anything other than string. E_WARNING is appropriate. IMO. So get parameter as zval and check types before processing is preferred. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --089e0122797a876c1604f19fab7b--