Peter Kokot
8d3f8ca12a
Remove unused Git attributes ident
...
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.
In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.
This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Anatol Belski
1870a61a91
Fix coding style
2018-07-06 17:57:08 +02:00
David Carlier
9da4e30c75
random_bytes improvements for FreeBSD (from 12.x serie)
...
giving the possiblity to pre-fill the buffer. A new getrandom
function was added for future version with a similar interface
than Linux's syscall.
2018-07-06 17:47:59 +02:00
Dmitry Stogov
5eb1f92f31
Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence.
2018-05-28 16:27:12 +03:00
Xinchen Hui
a6519d0514
year++
2018-01-02 12:57:58 +08:00
krakjoe
1362c849e8
Merge branch 'PHP-7.1' into PHP-7.2
...
* PHP-7.1:
Fix bug #75409
2017-11-22 04:32:42 +00:00
Scott
269d160159
Fix bug #75409
2017-11-22 04:26:54 +00:00
Xinchen Hui
696bd37e67
Merge branch 'PHP-7.1'
...
* PHP-7.1:
Fixed condition check
Fixed condition check
another place
Conflicts:
ext/mcrypt/mcrypt.c
2017-04-10 14:49:13 +08:00
Xinchen Hui
4bebcb84ad
Fixed condition check
2017-04-10 14:47:24 +08:00
Nikita Popov
5da004cc75
Merge branch 'PHP-7.1'
2017-02-17 18:44:10 +01:00
Benjamin Robin
513582814b
Fixed bug #74105
...
If getrandom syscall is unavailable (ENOSYS), try to fallback on
/dev/urandom.
2017-02-17 18:42:35 +01:00
Nikita Popov
2aaf57e6ed
Merge branch 'PHP-7.1'
2017-01-09 23:30:07 +01:00
Leigh
14c72cc582
Fix check for linux getrandom syscall
2017-01-09 23:29:07 +01:00
Sammy Kaye Powers
478f119ab9
Update copyright headers to 2017
2017-01-04 11:14:55 -06:00
Sammy Kaye Powers
9e29f841ce
Update copyright headers to 2017
2017-01-02 09:30:12 -06:00
Sara Golemon
6f3945a9f1
Use new param API in standard
2016-12-30 12:56:21 -08:00
Leigh
c3361f16c7
Add php_random_int internal API
...
This is the internal API compliment to `php_random_bytes`
2016-10-20 10:18:07 +01:00
Lior Kaplan
2eb1f38d24
Happy new year (Update copyright to 2016)
2016-01-01 20:03:16 +02:00
Scott
c0ce2281bc
Update random.c
...
Supersedes #1589
2015-12-08 13:16:48 +01:00
Anthony Ferrara
908f67b1d4
Expose php_random_bytes as a first-class API within internals
...
This also defines two macros: php_random_bytes_throw and php_random_bytes_silent depending on use case which will throw exceptions or not respectively
2015-12-08 13:12:45 +01:00
Scott
00e3b7614e
Update random.c
...
Ref: beb826f6fd
2015-12-01 10:33:33 +08:00
Leigh
faf835be2b
Use arc4random on OpenBSD 5.5+ and NetBSD 7+
...
As discussed with @weltling, keeping arc4random on the condition that the OS has a solid implementation of it
2015-10-30 19:08:20 +00:00
Leigh
a53510239f
Remove arc4random
...
There has been a lot of discussion around whether arc4random should be included. Given how many different impementations of it are in the wild, we can't guarantee a secure implementation on all platforms.
2015-10-26 20:40:28 +00:00
Scott
63617a678f
Fixed bug #70641 (Random_* - Better compatibility on Linux distros)
...
See:
* https://bugs.php.net/bug.php?id=70641
* https://github.com/php/php-src/pull/1513#issuecomment-145571829
2015-10-06 01:03:04 +02:00
Scott
694b9af5b6
Remove makedev() check.
2015-09-29 09:14:30 +02:00
Scott
46aa628605
Different error message if makedev check fails
2015-09-29 09:14:29 +02:00
Scott
6554f721f7
Add support for getrandom(2), add type check on file descriptor
...
Fix to_read, throw exception if syscall fails
Fixes thanks to feedback from sarnold at ##crypto on freenode
Correction on error conditions
Remove dead code (thanks @defuse)
It turns out getrandom can take >256, getentropy refuses.
Better semantics
Thanks @defuse for catching my silly mistake here
Cast to size_t to be explicit
Let's simplify the logic a bit
Let's be consistent; define everything before we do any logic
Continuously check that the file descriptor is still a valid one
Add device type check on fd initialization
2015-09-29 09:14:28 +02:00
Bob Weinand
c12917aa45
Merged RFC Random Functions Throwing Exceptions in PHP 7
...
Squashes commits from PR #1397
commit cd5dcc8c9eb43603d908abcea69c9e18df0f2ed5
Author: SammyK <sammyk@sammykmedia.com>
Date: Tue Sep 8 13:53:42 2015 -0500
Add min max samezies
commit b719499218a4e84efecd4dc1d4235d16142c9793
Author: SammyK <sammyk@sammykmedia.com>
Date: Wed Sep 2 07:00:25 2015 -0500
Make random_bytes() throw Error when $length <= 0 and random_int() throw Error when $min > $max
commit 0cca557291c278716ec4b00b32fc2bdc1c1c8848
Author: SammyK <sammyk@sammykmedia.com>
Date: Wed Sep 2 06:55:59 2015 -0500
Make random_*() functions throw Error exception when random bytes cannot be obtained
commit 998c7f1e209123605b41139e8d9093075ce16bd6
Author: SammyK <sammyk@sammykmedia.com>
Date: Wed Sep 2 06:41:20 2015 -0500
Make random_*() functions throw TypeError when zend_parse_parameters fails
commit 99d305c18820ff55d82d952777cbcdf1cf0158be
Author: SammyK <sammyk@sammykmedia.com>
Date: Mon Jul 6 19:50:47 2015 -0500
Make exceptions less specific
commit b042dfab290713366741a663a420cf12bf802f39
Author: SammyK <sammyk@sammykmedia.com>
Date: Mon Jul 6 17:20:13 2015 -0500
Upgrade warnings to RuntimeExceptions
2015-09-09 01:00:29 +02:00
Anatol Belski
cbcacbb2da
improve condition
...
read() == 0 is EOL
2015-08-12 10:20:26 +02:00
Dmitry Stogov
4a2e40bb86
Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes).
2015-06-30 04:05:24 +03:00
Lauri Kenttä
cf7e5357a4
random_int: Fix power of two check.
...
(x & ~x) is always 0.
((x & (~x + 1)) != x) works.
((x & (x - 1)) != 0) works too.
2015-05-10 13:00:45 +02:00
SammyK
dd2692621d
Add tests for CSPRNG, fix C99 comments
...
Also replace one return; with RETURN_FALSE; for consistency.
2015-05-09 22:29:26 +02:00
Leigh
5f1b83e9bb
Improve CSPRNG implementation
2015-05-09 21:57:59 +02:00
SammyK
bc54d139aa
Initial implementation for CSPRNG API
2015-05-09 21:57:50 +02:00