Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Enabling OPENSSL_ALL on the ESP32 causes compile error related to WOLFSSL_SP_INT_NEGATIVE #6373

Closed
gojimmypi opened this issue May 3, 2023 · 1 comment · Fixed by #6374
Assignees
Labels

Comments

@gojimmypi
Copy link
Contributor

Contact Details

No response

Version

latest master

Description

Discovered during testing for #6028, the recent changes in #6287 introduced WOLFSSL_SP_INT_NEGATIVE handling in esp_mp_mul() are not specific to the ESP32-S3.

Currently when using #define OPENSSL_ALL in the user_settings.h for a ESP32-WROOM32, a compile error is encountered:

image

Reproduction steps

See any of the examples with #define OPENSSL_ALL in the user_settings.h for a ESP32-WROOM32.

Relevant log output

Run "c:\SysGCC\esp32\tools\ninja\1.10.2\ninja.exe " in directory "C:\workspace\wolfssl-gojimmypi\IDE\Espressif\ESP-IDF\examples\wolfssl_test\VisualGDB/../build/VisualGDB/Debug" on local computer
c:\SysGCC\esp32\tools\ninja\1.10.2\ninja.exe 
[1/9] Building C object esp-idf/wolfssl/CMakeFiles/__idf_wolfssl.dir/C_/workspace/wolfssl-gojimmypi/wolfcrypt/src/port/Espressif/esp32_mp.c.obj
FAILED: esp-idf/wolfssl/CMakeFiles/__idf_wolfssl.dir/C_/workspace/wolfssl-gojimmypi/wolfcrypt/src/port/Espressif/esp32_mp.c.obj 
C:\SysGCC\esp32\tools\xtensa-esp32-elf\esp-2022r1-11.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe  -Iconfig -I../../../components/wolfssl -IC:/workspace/wolfssl-gojimmypi/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/freertos/FreeRTOS-Kernel/include/freertos -IC:/workspace/wolfssl-gojimmypi -IC:/SysGCC/esp32/esp-idf/v5.0/components/newlib/platform_include -IC:/SysGCC/esp32/esp-idf/v5.0/components/freertos/FreeRTOS-Kernel/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/freertos/esp_additions/include/freertos -IC:/SysGCC/esp32/esp-idf/v5.0/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/freertos/esp_additions/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/esp_hw_support/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/esp_hw_support/include/soc -IC:/SysGCC/esp32/esp-idf/v5.0/components/esp_hw_support/include/soc/esp32 -IC:/SysGCC/esp32/esp-idf/v5.0/components/esp_hw_support/port/esp32/. -IC:/SysGCC/esp32/esp-idf/v5.0/components/esp_hw_support/port/esp32/private_include -IC:/SysGCC/esp32/esp-idf/v5.0/components/heap/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/log/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/soc/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/soc/esp32/. -IC:/SysGCC/esp32/esp-idf/v5.0/components/soc/esp32/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/hal/esp32/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/hal/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/hal/platform_port/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/esp_rom/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/esp_rom/include/esp32 -IC:/SysGCC/esp32/esp-idf/v5.0/components/esp_rom/esp32 -IC:/SysGCC/esp32/esp-idf/v5.0/components/esp_common/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/esp_system/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/esp_system/port/soc -IC:/SysGCC/esp32/esp-idf/v5.0/components/esp_system/port/include/private -IC:/SysGCC/esp32/esp-idf/v5.0/components/xtensa/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/xtensa/esp32/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/lwip/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/lwip/include/apps -IC:/SysGCC/esp32/esp-idf/v5.0/components/lwip/include/apps/sntp -IC:/SysGCC/esp32/esp-idf/v5.0/components/lwip/lwip/src/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/lwip/port/esp32/include -IC:/SysGCC/esp32/esp-idf/v5.0/components/lwip/port/esp32/include/arch -mlongcalls -Wno-frame-address  -DWOLFSSL_USER_SETTINGS -g -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -Og -fstack-protector -fmacro-prefix-map=C:/workspace/wolfssl-gojimmypi/IDE/Espressif/ESP-IDF/examples/wolfssl_test=. -fmacro-prefix-map=C:/SysGCC/esp32/esp-idf/v5.0=/IDF -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -DconfigENABLE_FREERTOS_DEBUG_OCDAWARE=1 -std=gnu17 -Wno-old-style-declaration -D_GNU_SOURCE -DIDF_VER=\"v5.0-dirty\" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS -MD -MT esp-idf/wolfssl/CMakeFiles/__idf_wolfssl.dir/C_/workspace/wolfssl-gojimmypi/wolfcrypt/src/port/Espressif/esp32_mp.c.obj -MF esp-idf\wolfssl\CMakeFiles\__idf_wolfssl.dir\C_\workspace\wolfssl-gojimmypi\wolfcrypt\src\port\Espressif\esp32_mp.c.obj.d -o esp-idf/wolfssl/CMakeFiles/__idf_wolfssl.dir/C_/workspace/wolfssl-gojimmypi/wolfcrypt/src/port/Espressif/esp32_mp.c.obj -c C:/workspace/wolfssl-gojimmypi/wolfcrypt/src/port/Espressif/esp32_mp.c
C:/workspace/wolfssl-gojimmypi/wolfcrypt/src/port/Espressif/esp32_mp.c: In function 'esp_mp_mul':
C:/workspace/wolfssl-gojimmypi/wolfcrypt/src/port/Espressif/esp32_mp.c:427:5: error: 'neg' undeclared (first use in this function)
  427 |     neg = mp_isneg(X) != mp_isneg(Y) ? 1 : 0;
      |     ^~~
C:/workspace/wolfssl-gojimmypi/wolfcrypt/src/port/Espressif/esp32_mp.c:427:5: note: each undeclared identifier is reported only once for each function it appears in
[2/9] Performing build step for 'bootloader'
[1/1] cmd.exe /C "cd /D C:\workspace\wolfssl-gojimmypi\IDE\Espressif\ESP-IDF\examples\wolfssl_test\build\VisualGDB\Debug\bootloader\esp-idf\esptool_py && python C:/SysGCC/esp32/esp-idf/v5.0/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 C:/workspace/wolfssl-gojimmypi/IDE/Espressif/ESP-IDF/examples/wolfssl_test/build/VisualGDB/Debug/bootloader/bootloader.bin"
Bootloader binary size 0x65d0 bytes. 0xa30 bytes (9%) free.
ninja: build stopped: subcommand failed.
-------------------------------------------------------------
Command exited with code 1
Executable: c:\SysGCC\esp32\tools\ninja\1.10.2\ninja.exe
Arguments: 
Directory: C:\workspace\wolfssl-gojimmypi\IDE\Espressif\ESP-IDF\examples\wolfssl_test\VisualGDB/../build/VisualGDB/Debug
Command-line action failed

========== Project Build Summary ==========
    wolfssl_test-IDF_v5_ESP32  built in 00:00
========== Build: 0 Succeeded, 1 Failed, 0 Skipped ==========
@gojimmypi
Copy link
Contributor Author

gojimmypi commented May 3, 2023

Reminder that the ESP32-S3 does not support AES-192 at this time as noted in #5948 (comment)

This setting may needed to turn on WOLFSSL_SP_INT_NEGATIVE with #define OPENSSL_ALL:

#include <sdkconfig.h>
#if defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_AES)
    /* AES192 is not supported on the ESP32-S3 HW at this time */
    #define NO_AES_192
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant