You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scan targets checked:wolfcrypt-src, wolfcrypt-bugs, wolfcrypt-port-bugs, wolfssl-src, wolfssl-bugs Coverage: 9 of 14 in-scope changed file(s) opened by the reviewer; not opened: wolfcrypt/src/aes.c, wolfcrypt/test/test.c, wolfssl/wolfcrypt/aes.h, wolfssl/wolfcrypt/port/ti/ti-sa2ul_r5_port.h, wolfssl/wolfcrypt/sha256.h
Findings: 5 5 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
Cast word64 arguments for portable %llu formatting
wolfcrypt/benchmark/benchmark.c:3227
word64 is typedef'd as unsigned long when SIZEOF_LONG == 8 (types.h:390-400), so passing these values directly to %llu is a variadic type mismatch on LP64 targets and can produce undefined output. Cast both arguments to unsigned long long (or use a project-wide portable 64-bit format macro).
Fix variadic type mismatch in %llu conversion
wolfcrypt/benchmark/benchmark.c:3232
This %llu conversion also receives word64 directly; on LP64 builds word64 is unsigned long, not unsigned long long, making the variadic call undefined. Use an explicit matching cast or a portable format macro.
Release SA2UL context and mutex on hardware failure
wolfcrypt/src/port/ti/ti-sa2ul_r5_port.c:867
On a hardware-processing failure this returns while scObj still owns the SA2UL context and the global hardware mutex remains locked. Subsequent accelerated operations will therefore remain unavailable (and the context leaks) until this hash object happens to be freed. Release the context before propagating the error.
This issue also appears in the following locations of the same file:
line 881
line 1010
line 1028
Add TI RNG and Crypto handle cleanup
wolfcrypt/src/port/ti/ti-sa2ul_r5_port.c:1225
The RNG and Crypto handles opened by this initializer have no matching TI cleanup hook in wolfCrypt_Cleanup(); wc_CryptoCb_Cleanup() only unregisters callbacks (cryptocb.c:545-552). A cleanup/re-init cycle therefore leaves the SDK resources open and attempts to open them again. Add a TI port cleanup that closes both handles and invoke it from the final wolfCrypt cleanup path.
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
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.
Description
Adds support for TI am64x hardware acceleration, based on api's from the TI MCU Plus SDK.
Testing
Tested with a new wolfBoot port and wolfssl test/benchmark code.
Corresponding wolfBoot support: wolfSSL/wolfBoot#849
Checklist