<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Debian and the OpenSSL PRNG</title><link>http://msmvps.com/blogs/alunj/archive/2008/05/15/1623193.aspx</link><description>[PRNG is an abbreviation for &amp;quot;Pseudo-Random Number Generator&amp;quot;, a key core component of the key-generation in any cryptographic library.] A few people have already commented on the issue itself - Debian issued, in 2006, a version of their Linux</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Searching for Weak Debian / Ubuntu SSL Certificates</title><link>http://msmvps.com/blogs/alunj/archive/2008/05/15/1623193.aspx#1626287</link><pubDate>Fri, 23 May 2008 04:45:50 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1626287</guid><dc:creator>Tales from the Crypto</dc:creator><description>&lt;p&gt;I&amp;amp;#39;ve seen a number of people promote packages that have shipped for Debian and Ubuntu, which allow&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1626287" width="1" height="1"&gt;</description></item><item><title>re: Debian and the OpenSSL PRNG</title><link>http://msmvps.com/blogs/alunj/archive/2008/05/15/1623193.aspx#1625390</link><pubDate>Wed, 21 May 2008 03:59:15 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1625390</guid><dc:creator>Alun Jones</dc:creator><description>&lt;p&gt;Actually, it didn't really require much knowledge of crypto to realise that something was wrong with the change made by the Debian folks.&lt;/p&gt;
&lt;p&gt;It's clear that a buffer is passed in to this function to &amp;quot;add&amp;quot; it to something in a crypto function - once out of several times, the buffer comes from uninitialised memory, and this is what caused the Purify / Valgrind errors.&lt;/p&gt;
&lt;p&gt;If the Debian guys had simply 'fixed' the one call that supplied uninitialised data, life wouldn't have been so bad. Instead of fixing the call, they fixed the function, so that the function essentially did nothing with its main parameter.&lt;/p&gt;
&lt;p&gt;That should have been a clue that they were neutering an important operation of the function.&lt;/p&gt;
&lt;p&gt;A little knowledge is clearly a dangerous thing.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1625390" width="1" height="1"&gt;</description></item><item><title>re: Debian and the OpenSSL PRNG</title><link>http://msmvps.com/blogs/alunj/archive/2008/05/15/1623193.aspx#1625356</link><pubDate>Wed, 21 May 2008 02:56:12 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1625356</guid><dc:creator>Aaron Margosis</dc:creator><description>&lt;p&gt;Ya wrote:&lt;/p&gt;
&lt;p&gt;&amp;gt; At least if you have the source code, and are insanely motivated, you can find out what the truth of a matter is.&lt;/p&gt;
&lt;p&gt;??? The Debian guys had the source code. &amp;nbsp;Is insane motivation enough? &amp;nbsp;Doesn&amp;#39;t it also require deep knowledge of cryptography to be able to divine anything resembling &amp;quot;truth&amp;quot; here? &amp;nbsp;If you have the source and the ability to modify it, chances are much better than you&amp;#39;ll do something that will someday end up in an Alun Jones blog post. :)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1625356" width="1" height="1"&gt;</description></item><item><title>re: Debian and the OpenSSL PRNG</title><link>http://msmvps.com/blogs/alunj/archive/2008/05/15/1623193.aspx#1625318</link><pubDate>Wed, 21 May 2008 00:30:46 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1625318</guid><dc:creator>Harry Johnston</dc:creator><description>&lt;p&gt;OK, that makes more sense than my version. &amp;nbsp;On the other hand, it means it was an even sillier mistake than I originally thought!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1625318" width="1" height="1"&gt;</description></item><item><title>re: Debian and the OpenSSL PRNG</title><link>http://msmvps.com/blogs/alunj/archive/2008/05/15/1623193.aspx#1624919</link><pubDate>Tue, 20 May 2008 13:55:56 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1624919</guid><dc:creator>Kieran</dc:creator><description>&lt;p&gt;From my reading the only source of entropy was the process id, all others would be ignored. Is this thinking correct?&lt;/p&gt;
&lt;blockquote&gt;
&lt;div class="commentowner"&gt;&lt;em&gt;Once that line had been removed, yes, the only entropy being added by the call to ssleay_rand_add was the PID, which usually numbers under 32,768.&lt;/em&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1624919" width="1" height="1"&gt;</description></item><item><title>re: Debian and the OpenSSL PRNG</title><link>http://msmvps.com/blogs/alunj/archive/2008/05/15/1623193.aspx#1624773</link><pubDate>Tue, 20 May 2008 04:16:39 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1624773</guid><dc:creator>Alun Jones</dc:creator><description>&lt;p&gt;You are right. I have the story wrong.&lt;/p&gt;
&lt;p&gt;There were two lines of code - one from the seed function, and one from the function that, as you say, adds entropy of the calling program's choosing. The latter is still an issue - a program that encrypts using known values and a user's chosen entropy is no good if it ignores the entropy.&lt;/p&gt;
&lt;p&gt;However, the part that's the big deal here is the line in the &amp;quot;add random bytes to seed&amp;quot; function.&lt;/p&gt;
&lt;p&gt;So my description is wrong - instead of removing the small uninitialised buffer entropy only, the seed function removed all sources of entropy - even on machines with dedicated hardware random number generators!&lt;/p&gt;
&lt;p&gt;Every time a piece of code said &amp;quot;here's some entropy to add to the seed to make it more random&amp;quot;, the function said &amp;quot;I'm not touching that, it might be uninitialised&amp;quot;.&lt;/p&gt;
&lt;p&gt;Contrary to my earlier assertion, then, if you generated a key on OpenSSL or any program that called OpenSSL, on a Debian Linux or derivative build, your keys are weak and must be regenerated.&lt;/p&gt;
&lt;p&gt;It's unconscionable that someone would check in this code, and that noone of the &amp;quot;many eyeballs&amp;quot; noticed it.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1624773" width="1" height="1"&gt;</description></item><item><title>re: Debian and the OpenSSL PRNG</title><link>http://msmvps.com/blogs/alunj/archive/2008/05/15/1623193.aspx#1624286</link><pubDate>Mon, 19 May 2008 08:36:22 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1624286</guid><dc:creator>davidw</dc:creator><description>&lt;p&gt;You have the story wrong:&lt;/p&gt;
&lt;p&gt;The Debian guy commented out two lines of code. &amp;nbsp;One of those directly added contents of an uninitialized buffer to the pool, stirring things up slightly.&lt;/p&gt;
&lt;p&gt;But he also commented out another line, with far more drastic consequences. &amp;nbsp;It seems that there is a function in the code that provides the major source of randomness. &amp;nbsp;The Debian guy also commented out the line of code that adds the output of this function to the pool.&lt;/p&gt;
&lt;p&gt;See&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.links.org/?p=328"&gt;http://www.links.org/?p=328&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1624286" width="1" height="1"&gt;</description></item><item><title>re: Debian and the OpenSSL PRNG</title><link>http://msmvps.com/blogs/alunj/archive/2008/05/15/1623193.aspx#1624226</link><pubDate>Mon, 19 May 2008 01:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1624226</guid><dc:creator>Harry Johnston</dc:creator><description>&lt;p&gt;&amp;quot;Other sources of entropy would have increased the number of possible keys, wouldn&amp;#39;t they?&amp;quot;&lt;/p&gt;
&lt;p&gt;Originally, yes; but the code change in question prevented not only the uninitialized data from being included in the seed but also all the other sources of entropy included in the original algorithm (except the PID).&lt;/p&gt;
&lt;p&gt;I assume the code looked something like this, although of course not as obvious:&lt;/p&gt;
&lt;p&gt;char buffer[buf_size];&lt;/p&gt;
&lt;p&gt;while (some-condition) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp;insert-entropy-into-prng(&amp;amp;buffer);&lt;/p&gt;
&lt;p&gt; &amp;nbsp;get-some-entropy(&amp;amp;buffer);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;and the change made was equivalent to removing the call to insert-entropy-into-prng. (!)&lt;/p&gt;
&lt;p&gt;Once again, for emphasis - this is based on what I&amp;#39;ve previously read about the issue, I may have been misinformed or have misinterpreted it.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1624226" width="1" height="1"&gt;</description></item><item><title>re: Debian and the OpenSSL PRNG</title><link>http://msmvps.com/blogs/alunj/archive/2008/05/15/1623193.aspx#1624209</link><pubDate>Sun, 18 May 2008 23:46:37 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1624209</guid><dc:creator>Alun Jones</dc:creator><description>&lt;p&gt;Other sources of entropy would have increased the number of possible keys, wouldn't they?&lt;/p&gt;
&lt;p&gt;As I acknowledged in my article, there are other sources of entropy - a file containing a random seed, or the random device. However, the random device isn't there on all machines, and a user may not care about creating a random seed file. In such base configurations, it appears, all you get is the PID and the uninitialised data.&lt;/p&gt;
&lt;p&gt;If there were more entropy than that, HD Moore's keys wouldn't work, would they?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1624209" width="1" height="1"&gt;</description></item><item><title>re: Debian and the OpenSSL PRNG</title><link>http://msmvps.com/blogs/alunj/archive/2008/05/15/1623193.aspx#1624131</link><pubDate>Sun, 18 May 2008 21:29:40 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1624131</guid><dc:creator>Harry Johnston</dc:creator><description>&lt;p&gt;I don&amp;#39;t know this for a fact, but my understanding is that the line of code that was incorrectly removed was only using uninitialized data on the first iteration. &amp;nbsp;On the remaining iterations it was adding various other sources of entropy.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1624131" width="1" height="1"&gt;</description></item></channel></rss>