Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83653 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60215 invoked from network); 24 Feb 2015 11:08:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Feb 2015 11:08:48 -0000 Authentication-Results: pb1.pair.com header.from=leight@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=leight@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.179 as permitted sender) X-PHP-List-Original-Sender: leight@gmail.com X-Host-Fingerprint: 209.85.220.179 mail-vc0-f179.google.com Received: from [209.85.220.179] ([209.85.220.179:43230] helo=mail-vc0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 60/F3-37184-0CB5CE45 for ; Tue, 24 Feb 2015 06:08:48 -0500 Received: by mail-vc0-f179.google.com with SMTP id hy4so9726023vcb.10 for ; Tue, 24 Feb 2015 03:08:45 -0800 (PST) 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=i/5Qz4MEHXHt7lk/O+tod0MK+GGxtjpClwRgnWoEmPk=; b=T53geTqkL3/3HmW8Uxauz/X6WMHSbtnGr/+435tFUyMUzkj34BNgOQYG6FE5cjsHGD /+NgaDArbXyXy5/6+9t/kJAgRQO/anMGE/sXCqgkT+N7KIRtFcewrjrOr/BBarMGn6QQ V2UJ5qcQclJwjKk/xJwj7rm+zAKzaY45i1737plsZ0G4D3sdQ8fl2522iE7iaPQ5bztn wN8U6nVKHZxqLy53oWbUtoIZdTSrz9Q/ZdkO5uvaiBV4rDAhUFdPDSDrIq95icsibKsz O7qQ6G8swoEhmI8q+EcCGXH9pVb6/wR8ZMRKRyHsWZIPv6e7Sz7lJJp5ATaxeSN0g11y YwIQ== MIME-Version: 1.0 X-Received: by 10.52.28.19 with SMTP id x19mr14111721vdg.39.1424776125591; Tue, 24 Feb 2015 03:08:45 -0800 (PST) Received: by 10.52.4.104 with HTTP; Tue, 24 Feb 2015 03:08:45 -0800 (PST) In-Reply-To: References: Date: Tue, 24 Feb 2015 11:08:45 +0000 Message-ID: To: Pierre Joye Cc: Sammy Kaye Powers , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] [DISCUSSION] Reliable user-land CSPRNG From: leight@gmail.com (Leigh) On 24 February 2015 at 10:55, Pierre Joye wrote: > It should use the session.entropy_file setting as it aims to be the exact > same thing. It also allows custom entropy src (better ones for higher > demands) as well. I disagree. We want to take responsibility away from the user to choose the best source of entropy. The session.entropy_file setting also does not allow arc4random to be used, which is a source of cryptographic quality random without using a file descriptor. In fact I had planned for a future RFC where we allow session.entropy_file to use using random_bytes(). So the "best" source is chosen automatically. (If you think there are better sources not covered by this patch, please let me know, I would like it to be complete) There is an aspect of this that has been left for "future work", but if the list thinks it is important I can implement it for this RFC. The issue is that on Linux it still does not provide a way of getting random bytes without using a file descriptor. This is important for a couple of reasons, 1) It means chroot environments don't require /dev/*random 2) it prevents fd-exhaustion attacks that force lower quality randomness. LibreSSL-portable has a very good implementation of this using the Linux getrandom syscall (Kernel >= 3.17) that I can phpise and include if we think it is necessary.