https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112012-08-27T23:21:55ZRuby Issue Tracking SystemRuby master - Bug #6928: SecureRandom.random_bytes: assume zero entropy for seed valuehttps://redmine.ruby-lang.org/issues/6928?journal_id=290652012-08-27T23:21:55Znahi (Hiroshi Nakamura)nakahiro@gmail.com
<ul></ul><p>Agreed. We should fix it because the current usage of OpenSSL::Rand.seed in secrerandom.rb is not expected; OpenSSL::Rand.seed(bytes) is a wrapper for RAND_seed(), RAND_seed() is equivalent to RAND_add() when num == entropy, and the entropy for RAND_add() must be a lower bound of an estimate of entropy of the given seed. 'ary.to_s' clearly does not have an entropy of 30 bytes.</p>
<p>The patch looks good to me. Though the buf would have 5 bytes or so of entropy, we don't need to bother the exact lower bound I think. :-)</p> Ruby master - Bug #6928: SecureRandom.random_bytes: assume zero entropy for seed valuehttps://redmine.ruby-lang.org/issues/6928?journal_id=349642012-12-21T22:32:15Ztarui (Masaya Tarui)tarui@prx.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li></ul> Ruby master - Bug #6928: SecureRandom.random_bytes: assume zero entropy for seed valuehttps://redmine.ruby-lang.org/issues/6928?journal_id=365342013-02-18T23:50:10Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul></ul><p>Martin, may I postpone this to next minor?<br>
Or must it be fixed immediately?</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a></p> Ruby master - Bug #6928: SecureRandom.random_bytes: assume zero entropy for seed valuehttps://redmine.ruby-lang.org/issues/6928?journal_id=366592013-02-20T16:24:06Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Target version</strong> changed from <i>2.0.0</i> to <i>2.6</i></li></ul><p>I assume that if this is so significant issue, Martin would have reported this to <a href="mailto:security@ruby-lang.org" class="email">security@ruby-lang.org</a>.<br>
So I postpone this to next minor.</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a></p> Ruby master - Bug #6928: SecureRandom.random_bytes: assume zero entropy for seed valuehttps://redmine.ruby-lang.org/issues/6928?journal_id=369702013-02-25T10:16:03ZMartinBosslet (Martin Bosslet)Martin.Bosslet@gmail.com
<ul></ul><p>mame (Yusuke Endoh) wrote:</p>
<blockquote>
<p>I assume that if this is so significant issue, Martin would have reported this to <a href="mailto:security@ruby-lang.org" class="email">security@ruby-lang.org</a>.<br>
So I postpone this to next minor.</p>
</blockquote>
<p>Sorry for not responding in time. It is safe to move this to next minor - right now, the risk I mentioned is only hypothetical and would only affect us if OpenSSL decided to change their internals.</p> Ruby master - Bug #6928: SecureRandom.random_bytes: assume zero entropy for seed valuehttps://redmine.ruby-lang.org/issues/6928?journal_id=381132013-04-03T00:09:39Zakr (Akira Tanaka)akr@fsij.org
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>This issue was solved with changeset r40072.<br>
Martin, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<ul>
<li>lib/securerandom.rb (SecureRandom.random_bytes): Use<br>
OpenSSL::Random.random_add instead of OpenSSL::Random.seed and<br>
specify 0.0 as the entropy.<br>
<a href="/issues/6928">[ruby-core:47308]</a> [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: SecureRandom.random_bytes: assume zero entropy for seed value (Closed)" href="https://redmine.ruby-lang.org/issues/6928">#6928</a>]</li>
</ul>