Skip to content

wolfBoot as library portability, Renesas fixes and TSIP AES CTR #570

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

Merged
merged 18 commits into from
Jun 16, 2025

Conversation

dgarske
Copy link
Contributor

@dgarske dgarske commented May 8, 2025

  • Improvements for portability using older gcc 4.8.2.
    • Make sure wolfboot.h includes the wolfBoot_verify_* API's.
    • Remove duplicate wolfBoot_get_partition_state def.
    • Fixed issue with parsing headers when #include is # include and using "" not <> (required by customer parsing tool).
  • Fix to force alignment on the flash header copy (hdr_cpy). Caused issues using wolfBoot as static library on Renesas RX.
  • Fix for Renesas TSIP key types (changed in #8403).
  • Fix for Renesas RX ".keystore" location in linker script.
  • Fix for wolfBoot as library with Renesas to make sure crypto hardware is initialized and setup.
  • Fix logic on ext_flash_check_read return code (it is supposed to return size read or decrypted).
  • Fix for NO_SWAP_EXT=1 with encryption enabled.
  • Added Renesas RX TSIP encrypted updates support using AES CTR. Requires Added Renesas RX TSIP AES CTR support wolfssl#8854
  • Added NO_SWAP_EXT to allow support for onboard flash swap sector.
  • Added WOLFSSL_NO_CT_OPS for ECDSA verify only.
  • Added WC_NO_DEFAULT_DEVID to help with code size reduction.

@dgarske dgarske self-assigned this May 8, 2025
@dgarske dgarske force-pushed the gcc4_portability branch 4 times, most recently from 4cb753a to b99d8fc Compare May 14, 2025 17:49
…t.h includes the `wolfBoot_verify_*` API's. Fixed issue with parsing headers when `#include` is `# include`.
@dgarske dgarske force-pushed the gcc4_portability branch from b99d8fc to 869f15b Compare May 14, 2025 19:28
dgarske added 2 commits May 14, 2025 15:15
…ues using wolfBoot as static library on Renesas RX.
… in linker script. Fix for wolfBoot as library with Renesas to make sure crypto hardware is initialized and setup. Add forced alignment on additional buffers used for flash read/write.
@dgarske dgarske force-pushed the gcc4_portability branch from 01a3c79 to a63d2a1 Compare June 2, 2025 20:22
@dgarske dgarske changed the title wolfBoot as library portability fixes wolfBoot as library portability and Renesas fixes Jun 2, 2025
@dgarske dgarske requested a review from danielinux June 5, 2025 19:35
@dgarske dgarske assigned danielinux and unassigned danielinux and dgarske Jun 5, 2025
Copy link
Member

@danielinux danielinux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, unsure about the removal of a prototype from image.h

@dgarske dgarske assigned dgarske and unassigned danielinux Jun 9, 2025
@dgarske dgarske changed the title wolfBoot as library portability and Renesas fixes wolfBoot as library portability, Renesas fixes and TSIP AES CTR Jun 9, 2025
dgarske added 2 commits June 9, 2025 13:52
…upport for onboard flash swap sector. Added `WOLFSSL_NO_CT_OPS` for ECDSA verify only. Added `WC_NO_DEFAULT_DEVID` to help with code size reduction.
@dgarske dgarske force-pushed the gcc4_portability branch from d507708 to eed01dc Compare June 11, 2025 17:12
@dgarske dgarske force-pushed the gcc4_portability branch from e604d95 to 861252f Compare June 11, 2025 22:28
…called before trying to setup the crypto callback.
@dgarske dgarske requested a review from danielinux June 12, 2025 19:43
@dgarske dgarske assigned danielinux and unassigned dgarske Jun 12, 2025
@dgarske dgarske assigned dgarske and unassigned danielinux Jun 12, 2025
…hed full encrypted update testing on Renesas RX with TSIP. Fixed issue with `No rule to make target `NONE’` using encrypted AES.
@dgarske dgarske assigned danielinux and unassigned dgarske Jun 13, 2025
@dgarske dgarske requested review from danielinux and Copilot June 13, 2025 20:18
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances wolfBoot portability and reliability on Renesas platforms by addressing duplicate definitions, refining flash header parsing, and updating crypto key handling for TSIP AES CTR support.

  • Removes duplicate API definitions and cleans up includes.
  • Enforces proper alignment on buffers and data structures for improved flash and crypto operations.
  • Updates Renesas TSIP key type mappings and enhances the initialization flow for crypto and flash subsystems.

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools/keytools/keygen.py Removes redundant type casting for returning key masks
tools/keytools/keygen.c Similar removal of redundant casts for key mask retrieval
src/update_flash.c Updates comment wording and adds SWAP_EXT condition to bypass decryption
src/libwolfboot.c Adds alignment attributes and supports TSIP crypto init via macros
src/image.c Adds alignment attributes and adjusts error checks for flash operations
src/delta.c Changes include dependency from encrypt.h to image.h
options.mk Adjusts flags regarding swap support based on NO_SWAP_EXT
include/wolfboot/wolfboot.h Updates includes and hash block sizes
include/user_settings.h Adds new configuration defines and adjusts inline aggregate settings
include/image.h Removes duplicate partition state function definition
include/encrypt.h Updates include syntax to use quotes consistently
hal/renesas-rz.c Fixes Renesas initialization and updates return flow
hal/renesas-rx.c Replaces obsolete TSIP key type constants with updated ones
hal/renesas-ra.c Refines Renesas RA initialization and error reporting
docs/Targets.md Updates target documentation comments for clarity
docs/Renesas.md Enhances Renesas documentation including RX TSIP AES encryption details
arch.mk Adds new source file for TSIP AES support

…ER` (not compatible). Added a few more `uint8_t` alignments.
Copy link
Member

@danielinux danielinux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. A bit concerned about the amount of ifdef'd code in generic files (libwolfboot.c / image.c) but I think this was needed for the correct sequence on sip_init/hal_set_key. If you think it cannot be avoided I'm fine with this.

@dgarske dgarske requested a review from danielinux June 16, 2025 15:32
Copy link
Member

@danielinux danielinux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two places with XALIGNED_STACK attribute instead of XALIGNED

@dgarske dgarske requested a review from danielinux June 16, 2025 16:49
@danielinux danielinux merged commit dea8b4e into wolfSSL:master Jun 16, 2025
260 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants