Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72364 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48376 invoked from network); 7 Feb 2014 07:05:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Feb 2014 07:05:44 -0000 Authentication-Results: pb1.pair.com header.from=thruska@cubiclesoft.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=thruska@cubiclesoft.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain cubiclesoft.com designates 74.208.44.107 as permitted sender) X-PHP-List-Original-Sender: thruska@cubiclesoft.com X-Host-Fingerprint: 74.208.44.107 u15404699.onlinehome-server.com Received: from [74.208.44.107] ([74.208.44.107:57491] helo=u15404699.onlinehome-server.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/C1-34013-6C584F25 for ; Fri, 07 Feb 2014 02:05:42 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: thruska@cubiclesoft.com) with ESMTPSA id 2E0C25000B06 Message-ID: <52F485C1.4010208@cubiclesoft.com> Date: Fri, 07 Feb 2014 00:05:37 -0700 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: PHP Development Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Make mcrypt_create_iv() an alias and move the code into /ext/standard From: thruska@cubiclesoft.com (Thomas Hruska) mcrypt_create_iv() is the cleanest access to a universal system-level primitive that supports both /dev/urandom and php_win32_get_random_bytes() under the hood. Unfortunately, it resides in /ext/mcrypt and the mcrypt extension isn't always enabled/available (nor should it be). At any rate, it is quite odd that the function php_win32_get_random_bytes() is compiled into the core of PHP by default under Windows but there's currently no way to get at it except through an extension. There's good code in mcrypt_create_iv() that is significantly useful outside of the rest of that extension and it isn't actually dependent upon libmcrypt for proper operation. Moving the guts of this non-dependent function into the core would allow mcrypt_create_iv() to just become an alias. The new userland function could be located in /ext/standard/rand.c and have an uncreative name like rand_bytes(). -- Thomas Hruska CubicleSoft President I've got great, time saving software that you will find useful. http://cubiclesoft.com/