<?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 — Error using wc_RsaPublicKeyDecode]]></title>
		<link>https://www.wolfssl.com/forums/topic1267-error-using-wcrsapublickeydecode.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic1267.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Error using wc_RsaPublicKeyDecode.]]></description>
		<lastBuildDate>Tue, 02 Oct 2018 17:09:34 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Error using wc_RsaPublicKeyDecode]]></title>
			<link>https://www.wolfssl.com/forums/post4215.html#p4215</link>
			<description><![CDATA[<p>kjjy7,</p><p>Thank you for providing details on the effort. Can you share the contents of the parse_jason data? I am guessing there may be extra encoding in there and you may need to set the &quot;idx&quot; variable to the appropriate offset for start of the RsaKey (if in fact that is an RSA key and not some other key). If you can share the parse_jason string that this error results from we can gladly run some tests on our end to see what the issue might be.</p><p>To result in even quicker turn-around if you can send us a test.c application and all relevant headers that we can compile and execute to reproduce this we&#039;ll get you results asap.</p><p>- K</p>]]></description>
			<author><![CDATA[null@example.com (Kaleb J. Himes)]]></author>
			<pubDate>Tue, 02 Oct 2018 17:09:34 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post4215.html#p4215</guid>
		</item>
		<item>
			<title><![CDATA[Re: Error using wc_RsaPublicKeyDecode]]></title>
			<link>https://www.wolfssl.com/forums/post4210.html#p4210</link>
			<description><![CDATA[<p>I Send you email... </p><p>Please answer to me....</p>]]></description>
			<author><![CDATA[null@example.com (kjjy7)]]></author>
			<pubDate>Sun, 30 Sep 2018 02:29:12 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post4210.html#p4210</guid>
		</item>
		<item>
			<title><![CDATA[Re: Error using wc_RsaPublicKeyDecode]]></title>
			<link>https://www.wolfssl.com/forums/post4207.html#p4207</link>
			<description><![CDATA[<p>kjjy7,</p><p>Please share what it is you are working on. Thanks.</p><p>- K</p>]]></description>
			<author><![CDATA[null@example.com (Kaleb J. Himes)]]></author>
			<pubDate>Fri, 28 Sep 2018 15:19:12 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post4207.html#p4207</guid>
		</item>
		<item>
			<title><![CDATA[Error using wc_RsaPublicKeyDecode]]></title>
			<link>https://www.wolfssl.com/forums/post4205.html#p4205</link>
			<description><![CDATA[<p>To use Signiture verification, I make these code.</p><p>Error happened while using wc_RsaPublicKeyDecode</p><p>that function is seem to get rsakey info from string.</p><br /><p>&nbsp; &nbsp; ret = wc_Sha256Hash((const byte*)token, strlen(token), ucSha256Hashed);<br />&nbsp; &nbsp; if(ret != 0)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; printf(&quot;Error wc_Sha256Hash ret = %d&quot;, ret);<br />&nbsp; &nbsp; &nbsp; &nbsp; return -25;<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; RsaKey rsaKey;<br />&nbsp; &nbsp; word32 idx = 0;</p><p>&nbsp; &nbsp; XMEMSET(&amp;rsaKey, 0, sizeof(rsaKey));</p><p>&nbsp; &nbsp; word32 pksize = (word32)wolfSSL_X509_get_pubkey( parse_jason-&gt;x509Cert[0] )-&gt;pkey_sz;<br />&nbsp; &nbsp; const byte * pubkey = (const unsigned char*) wolfSSL_X509_get_pubkey( parse_jason-&gt;x509Cert[0] )-&gt;pkey.ptr;</p><p>&nbsp; &nbsp; if(pubkey == NULL)<br />&nbsp; &nbsp; &nbsp; &nbsp; printf(&quot;pubkey is NULL&quot;);<br />&nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; printf(&quot;pubkey is not NULL&quot;);</p><p>&nbsp; &nbsp; PLOG(&quot;%s, pksize %d&quot;, __func__, pksize);</p><p>&nbsp; &nbsp; ret = wc_InitRsaKey(&amp;rsaKey, NULL);<br />&nbsp; &nbsp; if(ret != 0)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; printf(&quot;Error wc_InitRsaKey ret = %d&quot;, ret);<br />&nbsp; &nbsp; &nbsp; &nbsp; return -25;<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; ret = wc_RsaPublicKeyDecode(pubkey, &amp;idx, &amp;rsaKey, pksize);&nbsp; &nbsp;&lt;-- Error Msg Occurred<br />&nbsp; &nbsp; PLOG(&quot;wc_RsaPublicKeyDecode ret = %d&quot;, ret);<br />&nbsp; &nbsp; if (ret != 0)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; // error parsing public key <br />&nbsp; &nbsp; &nbsp; &nbsp; memset( err_string, 0x00, sizeof(err_string) );&nbsp; &nbsp; &nbsp; &nbsp;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; printf(&quot;%s failed ! wc_RsaPublicKeyDecode error %d&quot;, __func__, ret);<br />&nbsp; &nbsp; &nbsp; &nbsp; return -28;<br />&nbsp; &nbsp; } else {<br />&nbsp; &nbsp; &nbsp; &nbsp; printf(&quot;%s success ! wc_RsaPublicKeyDecode success&quot;, __func__);<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; ret = wc_SignatureVerify(WC_HASH_TYPE_SHA256, WC_SIGNATURE_TYPE_RSA_W_ENC,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (const byte*)ucSha256Hashed, sizeof(ucSha256Hashed),<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (const byte*)ucSignatureBase64decoded, nLengthSigDecoded,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp;rsaKey, 300);</p><p>&nbsp; &nbsp; free(token);</p><p>&nbsp; &nbsp; free (ucSignatureBase64decoded);</p><p>&nbsp; &nbsp; wc_FreeRsaKey( &amp;rsaKey );</p><p>Error Message is ......</p><p>wc_Sha256Hash ret = 0<br />pubkey is not NULL<br />check_signature_verification, pksize 270<br />wc_InitRsaKey ret = 0</p><p>then</p><p>Process 1110071 (-) terminated SIGSEGV code=1 fltno=11 ip=0000000011b538d8(/usr/lib/libwolfssl.so.12@wc_DhSetKey+0x0000000000000edc) mapaddr=000000000001c8d8. ref=10bc352000000000</p><p>could you answer why this error happened? </p><p>wait your answer....</p><p>thanks..</p>]]></description>
			<author><![CDATA[null@example.com (kjjy7)]]></author>
			<pubDate>Fri, 28 Sep 2018 07:33:26 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post4205.html#p4205</guid>
		</item>
	</channel>
</rss>
