<?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 — wc_InitRsaKey causes stack smashing]]></title>
		<link>https://www.wolfssl.com/forums/topic817-wcinitrsakey-causes-stack-smashing.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic817.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in wc_InitRsaKey causes stack smashing.]]></description>
		<lastBuildDate>Tue, 05 Jul 2016 22:17:16 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: wc_InitRsaKey causes stack smashing]]></title>
			<link>https://www.wolfssl.com/forums/post2580.html#p2580</link>
			<description><![CDATA[<p>Hi Colin,</p><p>Great! Glad that fixed your problem.</p><p>Best Regards,<br />Chris</p>]]></description>
			<author><![CDATA[null@example.com (chrisc)]]></author>
			<pubDate>Tue, 05 Jul 2016 22:17:16 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2580.html#p2580</guid>
		</item>
		<item>
			<title><![CDATA[Re: wc_InitRsaKey causes stack smashing]]></title>
			<link>https://www.wolfssl.com/forums/post2579.html#p2579</link>
			<description><![CDATA[<p>Hi Chris,</p><p>Thanks! It seems like I was missing the options.h include that you mentioned. I realize now that I neglected to cite my includes from above.</p><p>Adding those lines seems to have fixed the problem.</p>]]></description>
			<author><![CDATA[null@example.com (colin.foster)]]></author>
			<pubDate>Tue, 05 Jul 2016 21:47:28 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2579.html#p2579</guid>
		</item>
		<item>
			<title><![CDATA[Re: wc_InitRsaKey causes stack smashing]]></title>
			<link>https://www.wolfssl.com/forums/post2575.html#p2575</link>
			<description><![CDATA[<p>Hi,</p><p>Have you compiled your application using the same preprocessor defines that were used when compiling wolfSSL?</p><p>When using the Autoconf system (./configure), the easiest way to make sure this happens is to include the &lt;wolfssl/options.h&gt; header as the first wolfSSL include in your application:</p><div class="codebox"><pre><code>#include &lt;wolfssl/options.h&gt;
#include &lt;wolfssl/ssl.h&gt;
...</code></pre></div><p>Best Regards,<br />Chris</p>]]></description>
			<author><![CDATA[null@example.com (chrisc)]]></author>
			<pubDate>Tue, 05 Jul 2016 18:03:26 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2575.html#p2575</guid>
		</item>
		<item>
			<title><![CDATA[wc_InitRsaKey causes stack smashing]]></title>
			<link>https://www.wolfssl.com/forums/post2574.html#p2574</link>
			<description><![CDATA[<p>I&#039;m trying to create an RSA keypair using the following code:</p><div class="codebox"><pre><code>int main()
{
    RsaKey rsakey;
    printf(&quot;Memory allocated\n&quot;);

    RNG rng;
    wc_InitRng(&amp;rng);
    printf(&quot;Ring initialized\n&quot;);
    wc_InitRsaKey(&amp;rsakey, 0);
    printf(&quot;RSA key initialized\n&quot;);

    int ret = wc_MakeRsaKey(&amp;rsakey, 1024, 65537, &amp;rng);

    printf(&quot;RSA key made\n&quot;);

    if (ret != 0)
        printf(&quot;Error creating RSA key\n&quot;);
    else
        printf(&quot;Successfully created the RSA key\n&quot;);

    return 0;
}</code></pre></div><p>I have even placed the return 0 after the wc_MakeRsaKey line. When I run this program, I see the following output:</p><div class="quotebox"><blockquote><p>$ ./main <br />Memory allocated<br />Ring initialized<br />RSA key initialized<br />RSA key made<br />Successfully created the RSA key<br />*** stack smashing detected ***: &lt;unknown&gt; terminated<br />Aborted (core dumped)</p></blockquote></div><p>I have tried including the wolfssl/wolfcrypt/rsa.h as well as the cyassl/ctaocrypt/rsa.h files, both seem to have the same problem. </p><p>I have downloaded the wolfssl3.9.6 file, configured it with </p><div class="codebox"><pre><code>./configure --enable-keygen</code></pre></div><p>, I can verify the install with </p><div class="codebox"><pre><code>wolfssl-config --version</code></pre></div><p>The code is compiled with the following Makefile (excerpt)</p><div class="codebox"><pre><code>CC=gcc
CFLAGS=-c -Wall -I/usr/local/lib

all: main

main: main.o
    $(CC) main.o -o main -lwolfssl

main.o: main.c
    $(CC) $(CFLAGS) main.c</code></pre></div><p>Is there a step that I am missing? Why does this seem to always lead to stack smashing / seg faults?</p><p>Thanks for the help!</p>]]></description>
			<author><![CDATA[null@example.com (colin.foster)]]></author>
			<pubDate>Mon, 04 Jul 2016 20:35:29 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post2574.html#p2574</guid>
		</item>
	</channel>
</rss>
