26

(27 replies, posted in wolfSSL)

AdamHeavens wrote:

Hi gojimmypi,

Are there any plans to have an official version published by wolfSSL in the PlatformIO registry?

I'd personally like to see an official version. So far, there's been relatively little demand, particularly considering how well documented and polished the ESP-IDF is these days. The best way is to voice the desire:  support@wolfssl.com

Cheers

27

(27 replies, posted in wolfSSL)

Hi Adam -

That's excellent you've made progress!

I have added the following to platformio.ini build flags

I suggest putting them in the `user_settings.h` instead:

#define SINGLE_THREADED
#define HAVE_ECC
#define WOLFSSL_SMALL_STACK
#define WOLFSSL_ESPIDF
#define WOLFSSL_ESP32
#define OPENSSL_EXTRA
#define OPENSSL_ALL
#define HAVE_TLS_EXTENSIONS
#define HAVE_SUPPORTED_CURVES

I've updated my sample `user_settings.h` here:

https://github.com/gojimmypi/wolfssl/bl … ings.h#L39

I get the following error when building
#error directive: "No encryption algorithm available for default ticket encryption."


The library for wolfSSL is highly tunable. See the documentation for details on the options available:

https://www.wolfssl.com/documentation/m … ave_aesgcm

One possible solution to the error you are seeing is to turn on AESGCM in `user_settings.h` like this:

#define HAVE_AESGCM

Please let me know if that works for you.

Cheers!

28

(27 replies, posted in wolfSSL)

Hi Adam -

I briefly took a look at using PlatformIO and the Arduino framework for an ESP32 wolfSSL project. It's an interesting environment.

The first thing that should be emphasized is that the

lib_deps = 
    onelife/wolfssl@^5.5.4

... and located here: https://registry.platformio.org/librari … fe/wolfssl

...is *not* an official wolfSSL source code (and in fact rather stale), and is *not* maintained by wolfSSL staff.

Still, I understand there's no other alternative there... so I've taken a look at why it does not work. I was able to quickly reproduce your error. A variety of relatively minor changes are needed - mostly file deletions & a couple of edits. I've summarized what it took here:

https://github.com/gojimmypi/wolfssl/tr … PlatformIO

Here's the included README.md for future reference & I've attached the `user_settings.h` that I used:

This is a supplementary suggestion to [this forum question] regarding PlatformIO and the wolfSSL library.

Here are some tips to get it working:

Given a VS Code `[project]` directory, these changes are needed:

## Edit `[project]\.pio\libdeps\esp32dev\wolfssl\src\wolfcrypt\src`

delete all the `*.i` files

delete these files:
`sp_arm32.c`
`sp_arm64.c`
`sp_armthumb.c`
`sp_c32.c`
`sp_c64.c`
`sp_cortexm.c`
`sp_dsp32.c`
`sp_x86_64.c`
`sp_cortexm.c`

(do NOT delete `sp_int.c`)

## Edit `[project]\.pio\libdeps\esp32dev\wolfssl\src\wolfcrypt\src\port`

Delete all of the directories EXCEPT `Atmel` and `Espressif`


## Edit `[project]\.pio\libdeps\esp32dev\wolfssl\src\wolfcrypt\`

Delete `test` and `benchmark` directories


## Edit `[project]\.pio\libdeps\esp32dev\wolfssl\src\user_settings.h`

See the enclosed [user_settings.h](./user_settings.h) - copy it to:

`[project]\.pio\libdeps\esp32dev\wolfssl\src\user_settings.h`


## Edit `[project]\.pio\libdeps\esp32dev\wolfssl\src\wolfssl\wolfcrypt\wolf_crypt_settings.h`

Comment out the `#define FREERTOS` in the `#if defined(WOLFSSL_ESPIDF)` section, on or around line 333.

```c
#if defined(WOLFSSL_ESPIDF)
    /* #define FREERTOS */
```

Please give that a try and let me know how it goes.

Cheers

*edit: I've been unable to attach a file. Please see the one at the GitHub link, above.

29

(27 replies, posted in wolfSSL)

Hi Adam -

I'm not familiar with the PlatformIO method of building a project. I definitely recommend using the ESP-IDF if at all possible. There are wolfSSL examples here:

https://github.com/wolfSSL/wolfssl/tree … /Espressif

There's also the capability of using Managed Components from the ESP Registry:

https://www.wolfssl.com/wolfssl-now-ava … -registry/

That said, I do think the Arduino projects should at least work. If there's no mechanism for including or excluding files in PlatformIO, there's always the brute force method of simply deleting all the files you don't want to be included (e.g. all the assembly language suffix "*.s" files in wolfcrypt/src)

Additionally, it's really best to use a wolfssl `user_settings.h` file. It gets included by pretty much every wolfssl source file (via wolfcrypt/settings.h) & controls which features are compiled in - such as your missing wc_GenerateSeed().

I suppose it should in theory also work to add "-D" build flags. See the example template user_settings.h:

https://github.com/wolfSSL/wolfssl/blob … settings.h

In particular, you will at least need `-DWOLFSSL_ESPIDF` and `-DWOLFSSL_ESP32` defined project-wide.

If you choose to use the user_settings.h file, I'd probably drop it in place with settings.h in wolfssl/wolfcrypt. When using the ESP-IDF instead, the file belongs in the components/wolfssl/include directory.

If you choose to use the ESP-IDF (you can still edit with VS Code) - I'll be able to help you much more. I'd still like to get the PlatformIO working, but I'll need to spend some time on that. If you can point to your example online, or something similar, that would be helpful to get me started.

Cheers

30

(27 replies, posted in wolfSSL)

Hi Adam,

The first error:

unknown register name 'r8' in 'asm'

is typically caused at compile time when *all* the files in wolfcrypt/src are attempted to be compiled. There are some assembly files there that are not appropriate on the Xtensa architecture of the ESP32-S3.  Either explicitly listing files, or list exclusions would likely resolve this. I've been working on an ESP8288 makefile that addresses this topic:

https://github.com/gojimmypi/wolfssl/bl … mponent.mk

There's also an example of CMake excluding files those files here:

https://github.com/wolfSSL/wolfssl/blob … s.txt#L210

The next error, possibly also related:

#error "you need to write an os specific wc_GenerateSeed() here"

typically means the compiler does not "know" that the target CPU for wolfSSL code is for the ESP32. This is often a macro definition in the user_settings.h file.

I've been meaning to give more attention to the Arduino platform. Can you provide additional details on your makefiles and the user_settings.h that you are using?

There's a GitHub issue regarding Arduino support:

https://github.com/wolfSSL/wolfssl/issues/6360

Thanks for your interest! I look forward to learning more about your project.