Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72775 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91893 invoked from network); 23 Feb 2014 20:59:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Feb 2014 20:59:55 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.54 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.54 mail-la0-f54.google.com Received: from [209.85.215.54] ([209.85.215.54:52336] helo=mail-la0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 32/A4-57053-8416A035 for ; Sun, 23 Feb 2014 15:59:53 -0500 Received: by mail-la0-f54.google.com with SMTP id mc6so1173712lab.13 for ; Sun, 23 Feb 2014 12:59:49 -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=v4yk7tbVJkRssY4vTJ53AA2lLa8nKYF+d575yhL/FA4=; b=HhMGy0XDPLEzeyjTv2DPcjEVhwVZhmkGKtmbe/NY2YDPnU875USfx2mH685jBRMLG1 UbCuP60MmO6AqNRps0yvxnQiDbnv61/8GpzJp+zqmZLLDu/R/37EoZKSIOn25zuF3XSL KuAUR0SGbQ8S9U1cH0PBZlGX4MEm+6tThePeGISbjdarDYV9czFx8mABtFumCA5FfWRO r9t/VCLw8lWm28dwBB1x7YN2jcCpi/jcWoqJZ3NlobjL2QY6v3l2kGqjJqxf6c1Peki8 AjskxDJeo7pkhJWo/yDjkVoLqAs7E4Teo3vgCEqsl36Hu3CDzKzdrDuGcGs+gQixvxyk QiVA== X-Received: by 10.152.36.70 with SMTP id o6mr9988567laj.7.1393189189388; Sun, 23 Feb 2014 12:59:49 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.199.37 with HTTP; Sun, 23 Feb 2014 12:59:09 -0800 (PST) In-Reply-To: <47C11B57-84E9-4805-9952-1E78A9F112C5@rouvenwessling.de> References: <9E3AA302-1EC1-4497-996F-716555CAAB64@rouvenwessling.de> <3EAEC401-F0FF-42E6-8B93-41D2E8658A80@rouvenwessling.de> <47C11B57-84E9-4805-9952-1E78A9F112C5@rouvenwessling.de> Date: Mon, 24 Feb 2014 05:59:09 +0900 X-Google-Sender-Auth: hvra_8t6udlzIC7x1OfF8Vanxn0 Message-ID: To: =?UTF-8?Q?Rouven_We=C3=9Fling?= Cc: PHP internals , Solar Designer Content-Type: multipart/alternative; boundary=089e0160b618bd0f6304f31922df Subject: Re: [PHP-DEV] [VOTE] Timing attack safe string comparison function From: yohgaki@ohgaki.net (Yasuo Ohgaki) --089e0160b618bd0f6304f31922df Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Rouven, On Mon, Feb 24, 2014 at 3:31 AM, Rouven We=C3=9Fling = wrote: > I've updated the patch, taking the following feedback into account: > -Renamed function to hash_equals > -Error out early in case string lengths are not equal (I've maintained th= e > name known_string and user_string too allow improving this in the future, > also makes for a nicer error message) > -Only allow strings to be compared > > The patch can be found here: > https://github.com/realityking/php-src/compare/hash_equals > > If anyone thinks, that this needs a new RFC please say so. > I did some experiments. It seems it's good to implement timing safe comparison in engine. i.e. We can make =3D=3D/=3D=3D=3D secure by default l= ike Python. It would be much safer get rid of all timing from PHP. We need new RFC to include the change in engine. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --089e0160b618bd0f6304f31922df--