php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #77084 CryptGenRandom function used by random_int() and random_bytes() is deprecated
Submitted: 2018-10-30 12:32 UTC Modified: 2018-10-31 00:03 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: mumu at seznam dot cz Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: 7.3.0RC4 OS: Windows
Private report: No CVE-ID: None
 [2018-10-30 12:32 UTC] mumu at seznam dot cz
Description:
------------
The Windows API CryptGenRandom function is marked as deprecated with suggestion to use Cryptography Next Generation API instead.

Consider using the new API in a next PHP version.

https://docs.microsoft.com/en-us/windows/desktop/api/wincrypt/nf-wincrypt-cryptgenrandom


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-10-30 18:03 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2018-10-30 18:03 UTC] ab@php.net
Thanks for the report. Could you please point to the place where that deprecated APIs are used in 7.3? AFAIR php_get_random_bytes was moved to bcrypt at least in 7.2.

Thanks.
 [2018-10-30 18:11 UTC] mumu at seznam dot cz
-Status: Feedback +Status: Open
 [2018-10-30 18:11 UTC] mumu at seznam dot cz
I have not studied the sources just the official docs at http://php.net/random_int. The page states:

The sources of randomness used for this function are as follows: 
On Windows, CryptGenRandom() will always be used.
 [2018-10-30 19:21 UTC] ab@php.net
-Type: Feature/Change Request +Type: Documentation Problem
 [2018-10-30 19:21 UTC] ab@php.net
Confirmed, the new API is used as of 7.2, see http://git.php.net/?p=php-src.git;a=blob;f=UPGRADING.INTERNALS;hb=refs/heads/PHP-7.2#l30. Thus, turning into doc issue.

Thanks.
 [2018-10-31 00:01 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=345936
Log: Fix #77084: CryptGenRandom function used by random_int() and random_bytes() is deprecated
 [2018-10-31 00:03 UTC] cmb@php.net
-Status: Open +Status: Closed -Package: *General Issues +Package: Documentation problem -Assigned To: +Assigned To: cmb
 [2018-10-31 00:03 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2020-02-07 06:05 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=97847efdd47ba0decb280a6f47bb4d6ba562e373
Log: Fix #77084: CryptGenRandom function used by random_int() and random_bytes() is deprecated
 [2020-02-07 07:30 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/base.git;a=commit;h=2aa08cf15a252a5fcf955cb36dc2e7b7f34433a9
Log: Fix #77084: CryptGenRandom function used by random_int() and random_bytes() is deprecated
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Apr 11 03:01:23 2021 UTC