<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/securerandom.rb, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/securerandom] Bump up v0.3.1</title>
<updated>2023-12-16T04:10:38+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2023-12-16T04:09:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2b3fc0407a9b9527ae5bf8069943661a061ec0ba'/>
<id>2b3fc0407a9b9527ae5bf8069943661a061ec0ba</id>
<content type='text'>
https://github.com/ruby/securerandom/commit/890d659970
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/securerandom/commit/890d659970
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/securerandom] [DOC] Satisfy RDoc coverage</title>
<updated>2023-12-12T06:40:44+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-12-12T05:41:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e411bd5b3684bfa5c654290059e9207a9596aad7'/>
<id>e411bd5b3684bfa5c654290059e9207a9596aad7</id>
<content type='text'>
https://github.com/ruby/securerandom/commit/ddf2672e47
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/securerandom/commit/ddf2672e47
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/securerandom] [DOC] Add documents of methods and constants</title>
<updated>2023-12-12T06:40:43+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-12-12T05:11:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=dbd704ae6f0e0fdcefa2007ce1c06f7021c8e830'/>
<id>dbd704ae6f0e0fdcefa2007ce1c06f7021c8e830</id>
<content type='text'>
https://github.com/ruby/securerandom/commit/9a99978135
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/securerandom/commit/9a99978135
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/securerandom] Bump up 0.3.0</title>
<updated>2023-11-07T04:21:23+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2023-11-07T04:20:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c3a11f1cfc9b5da62a45246e40aaac4bb8c42e83'/>
<id>c3a11f1cfc9b5da62a45246e40aaac4bb8c42e83</id>
<content type='text'>
https://github.com/ruby/securerandom/commit/12c4ef3ea1
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/securerandom/commit/12c4ef3ea1
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/securerandom] Expose SecureRandom::VERSION</title>
<updated>2023-04-14T01:43:47+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2023-03-30T05:07:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ebe620def601d804b7dba1e00132b9bc10d5ef6f'/>
<id>ebe620def601d804b7dba1e00132b9bc10d5ef6f</id>
<content type='text'>
https://github.com/ruby/securerandom/commit/2e6434331d
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/securerandom/commit/2e6434331d
</pre>
</div>
</content>
</entry>
<entry>
<title>avoid seeding</title>
<updated>2023-04-13T10:50:00+00:00</updated>
<author>
<name>卜部昌平</name>
<email>shyouhei@ruby-lang.org</email>
</author>
<published>2023-04-13T06:36:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=64e503eb62aff0952b655e9a86217e355f786146'/>
<id>64e503eb62aff0952b655e9a86217e355f786146</id>
<content type='text'>
OpenSSL's man page previously stated that "the application is
responsible for seeding the PRNG by calling RAND_add" (see [1]).
So we had this code.  However things changed.  They no longer
say so, instead "manual (re-)seeding of the default OpenSSL
random generator is not necessary" now (see [2]).  It seems all
OpenSSL versions that we support now already behaves like this.
Let's follow that.

[1]: https://www.openssl.org/docs/man1.0.2/man3/RAND_add.html
[2]: https://www.openssl.org/docs/manmaster/man3/RAND_add.html
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
OpenSSL's man page previously stated that "the application is
responsible for seeding the PRNG by calling RAND_add" (see [1]).
So we had this code.  However things changed.  They no longer
say so, instead "manual (re-)seeding of the default OpenSSL
random generator is not necessary" now (see [2]).  It seems all
OpenSSL versions that we support now already behaves like this.
Let's follow that.

