]> granicus.if.org Git - php/commit
Add support for getrandom(2), add type check on file descriptor
authorScott <scott@paragonie.com>
Wed, 9 Sep 2015 10:50:06 +0000 (06:50 -0400)
committerAnatol Belski <ab@php.net>
Tue, 29 Sep 2015 07:14:28 +0000 (09:14 +0200)
commit6554f721f770c99037f07d465a7d610568576ce4
tree5879db22a3d40f39c56bb9d4b31d0360e60d5dcc
parent208ed0a01059a32af38be5c3c5481c200c8ec4a2
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
ext/standard/config.m4
ext/standard/random.c
ext/standard/tests/random/random_bytes.phpt