mbedtls and littlefs on a STM32L4 #37329
Unanswered
jhfigueiredo
asked this question in
Q&A
Replies: 1 comment
-
Unfortunately, I don't think the file APIs that Zephyr provides are going to be adequate for what Mbed TLS needs. My suggestion would be to use the Zephyr file APIs yourself to load the certificate into a buffer, and ask Mbed TLS to parse that. The alternative would be to either provide a wrapper for the functions needed (to enable MBEDTLS_FS_IO), but I suspect the first will probably be easier. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm quite new to Zephyr so this might just be some missing configuration or lack of knowledge.
The objective is to load a x509 certificate from the filesystem (littlefs) using the mbedtls mbedtls_x509_crt_parse_file function. For that I need to include MBEDTLS_FS_IO. But when I do include this configuration it includes <dirent.h> which then returns the following error:
In file included from /home/jhf/zephyr-sdk-0.12.4/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/dirent.h:39,
from /home/jhf/zephyrproject/modules/crypto/mbedtls/mbedtls/library/x509_crt.c:78:
/home/jhf/zephyr-sdk-0.12.4/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/sys/dirent.h:10:2: error: #error "<dirent.h> not supported"
10 | #error "<dirent.h> not supported"
| ^~~~~
I have a work around but would imply changes to the mbedtls original code, which I really would try to avoid.
Any help would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions