Skip to content

[Bug]: Espressif SHA224 Fails wolfssl_test #6059

@gojimmypi

Description

@gojimmypi

Contact Details

[email protected]

Version

Latest master branch

Description

The Espressif ESP32 wolfSSL Crypt Test Example fails when SHA224 is enabled.

Reproduction steps

Add #define WOLFSSL_SHA224 to the default user_settings.h used by the installed wolfSSL component (disabled by default) and observe failure message: SHA-224 test failed! error = -2207.

See wolfcrypt/test/test.c on or about line 2739:

image

I found this while working on #5948

Relevant log output

ets Jun  8 2016 00:22:57

rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:7000
load:0x40078000,len:15452
ho 0 tail 12 room 4
load:0x40080400,len:3840
entry 0x4008064c
I (28) boot: ESP-IDF v5.0-dirty 2nd stage bootloader
I (28) boot: compile time 09:40:20
I (28) boot: chip revision: v1.0
I (31) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (38) boot.esp32: SPI Speed      : 40MHz
I (43) boot.esp32: SPI Mode       : DIO
I (47) boot.esp32: SPI Flash Size : 2MB
I (52) boot: Enabling RNG early entropy source...
I (57) boot: Partition Table:
I (61) boot: ## Label            Usage          Type ST Offset   Length
I (68) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (76) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (83) boot:  2 factory          factory app      00 00 00010000 00177000
I (91) boot: End of partition table
I (95) boot_comm: chip revision: 1, min. application chip revision: 0
I (102) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=167d0h ( 92112) map
I (144) esp_image: segment 1: paddr=000267f8 vaddr=3ffb0000 size=027d0h ( 10192) load
I (148) esp_image: segment 2: paddr=00028fd0 vaddr=40080000 size=07048h ( 28744) load
I (162) esp_image: segment 3: paddr=00030020 vaddr=400d0020 size=42ed8h (274136) map
I (261) esp_image: segment 4: paddr=00072f00 vaddr=40087048 size=04bd4h ( 19412) load
I (269) esp_image: segment 5: paddr=00077adc vaddr=50000000 size=00010h (    16) load
I (275) boot: Loaded app from partition at offset 0x10000
I (275) boot: Disabling RNG early entropy source...
I (289) cpu_start: Pro cpu up.
I (290) cpu_start: Starting app cpu, entry point is 0x4008112c
I (277) cpu_start: App cpu up.
I (304) cpu_start: Pro cpu start user code
I (304) cpu_start: cpu freq: 160000000 Hz
I (304) cpu_start: Application information:
I (309) cpu_start: Project name:     wolfssl_test
I (314) cpu_start: App version:      v5.5.4-stable-221-gc68c039b1-di
I (321) cpu_start: Compile time:     Feb  5 2023 09:40:01
I (327) cpu_start: ELF file SHA256:  6b8c0534d16c2ad1...
I (333) cpu_start: ESP-IDF:          v5.0-dirty
I (339) heap_init: Initializing. RAM available for dynamic allocation:
I (346) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (352) heap_init: At 3FFB30E0 len 0002CF20 (179 KiB): DRAM
I (358) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (364) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (371) heap_init: At 4008BC1C len 000143E4 (80 KiB): IRAM
I (378) spi_flash: detected chip: generic
I (382) spi_flash: flash io: dio
W (386) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (400) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (409) wolfssl_test: --------------------------------------------------------
I (419) wolfssl_test: --------------------------------------------------------
I (429) wolfssl_test: ---------------------- BEGIN MAIN ----------------------
I (429) wolfssl_test: --------------------------------------------------------
I (439) wolfssl_test: --------------------------------------------------------
I (449) wolfssl_test: CONFIG_IDF_TARGET = esp32
I (449) wolfssl_test: LIBWOLFSSL_VERSION_STRING = 5.5.4
I (459) wolfssl_test: LIBWOLFSSL_VERSION_GIT_HASH = c68c039b188c9416af2940805d1d4b528b583e3b
I (469) wolfssl_test: LIBWOLFSSL_VERSION_GIT_SHORT_HASH = c68c039b1
I (479) wolfssl_test: LIBWOLFSSL_VERSION_GIT_HASH_DATE = 'Thu Feb 2 10:00:35 2023 -0800'
I (489) wolfssl_test: CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ = 160 MHz
I (489) wolfssl_test: Xthal_have_ccount = 1
I (499) wolfssl_test: Stack HWM: 53664

I (499) wolfssl_test: ESP32WROOM32_CRYPT is enabled.
------------------------------------------------------------------------------
 wolfSSL version 5.5.4
------------------------------------------------------------------------------
error    test passed!
MEMORY   test passed!
base64   test passed!
asn      test passed!
RANDOM   test passed!
MD5      test passed!
MD4      test passed!
SHA      test passed!
SHA-224  test failed!
 error = -2207
I (559) wolfcrypt_test: Exiting main with return code: -1

E (559) wolfssl_test: wolf_test_task FAIL result code = -1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions