Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73294 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52523 invoked from network); 19 Mar 2014 02:31:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2014 02:31:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.174 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.216.174 mail-qc0-f174.google.com Received: from [209.85.216.174] ([209.85.216.174:40619] helo=mail-qc0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3A/6F-16983-E8109235 for ; Tue, 18 Mar 2014 21:31:42 -0500 Received: by mail-qc0-f174.google.com with SMTP id c9so3015049qcz.5 for ; Tue, 18 Mar 2014 19:31:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=tA3wl6W94C+A4lLg6KjtuDgOH3h8Z3NDkIK+6TtI3Vk=; b=FMl3aQPqW3kjILkVXm59IAEI7tCLDGFxRwmUnjkN9fOx2svKDfDPW4C3r4xFv6vS3X NvnTr1ephYPJ6krg8FA3UqFoCMJKLDsU2nuELdoOhjJhKe69a8rUysXUv6Bn4Rfen8GR T9QVADO+4KIDqRCeJFm0V7lXLKn0yJCy+ifyZZDvq9np1sYaOKbZ2MLqj99aPwUmTTHI OMGzdpdhqEOcdKlie1l4EQzTJ+D+f7lXRXzWos5wQcR125X5RWhzmCYpgIamQuX3HoLG 5fzWMW5RHhseqlCQ/MlFsSswYd7bI0Lu+XYhdv4FUiTuhrDtVg4erabR/pcvXM2hYLj1 akAQ== MIME-Version: 1.0 X-Received: by 10.140.21.164 with SMTP id 33mr30016120qgl.78.1395196299031; Tue, 18 Mar 2014 19:31:39 -0700 (PDT) Received: by 10.140.17.34 with HTTP; Tue, 18 Mar 2014 19:31:38 -0700 (PDT) In-Reply-To: References: <9E3AA302-1EC1-4497-996F-716555CAAB64@rouvenwessling.de> <4403BF54-041A-42F7-8B93-16EC3B2B0F43@rouvenwessling.de> Date: Wed, 19 Mar 2014 03:31:38 +0100 Message-ID: To: Yasuo Ohgaki Cc: Adam Harvey , =?UTF-8?Q?Rouven_We=C3=9Fling?= , PHP internals Content-Type: multipart/alternative; boundary=001a11c13acacbba1b04f4ec7372 Subject: Re: [PHP-DEV] [VOTE] Timing attack safe string comparison function From: tyra3l@gmail.com (Ferenc Kovacs) --001a11c13acacbba1b04f4ec7372 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Mar 19, 2014 at 1:27 AM, Yasuo Ohgaki wrote: > Hi all, > > On Wed, Mar 19, 2014 at 3:56 AM, Ferenc Kovacs wrote: > >> > > > From benchmark result, overhead for timing safe comparison is >> negligible >> > > > with byte by byte comparison. >> > > > I would like to see timing safe "=3D=3D=3D" for 5.6, if it's possi= ble. >> (=3D=3D could >> > > > be timing safe, too) >> > > > >> > > > Is anyone working on it? >> > > >> > > I don't know if someone else is, but I am not. >> > >> > I'm not in favour of this =E2=80=94 identity doesn't imply timing safe= ty, and >> > I think we should keep operators as performant as possible. >> > >> >> Agree and afair it was explicitly stated as out of scope for this rfc. >> (sorry for not merging this sooner, thanks Adam for thaking care of this= ). >> > Benchmark reveals performance issue is negligible. > and that benchmark was executed only one platform, with random data. I'm not saying that it's not accurate, but it is a different kind of risk when you introduce a new method for specific compare functionality than replacing =3D=3D=3D with this new method for everybody. > > Regardless of where it is implemented, simple byte by byte compare is the > best. > We may ignore length leak at all. It's simpler (less risk) and faster. > > It's better to make =3D=3D=3D timing safe like Python, since it would > be far less risks than dedicated API, but we may consider this later if > the risk is > getting greater. > I disagree, yeah we could cover up more ground if we replace the =3D=3D=3D implementation with a timing safe one, but that would be more riskier from the stability point of view, than adding it as a separate function first. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --001a11c13acacbba1b04f4ec7372--