[1]: https://www.openssl.org/docs/man1.0.2/man3/RAND_add.html
[2]: https://www.openssl.org/docs/manmaster/man3/RAND_add.html
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/securerandom.rb: Fix the check of availability of Random.urandom</title>
<updated>2022-02-16T07:32:28+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2022-02-16T05:15:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b9851c7e1b1cbc13b050831b0429e7a4097e11b7'/>
<id>b9851c7e1b1cbc13b050831b0429e7a4097e11b7</id>
<content type='text'>
Random.urandom raises a RuntimeError if it is unavailable.
[Bug #13885]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Random.urandom raises a RuntimeError if it is unavailable.
[Bug #13885]
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/securerandom] Split Random::Formatter from SecureRandom [Feature #18190]</title>
<updated>2021-12-09T11:26:44+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-12-05T12:53:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=12a0a89e22fbc312e4a95a7749bc153532daa855'/>
<id>12a0a89e22fbc312e4a95a7749bc153532daa855</id>
<content type='text'>
https://github.com/ruby/securerandom/commit/1e57277b9e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/securerandom/commit/1e57277b9e
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/securerandom] [DOC] fix a code mark up [ci skip]</title>
<updated>2021-08-24T10:29:54+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-08-24T10:24:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b62ed309f05d248c746279f35f2609f01ea1e4a5'/>
<id>b62ed309f05d248c746279f35f2609f01ea1e4a5</id>
<content type='text'>
https://github.com/ruby/securerandom/commit/de47532707
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/securerandom/commit/de47532707
</pre>
</div>
</content>
</entry>
<entry>
<title>Make SecureRandom support Ractor</title>
<updated>2020-09-09T19:45:43+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2020-09-05T00:32:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=475c8701d74ebebefb2f53052cde1a5effb4cb81'/>
<id>475c8701d74ebebefb2f53052cde1a5effb4cb81</id>
<content type='text'>
SecureRandom lazily defines `get_random`.  Accessing the mutex to define
the `get_random` method is not supported inside a Ractor.  This commit
defines `gen_random` when `securerandom` is required and makes it
suppore Ractor (as well as thread safe).

Here is a test program:

```ruby
require "securerandom"

r = Ractor.new do
  loop do
    Ractor.yield SecureRandom.hex
  end
end

p r.take
```

Before this commit:

```
$ make runruby
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems ./test.rb
&lt;internal:ractor&gt;:38: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
/Users/aaron/git/ruby/lib/securerandom.rb:94:in `gen_random': can not access instance variables of classes/modules from non-main Ractors (RuntimeError)
&lt;internal:ractor&gt;:124:in `take': thrown by remote Ractor. (Ractor::RemoteError)
	from ./test.rb:9:in `&lt;main&gt;'
/Users/aaron/git/ruby/lib/securerandom.rb:94:in `gen_random': can not access instance variables of classes/modules from non-main Ractors (RuntimeError)
	from /Users/aaron/git/ruby/lib/securerandom.rb:155:in `random_bytes'
	from /Users/aaron/git/ruby/lib/securerandom.rb:176:in `hex'
	from ./test.rb:5:in `block (2 levels) in &lt;main&gt;'
	from ./test.rb:4:in `loop'
	from ./test.rb:4:in `block in &lt;main&gt;'
make: *** [runruby] Error
```

After this commit:

```
$ make runruby
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems ./test.rb
&lt;internal:ractor&gt;:38: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
"3fc8885157e3911bab4b5d7619bb0308"
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SecureRandom lazily defines `get_random`.  Accessing the mutex to define
the `get_random` method is not supported inside a Ractor.  This commit
defines `gen_random` when `securerandom` is required and makes it
suppore Ractor (as well as thread safe).

Here is a test program:

```ruby
require "securerandom"

r = Ractor.new do
  loop do
    Ractor.yield SecureRandom.hex
  end
end

p r.take
```

Before this commit:

```
$ make runruby
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems ./test.rb
&lt;internal:ractor&gt;:38: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
/Users/aaron/git/ruby/lib/securerandom.rb:94:in `gen_random': can not access instance variables of classes/modules from non-main Ractors (RuntimeError)
&lt;internal:ractor&gt;:124:in `take': thrown by remote Ractor. (Ractor::RemoteError)
	from ./test.rb:9:in `&lt;main&gt;'
/Users/aaron/git/ruby/lib/securerandom.rb:94:in `gen_random': can not access instance variables of classes/modules from non-main Ractors (RuntimeError)
	from /Users/aaron/git/ruby/lib/securerandom.rb:155:in `random_bytes'
	from /Users/aaron/git/ruby/lib/securerandom.rb:176:in `hex'
	from ./test.rb:5:in `block (2 levels) in &lt;main&gt;'
	from ./test.rb:4:in `loop'
	from ./test.rb:4:in `block in &lt;main&gt;'
make: *** [runruby] Error
```

After this commit:

```
$ make runruby
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems ./test.rb
&lt;internal:ractor&gt;:38: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
"3fc8885157e3911bab4b5d7619bb0308"
```
</pre>
</div>
</content>
</entry>
</feed>
