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

fix for keymod with rt1170 blobs #6539

Merged
merged 1 commit into from
Jun 23, 2023
Merged

Conversation

JacobBarthelmeh
Copy link
Contributor

ZD16138
ZD16344

@JacobBarthelmeh JacobBarthelmeh self-assigned this Jun 23, 2023
@JacobBarthelmeh
Copy link
Contributor Author

JacobBarthelmeh commented Jun 23, 2023

How to test building:

# Download SDK_2_12_1_MIMXRT1170-EVK.zip with FreeRTOS and cmake support
# get CAAM cmake exmaple from here https://github.com/wolfSSL/wolfssl-examples/pull/361
cd wolfssl-examples/cmake/caam-nxp-exmaple
unzip SDK_2_12_1_MIMXRT1170-EVK.zip
git clone -b caam git@github.com:JacobBarthelmeh/wolfssl
./build.sh

I can provide the SDK zip for testing with if wanted.

Fix Explanation

Our unit tests in test.c do have a red blob create and open test. Before the job descriptor for blobs was using an immediate load 0x144 ..... which grabs the next 4 lines as the keymod to be used (this was used on previous CAAM projects successfully). In this case though we want to fetch the keymod given an address not an immediate load. The unit tests succeeded because the next 4 lines in the job descriptor happened to be the same for the create and open calls. Doing a power cycle and then testing opening the red blob afterwards exposes the issue.

Testing Done

  • Tested with a local app doing a creation of a red blob, power down, power on, then open the red blob and compare the results with the original data (with and without a keymod value set)
  • Tested fails to open red blob with incorrect keymod value after power cycle
  • Tested black blob creation, power down, power on, then opened the black blob and inspected the results (getting a re-encrypted black key)

@dgarske dgarske merged commit ea68920 into wolfSSL:master Jun 23, 2023
64 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