shyouhei abae70d6ed SecureRandom should try /dev/urandom first [Bug #9569]
* random.c (InitVM_Random): rename Random.raw_seed to
	  Random.urandom.  A quick search seems there are no practical use
	  of this method than securerandom.rb so I think it's OK to rename
	  but if there are users of it, this hunk is subject to revert.

	* test/ruby/test_rand.rb (TestRand#test_urandom): test for it.

	* lib/securerandom.rb (SecureRandom.gen_random): Prefer OS-
	  provided CSPRNG if available. Otherwise falls back to OpenSSL.
	  Current preference is:

	  1. CSPRNG routine that the OS has; one of
	     - getrandom(2),
	     - arc4random(3), or
	     - CryptGenRandom()
	  2. /dev/urandom device
	  3. OpenSSL's RAND_bytes(3)

	  If none of above random number generators are available, you
	  cannot use this module.  An exception is raised that case.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-20 08:00:00 +00:00
..
2016-08-30 06:22:30 +00:00
2016-12-27 07:18:27 +00:00
2016-08-30 06:22:30 +00:00
2016-10-22 00:52:59 +00:00
2017-01-01 09:17:10 +00:00
2016-11-26 11:37:01 +00:00
2016-08-05 15:39:46 +00:00
2016-11-14 05:17:55 +00:00
2016-12-21 11:12:39 +00:00
2016-12-06 07:46:14 +00:00
2016-11-16 05:25:53 +00:00
2016-05-22 02:28:03 +00:00
2017-01-06 03:02:38 +00:00
2016-12-31 08:07:58 +00:00
2016-11-21 22:45:26 +00:00
2017-01-11 02:31:02 +00:00
2016-08-02 12:40:51 +00:00
2016-10-22 13:33:34 +00:00
2016-12-14 04:35:28 +00:00
2016-10-20 07:59:44 +00:00
2016-11-11 11:52:03 +00:00
2017-01-16 02:56:28 +00:00
2017-01-19 07:18:23 +00:00
2016-12-17 18:04:30 +00:00
2016-07-26 13:02:33 +00:00
2016-10-28 15:14:32 +00:00
2016-12-02 02:47:11 +00:00
2016-12-06 12:49:46 +00:00