Homec4science

Default to openssl_random_pseudo_bytes instead of /dev/urandom.

Authored by Gabriel Guzman <gabriel.guzman@gammaemail.com> on Nov 7 2013, 23:34.

Description

Default to openssl_random_pseudo_bytes instead of /dev/urandom.

Summary: When available, prefer php's built in openssl_random_pseudo_bytes() to /dev/urandom. Test for functionality and fallback to /dev/urandom if necessary to get data. Simplifies the code a bit, and is somewhat more functional as running inside a chroot is now possible.

Test Plan: Add unit test for readRandomBytes() Would be nice to have someone test this on windows. Working on ubuntu at the moment.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7528

Details

Committed
epriestley <git@epriestley.com>Nov 7 2013, 23:34
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUdc6e2bdf4c3c: Add "PhutilDirectedScalarGraph"
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU13ad06352d84: Default to openssl_random_pseudo_bytes instead of /dev/urandom. (authored by Gabriel Guzman <gabriel.guzman@gammaemail.com>).Nov 7 2013, 23:34