Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72316 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20995 invoked from network); 6 Feb 2014 04:32:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Feb 2014 04:32:01 -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.217.171 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.171 mail-lb0-f171.google.com Received: from [209.85.217.171] ([209.85.217.171:63828] helo=mail-lb0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DE/12-09398-F3013F25 for ; Wed, 05 Feb 2014 23:32:00 -0500 Received: by mail-lb0-f171.google.com with SMTP id c11so1041246lbj.16 for ; Wed, 05 Feb 2014 20:31:57 -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=jf3fr43kanTjNidsUCbSI13Z2nzoaCBuNqXtNQmizog=; b=oZEfaDFhs4tO6VrKjjz1XuI/U876Wc4oIIxKJok7cq8gufdxh6aPQ1bh/AIo1s+q// pSH0fqXXjcuAvDViqR9KicswWO2ccTRVDyy8IjYs2IbubRRUdD5h90G4SMzws/2kzesq /zdXLrR7RXYvYFoVEJDK6rQRQZ+7lvmmivCqbOaWAMnGfPnQjrlqoZ2+rT0ipsHqzsY9 ceTs/jEeBspNP9u5kAV7CGqKKerKl3l33EZcm8jSDwvYaVljb41eggKZy++QOzRnqXia E4aQHhfkMCSflYud7doU7PZQDmIQuuhicnqTaHNpzpBUdNvJdofAK3bfpdETL39AVCK4 dIiw== X-Received: by 10.152.219.37 with SMTP id pl5mr93675lac.36.1391661117084; Wed, 05 Feb 2014 20:31:57 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.199.37 with HTTP; Wed, 5 Feb 2014 20:31:17 -0800 (PST) In-Reply-To: References: <9E3AA302-1EC1-4497-996F-716555CAAB64@rouvenwessling.de> <52F0139C.2060102@sugarcrm.com> Date: Thu, 6 Feb 2014 13:31:17 +0900 X-Google-Sender-Auth: CaTzDbsSWpzjsAcNyHZ08UTQquM Message-ID: To: =?UTF-8?Q?Rouven_We=C3=9Fling?= Cc: Stas Malyshev , Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary=001a1133604488171904f1b55ab4 Subject: Re: [PHP-DEV] [VOTE] Timing attack safe string comparison function From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a1133604488171904f1b55ab4 Content-Type: text/plain; charset=UTF-8 Sorry for multiple posts. On Thu, Feb 6, 2014 at 1:20 PM, Yasuo Ohgaki wrote: > Since comparison of short and/or not hashed data (e.g. user supplied raw > password) should > not be done as the function name imply, we may better to document so that > users always > compare hashed values even when they store raw password/etc. > So randomized delay may be overkill. > Because user should not pass other than hashed values, we may return FALSE simply when length mismatches. Generated hashed length should not be a secret. This get rid of length leak issue and the function name is good for this purpose and make the operation always constant. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.netSo --001a1133604488171904f1b55ab4--