<?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 — Program can't find WolfSSL headers in ESP-IDF]]></title>
		<link>https://www.wolfssl.com/forums/topic2207-program-cant-find-wolfssl-headers-in-espidf.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic2207.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Program can't find WolfSSL headers in ESP-IDF.]]></description>
		<lastBuildDate>Tue, 29 Oct 2024 15:30:14 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Program can't find WolfSSL headers in ESP-IDF]]></title>
			<link>https://www.wolfssl.com/forums/post7982.html#p7982</link>
			<description><![CDATA[<p>Hello Gabriel,</p><p>That&#039;s excellent! Glad you have it working.</p><p>Note that wolfSSL has many different configuration options to tune for performance, size, etc. See the docs:</p><p><a href="https://www.wolfssl.com/documentation/manuals/wolfssl/chapter02.html">https://www.wolfssl.com/documentation/m … ter02.html</a></p><p>If you decide to include OpenSSL in your analysis, there&#039;s a wolfSSL compatibility layer:</p><p><a href="https://www.wolfssl.com/documentation/manuals/wolfssl/chapter13.html">https://www.wolfssl.com/documentation/m … ter13.html</a></p><p>Best of luck with your project! Please let me know if I can help in any way. </p><p>Jim</p>]]></description>
			<author><![CDATA[null@example.com (gojimmypi)]]></author>
			<pubDate>Tue, 29 Oct 2024 15:30:14 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7982.html#p7982</guid>
		</item>
		<item>
			<title><![CDATA[Re: Program can't find WolfSSL headers in ESP-IDF]]></title>
			<link>https://www.wolfssl.com/forums/post7981.html#p7981</link>
			<description><![CDATA[<div class="quotebox"><cite>gojimmypi wrote:</cite><blockquote><p>Please let me know how that goes. <br />Jim</p></blockquote></div><p>Hello Jim,</p><p>It worked!!! I&#039;ve addressed those errors and now my project builds fine.</p><p>Thank you very very much for your help!</p><p>Gabriel</p>]]></description>
			<author><![CDATA[null@example.com (gabriel)]]></author>
			<pubDate>Tue, 29 Oct 2024 13:59:16 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7981.html#p7981</guid>
		</item>
		<item>
			<title><![CDATA[Re: Program can't find WolfSSL headers in ESP-IDF]]></title>
			<link>https://www.wolfssl.com/forums/post7980.html#p7980</link>
			<description><![CDATA[<p>Hello Gabriel,</p><p>Thank you for providing the source code and additional details.</p><p>Now that I see what you are doing, perhaps this will help.</p><p>I placed your code in my `wolfssl-gojimmypi\IDE\Espressif\ESP-IDF\examples`directory so that wolfSSL source code would be found in a parent directory. Alternatively, the `WOLFSSL_ROOT` environment variable can be set, as described above. From your log, you probably don&#039;t need to move your code.</p><p>Please try adding these two lines to the `CryptoAPI` component `CmakeLists.txt` in `esp32-crypto-api\components\CryptoAPI`:</p><div class="codebox"><pre><code>set(CMAKE_C_FLAGS &quot;${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS&quot;)
set(CMAKE_CXX_FLAGS &quot;${CMAKE_CXX_FLAGS} -DWOLFSSL_USER_SETTINGS&quot;)</code></pre></div><p>There are still a few compile errors, indirectly related to wolfSSL that can be readily addressed, but otherwise successful:</p><br /><div class="codebox"><pre><code>Error    enumeration value &#039;RSA&#039; not handled in switch wolfssl_IDF_v5.2_ESP32 C:\workspace\wolfssl-gojimmypi\IDE\Espressif\ESP-IDF\examples\esp32-crypto-api\components\CryptoAPI\src\WolfsslModule.cpp 98  
Error    &#039;ret&#039; may be used uninitialized               wolfssl_IDF_v5.2_ESP32 C:\workspace\wolfssl-gojimmypi\IDE\Espressif\ESP-IDF\examples\esp32-crypto-api\components\CryptoAPI\src\WolfsslModule.cpp 399 
Error    &#039;cert_type&#039; may be used uninitialized         wolfssl_IDF_v5.2_ESP32 C:\workspace\wolfssl-gojimmypi\IDE\Espressif\ESP-IDF\examples\esp32-crypto-api\components\CryptoAPI\src\WolfsslModule.cpp 488 </code></pre></div><p>The message you asked about is informative and otherwise ok:</p><div class="codebox"><pre><code>C:/Users/myuser/Documents/CryptoAPI/components/wolfssl is not within IDF_PATH.</code></pre></div><p>It only indicates that the wolfSSL is not an ESP-IDF component.</p><p>Please let me know how that goes. </p><p>Best Regards,</p><p>Jim</p>]]></description>
			<author><![CDATA[null@example.com (gojimmypi)]]></author>
			<pubDate>Tue, 29 Oct 2024 03:24:28 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7980.html#p7980</guid>
		</item>
		<item>
			<title><![CDATA[Re: Program can't find WolfSSL headers in ESP-IDF]]></title>
			<link>https://www.wolfssl.com/forums/post7979.html#p7979</link>
			<description><![CDATA[<div class="quotebox"><cite>gojimmypi wrote:</cite><blockquote><p>Please let me know how it goes. Thank you.</p></blockquote></div><p>Hello Jim, and thank you very much for your quick answer!</p><p>This is the source code of my project: <a href="https://github.com/siegjor/esp32-crypto-api/tree/main">https://github.com/siegjor/esp32-crypto-api/tree/main</a></p><p>Something that I forgot to say earlier, but that it might be relevant, is that I&#039;m trying to develop a component, called CryptoAPI, and it&#039;s in this component that I&#039;ll use wolfssl (and as you notice from the source code, other libraries too). My main.cpp file will only contain a include for my CryptoAPI.h file, which includes the WolfsslModule.h file, which includes all of the wolfssl headers I need to use.</p><p>Now for the fixes you suggested me:</p><div class="quotebox"><cite>gojimmypi wrote:</cite><blockquote><p>`WOLFSSL_USER_SETTINGS` needs to be defined. See the first line in the `template/main/CMakeLists.txt</p></blockquote></div><p>I&#039;ve noticed that it WOLFSSL_USER_SETTINGS was already being defined in &quot;esp32-crypto-api/components<br />/wolfssl/CMakeLists.txt&quot;, so I imagined it was ok. I&#039;ve done as you said and defined it in esp32-crypto-api/main/CMakeLists.txt, but it still didn&#039;t work.</p><div class="quotebox"><cite>gojimmypi wrote:</cite><blockquote><p>2) It is important to include the wolfssl/wolfcrypt/settings.h files before any other wolfSSL includes.</p></blockquote></div><p>As you can see in &quot;esp32-crypto-api/components/CryptoAPI/include/WolfsslModule.h&quot;, I&#039;m already doing that.</p><div class="quotebox"><cite>gojimmypi wrote:</cite><blockquote><p>If you try these steps and the file still cannot be found, please reply with the CMake output</p></blockquote></div><p>I&#039;ve found some of the lines you mentioned:</p><div class="codebox"><pre><code>-- ************************************************************************************************
-- wolfssl component config:
-- ************************************************************************************************
-- Starting FIND_WOLFSSL_DIRECTORY: C:/wolfssl
-- Parameter found for FIND_WOLFSSL_DIRECTORY
-- Setting wolfSSL search directory to: C:/wolfssl
-- Found wolfSSL source code via setting: C:/wolfssl
-- Found WOLFSSL_ROOT via CMake specification.
-- Confirmed wolfssl directory at: C:/wolfssl
-- WOLFSSL_EXTRA_PROJECT_DIR = C:/wolfssl/src/
-- This COMPONENT_SRCDIRS = &quot;C:/wolfssl/src/&quot;;&quot;C:/wolfssl/wolfcrypt/src&quot;;&quot;C:/wolfssl/wolfcrypt/src/port/Espressif&quot;;&quot;C:/wolfssl/wolfcrypt/src/port/Espressif/esp_crt_bundle&quot;;&quot;C:/wolfssl/wolfcrypt/src/port/atmel&quot;;&quot;C:/wolfssl/src/&quot;
-- Added definition for user_settings.h: -DWOLFSSL_USER_SETTINGS_DIR=&quot;C://Users//myuser//Documents//CryptoAPI//components//wolfssl//include//user_settings.h&quot;
-- IDF_PATH = C:\Espressif\frameworks\esp-idf-v5.3.1
-- PROJECT_SOURCE_DIR = C:/Espressif/frameworks/esp-idf-v5.3.1
-- EXCLUDE_ASM = C:/Users/myuser/Documents/CryptoAPI;C:/wolfssl/wolfcrypt/src/aes_asm.S;C:/wolfssl/wolfcrypt/src/aes_gcm_asm.S;C:/wolfssl/wolfcrypt/src/aes_gcm_x86_asm.S;C:/wolfssl/wolfcrypt/src/aes_xts_asm.S;C:/wolfssl/wolfcrypt/src/chacha_asm.S;C:/wolfssl/wolfcrypt/src/fe_x25519_asm.S;C:/wolfssl/wolfcrypt/src/poly1305_asm.S;C:/wolfssl/wolfcrypt/src/sha256_asm.S;C:/wolfssl/wolfcrypt/src/sha3_asm.S;C:/wolfssl/wolfcrypt/src/sha512_asm.S;C:/wolfssl/wolfcrypt/src/sm3_asm.S;C:/wolfssl/wolfcrypt/src/sp_sm2_x86_64_asm.S;C:/wolfssl/wolfcrypt/src/sp_x86_64_asm.S;C:/wolfssl/wolfcrypt/src/wc_kyber_asm.S
--
-- Using developer repo ./components/wolfssl in CMAKE_HOME_DIRECTORY = C:/Users/Brist/Documents/TCC/codigo/esp-idf-code/CryptoAPI
--
-- ************************************************************************************************
-- Using existing wolfSSL user_settings.h in C:/Users/myuser/Documents/CryptoAPI/components/wolfssl/include/user_settings.h
-- Using existing wolfSSL config.h           C:/Users/myuser/Documents/CryptoAPI/components/wolfssl/include/config.h</code></pre></div><p>There&#039;s however a line before these ones that maybe can have something to do with this problem?</p><div class="codebox"><pre><code>-- Begin wolfssl
-- C:/Users/myuser/Documents/CryptoAPI/components/wolfssl is not within IDF_PATH. (&lt;-- this line)</code></pre></div><p>I&#039;ve also already set a WOLFSSL_ROOT env variable pointing to &quot;C:/wolfssl&quot;. And while I have yet to try your approach of putting my project within the wolfssl directory structure, I did try adding wolfssl as a managed component and also installing it via the setup_win.bat, but none of it worked, as both of these options resulted in the same problem I&#039;m facing now.</p><p>Some other information that might be relevant:<br />- I&#039;m using vscode, and I setup this project through the espressif extension UI (&quot;create new project&quot;, etc.);<br />- Before running <em>idf.py set-target esp32</em> (or after deleting the build folder), the wolfssl header files in WolfsslModule.h aren&#039;t found (&quot;cannot open source file <em>wolfssl/wolfcrypt/settings.h</em>&quot;);<br />- After running the command above and generating the build folder, the IDE apparently finds those headers, but the problem of undefined identifiers arises.</p><p>If there&#039;s any other useful info that I could provide, please let me know.</p><p>Thank you very much for your help, I&#039;ll keep trying to make it work somehow while I wait for your reply.</p><p>Gabriel</p>]]></description>
			<author><![CDATA[null@example.com (gabriel)]]></author>
			<pubDate>Tue, 29 Oct 2024 01:04:30 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7979.html#p7979</guid>
		</item>
		<item>
			<title><![CDATA[Re: Program can't find WolfSSL headers in ESP-IDF]]></title>
			<link>https://www.wolfssl.com/forums/post7978.html#p7978</link>
			<description><![CDATA[<p>Hello gabriel and thank you for your interest in wolfSSL.</p><p>It does appear that your local project component directory is correctly structured. </p><p>Without seeing your source code, it is difficult to say exactly what the root cause of the problem may be, but I do have some suggestions for you.</p><p>I started with the bare-bones Espressif template example here:</p><p><a href="https://github.com/wolfSSL/wolfssl/tree/master/IDE/Espressif/ESP-IDF/examples/template">https://github.com/wolfSSL/wolfssl/tree … s/template</a></p><p>Using your example of&nbsp; needing`wc_InitRsaKey()`, the `ed25519.h` file needs to be included. </p><p>The two most important things to remember:</p><p>1) `WOLFSSL_USER_SETTINGS` needs to be defined. See the first line in the `template/main/CMakeLists.txt`:</p><div class="codebox"><pre><code>set(CMAKE_C_FLAGS &quot;${CMAKE_C_FLAGS} -DWOLFSSL_USER_SETTINGS&quot;)</code></pre></div><p>2) It is important to include the wolfssl/wolfcrypt/settings.h files before any other wolfSSL includes.</p><br /><div class="codebox"><pre><code>#ifdef WOLFSSL_USER_SETTINGS
    #include &lt;wolfssl/wolfcrypt/settings.h&gt;
    #ifndef WOLFSSL_ESPIDF
        #warning &quot;Problem with wolfSSL user_settings.&quot;
        #warning &quot;Check components/wolfssl/include&quot;
    #endif
    #include &lt;wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h&gt;
#else
    /* Define WOLFSSL_USER_SETTINGS project wide for settings.h to include   */
    /* wolfSSL user settings in ./components/wolfssl/include/user_settings.h */
    #error &quot;Missing WOLFSSL_USER_SETTINGS in CMakeLists or Makefile:\
    CFLAGS +=-DWOLFSSL_USER_SETTINGS&quot;
#endif

#include &lt;wolfssl/wolfcrypt/ed25519.h&gt;</code></pre></div><p>Then I added these two lines to `void app_main(void)` int `main.c`:</p><br /><div class="codebox"><pre><code>    ed25519_key key;
    wc_ed25519_init(&amp;key);</code></pre></div><p>I was able to confirm the template example would compile.</p><p>If you try these steps and the file still cannot be found, please reply with the CMake output, in particular the sections that include the `WOLFSSL_ROOT` keyword. Ensure you are using a recent CMakeLists.txt, such as the one on the example template `components/wolfssl` directory. There should be something like this in the log:</p><div class="codebox"><pre><code>-- Starting FIND_WOLFSSL_DIRECTORY: 
-- The WOLFSSL_ROOT environment variable is not set. Searching...
-- WOLFSSL_ROOT found in sdkconfig/KConfig: ~/workspace/wolfssl
-- CONFIG_CUSTOM_SETTING_WOLFSSL_ROOT sdkconfig setting = ~/workspace/wolfssl
-- WOLFSSL_ROOT Variable defined, but source code not found: C:/Users/&lt;user&gt;/workspace/wolfssl
-- CMAKE_CURRENT_SOURCE_DIR = .</code></pre></div><p>After the lines of search, there should be an indication of the wolfSSL directory found:</p><div class="codebox"><pre><code>-- Found wolfssl in CURRENT_SEARCH_DIR = C:/workspace/wolfssl-&lt;user&gt;
-- Found WOLFSSL_ROOT via CMake specification.</code></pre></div><p>You may consider setting an environment variable `WOLFSSL_ROOT` that points your wolfSSL source code directory if your directory structure is such that wolfSSL is not in a parent directory from your project. Moving your project into the wolfSSL directory structure is also an option.</p><p>There&#039;s additional information and a link to a YouTube video on Getting Started with wolfSSL on the ESP32 here:</p><p><a href="https://github.com/wolfSSL/wolfssl/tree/master/IDE/Espressif">https://github.com/wolfSSL/wolfssl/tree … /Espressif</a></p><p>If these tips don&#039;t help, it would be great if you could supply a small reproducer app sample so I can further assist you.</p><p>Please let me know how it goes. Thank you.</p><p>Jim</p>]]></description>
			<author><![CDATA[null@example.com (gojimmypi)]]></author>
			<pubDate>Mon, 28 Oct 2024 16:34:37 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7978.html#p7978</guid>
		</item>
		<item>
			<title><![CDATA[Program can't find WolfSSL headers in ESP-IDF]]></title>
			<link>https://www.wolfssl.com/forums/post7976.html#p7976</link>
			<description><![CDATA[<p>Hello. I&#039;ve been using wolfssl in Arduino IDE with my ESP32, but then I found out that I couldn&#039;t enable hardware acceleration using Arduino IDE (I tried, but there was a mising freertos.h error when compiling). Then I decided to switch to ESP-IDF, and so I ported my code to this environment.</p><p>I&#039;ve added wolfssl as a component to my project, in the following folder structure:</p><p>my_project<br />|_components<br />&nbsp; &nbsp;|_wolfssl<br />&nbsp; &nbsp; &nbsp; |_include<br />&nbsp; &nbsp; &nbsp; |&nbsp; |_user_settings.h<br />&nbsp; &nbsp; &nbsp; |_CMakeLists.txt</p><p>The wolfssl source code is located in C:/, and I added it as an enviroment variable so I could reference in the CMakeLists file, as <a href="https://github.com/wolfSSL/wolfssl/tree/master/IDE/Espressif/ESP-IDF#standard-local-component">https://github.com/wolfSSL/wolfssl/tree … -component</a> tells us to. I&#039;ve also defined the macros I need in user_settings.h, which are:</p><div class="codebox"><pre><code>#define WOLFSSL_SHAKE256
#define WOLFSSL_CUSTOM_CURVES
#define WOLFSSL_KEY_GEN
#define ECC256
#define HAVE_ECC_BRAINPOOL
#define HAVE_ED448</code></pre></div><p>However, when I build my project, I get many errors of undefined identifiers, such as &quot;identifier &#039;wc_ed25519_init&#039; is undefined&quot;, even though I&#039;ve included all necessary headers, and even though CTRL + Clicking in those functions/variables successfully navigates to the respective file. Also, some functions are found, such as &quot;wc_InitRsaKey&quot;.</p><p>Is there something I&#039;m missing here? I&#039;ve been stuck on this for the last 3 days and any help would be hugely appreciated.</p>]]></description>
			<author><![CDATA[null@example.com (gabriel)]]></author>
			<pubDate>Mon, 28 Oct 2024 00:45:42 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post7976.html#p7976</guid>
		</item>
	</channel>
</rss>
