[Renesas RX72N] RX72N TSIP fixes and command-line build/flash/UART tooling#10842
Open
miyazakh wants to merge 4 commits into
Open
[Renesas RX72N] RX72N TSIP fixes and command-line build/flash/UART tooling#10842miyazakh wants to merge 4 commits into
miyazakh wants to merge 4 commits into
Conversation
- Add GCM_TABLE_4BIT - Add build.bat for command line build - f5419 mutex - f6163 AES aadBuf - Add debug_run.bat to write and run the example from CL - Add UART message - Messages are routed sci2_uart_charput(). To get back to Virtual Consol, it takes BSP_CFG_USER_CHARPUT_ENABLED 0. f1535 error messaages typo
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the Renesas RX72N TSIP integration by fixing several concrete error-path and correctness issues in TSIP-backed crypto operations, and adds/updates RX72N e2studio “Simple” tooling to support command-line build/flash and reliable UART printf() output.
Changes:
- Fix TSIP hardware-lock handling and correctness/return-value bugs in TSIP key import, hash finalize/get, and AES-GCM decrypt AAD handling.
- Add TSIP SHA-1/SHA-256 behavioral tests to the RX72N TSIP unit test app.
- Add RX72N command-line helper scripts (build / demo-mode switch / flash-run) and route
printf()to SCI2 UART via BSP charput.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| wolfcrypt/src/port/Renesas/renesas_tsip_util.c | Fix TSIP HW lock leak on allocation failure paths. |
| wolfcrypt/src/port/Renesas/renesas_tsip_sha.c | Fix uninitialized/incorrect return behavior in TSIP hash Final/Get paths. |
| wolfcrypt/src/port/Renesas/renesas_tsip_aes.c | Fix AES-GCM decrypt to use aligned AAD buffer; correct TLS 1.3 encrypt log strings. |
| IDE/Renesas/e2studio/RX72N/EnvisionKit/wolfssl_demo/wolfssl_tsip_unit_test.c | Add TSIP SHA-1/SHA-256 tests; minor test-flow change near TSIP init. |
| IDE/Renesas/e2studio/RX72N/EnvisionKit/wolfssl_demo/user_settings.h | Enable GCM_TABLE_4BIT in RX72N demo settings. |
| IDE/Renesas/e2studio/RX72N/EnvisionKit/Simple/test/test.scfg | Enable BSP charput hook and point it to sci2_uart_charput; other config text normalization. |
| IDE/Renesas/e2studio/RX72N/EnvisionKit/Simple/test/src/test_main.c | Initialize SCI2 UART for printf(), including a re-init after wolfCrypt_Init(). |
| IDE/Renesas/e2studio/RX72N/EnvisionKit/Simple/common/wolfssl_dummy.c | Implement SCI2 UART charput + init used by BSP hook for printf(). |
| IDE/Renesas/e2studio/RX72N/EnvisionKit/Simple/set_demo_mode.ps1 | New script to toggle demo-mode macros and touch dependents for rebuild. |
| IDE/Renesas/e2studio/RX72N/EnvisionKit/Simple/debug_run.bat | New script to flash/run via Renesas Flash Programmer CLI. |
| IDE/Renesas/e2studio/RX72N/EnvisionKit/Simple/build.bat | New command-line build wrapper with demo-mode switching and bootstrap checks. |
| IDE/Renesas/e2studio/RX72N/EnvisionKit/include.am | Update distribution list to include new tooling (currently only adds build.bat). |
Comments suppressed due to low confidence (1)
IDE/Renesas/e2studio/RX72N/EnvisionKit/wolfssl_demo/wolfssl_tsip_unit_test.c:1703
- This
if (ret != 0)block is unreachable becauseretis initialized to 0 and not modified before the check, making the error path dead code and the message misleading. Either assignretfrom the intended key-generation/init step, or remove this block.
if (ret != 0) {
printf("TSIP Key Generation failed\n");
return -1;
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
retest this please |
|
Contributor
Author
|
retest this please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RX72N TSIP fixes and command-line build/flash/UART tooling
TSIP crypto/hardware fixes
tsip_ImportPublicKey/wc_tsip_generateSessionKey: fixedtsip_hw_lock()leaks on allocation failure (renesas_tsip_util.c) — anXMALLOCfailure returned early without callingtsip_hw_unlock(), permanently holding the TSIP hardware lock. (f5419)TSIPHashFinal/TSIPHashGet: fixed silent-success-on-failure bugs inrenesas_tsip_sha.c—retwas left uninitialized on some paths, aFinal()call that succeeded with the wrong output size still returned0(success), andTSIPHashGetunconditionallyreturn 0regardless of the actual result. (f6162)wc_tsip_AesGcmDecrypt: fixed a copy-paste bug where the 32-bit-alignedaadBufwas allocated and filled but never used — the TSIPupdateFncall passed the original (possibly unaligned)authInpointer instead, unlike the correct encrypt-side code. Could causeAES_GCM_AUTH_Eon valid input when the caller's AAD buffer isn't aligned. (f6163)tsip_Tls13AesEncrypt: fixed two error-log messages copy-pasted from the decrypt function (said "Decrypt" instead of "Encrypt"); no functional impact, diagnostics only. (f1535)build.bat, debug_run.bat, and UART output
printf()to the on-board SCI2 UART (switchable back to the E1/E2 Virtual Console viaBSP_CFG_USER_CHARPUT_ENABLED), and fixed the underlying clock-forcing and baud-rate calculation bugs that caused wrong benchmark timing and garbled UART output.debug_run.batto flash and run via Renesas Flash Programmer instead of a raw GDB session (more reliable — sidesteps device-specific GDB setup e2studio's GUI does internally).build.batnow acceptscrypt/bench/TLSClientto switch the demo mode before building, fixes a stale-object incremental-build bug, and fails with a clear message on a not-yet-bootstrapped checkout.Testing
Run example programs including crypt, bench and TLS
Checklist