<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[wolfSSL - Embedded SSL Library — Potential bug + fix in aes.c AesDecrypt function]]></title>
		<link>https://www.wolfssl.com/forums/topic117-potential-bug-fix-in-aesc-aesdecrypt-function.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic117.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Potential bug + fix in aes.c AesDecrypt function.]]></description>
		<lastBuildDate>Wed, 01 Jun 2011 15:10:21 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Potential bug + fix in aes.c AesDecrypt function]]></title>
			<link>https://www.wolfssl.com/forums/post258.html#p258</link>
			<description><![CDATA[<p>Hi Sheldon,</p><p>Thanks for the bug fix.&nbsp; We&#039;ve made your suggested change and committed it to our GitHub repository.</p><p>Regards,<br />Chris</p>]]></description>
			<author><![CDATA[null@example.com (chrisc)]]></author>
			<pubDate>Wed, 01 Jun 2011 15:10:21 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post258.html#p258</guid>
		</item>
		<item>
			<title><![CDATA[Potential bug + fix in aes.c AesDecrypt function]]></title>
			<link>https://www.wolfssl.com/forums/post254.html#p254</link>
			<description><![CDATA[<p>hey,<br />I have been using the sniffer program for some personal learning, I have encountered the following scenario:<br />the function AesDecrypt from ctaocrypt/aes.c was called with an aes (type AES*) param whose &quot;rounds&quot; member was zero,<br />meaning:<br />aes-&gt;rounds == 0<br />later in the code, it states:<br />if(r &gt; 7)<br />&nbsp; &nbsp; &nbsp; &nbsp;return;</p><p>afterwards we go on a for loop which will take place r times (breaking from the loop in the middle of the r-th time). in the loop, we raise rk (which is initialized to point to an array of size 60) by 8 and lower r by 1, per loop. if r was zero before entering the loop, we will effectively have r=0 for the first half of the first time in the loop, then, since r is of type word32 (=unsigned int), we will make r be (2^32)-1 after the r-- operation, thus resulting in a an almost infinite loop, during which rk will definitely exceed the bounds of the array it points to, which will result in a segmentation fault. </p><p>I am not sure whether the traffic i was testing is considered &quot;correct&quot;, maybe I accidentally&nbsp; stumbled upon some corrupted packets, but anyhow,<br />i think it could be wise to change the return condition before entering the loop to:<br />if(r &gt; 7 || r == 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; return;</p><p>hope this helps someone,</p><p>SheldonC</p>]]></description>
			<author><![CDATA[null@example.com (SheldonCooper)]]></author>
			<pubDate>Tue, 31 May 2011 11:43:13 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post254.html#p254</guid>
		</item>
	</channel>
</rss>
