1、Log of the cache not closed:
2、Disable the cache, but steps 6 and 7 respond with an incorrect log:
3、Close the cache and inject a fake swap key into the corresponding key slot log after the key exchange step in step 5:
Is it possible to share simple project to reproduce it on my side?
Here's the problem:
I can see that you have two groups for SHARED_SECRET in RAM catalog:
When computing shared secret, key handle 0x00020900 (RAM catalog, group 9, key 0) is passed to the function:
However, when you step over the function, the key allocator selects key handle 0x00020800 (RAM catalog, group 8, key 0):
So, the shared secret is stored to 0x00020800.
But then, in your function KdfSP800_56C_ONESTEP_ReqTest_demo, you configure the original key handle 0x00020900 as a source key handle. Not the one that was assigned by key allocator:
So, that's the reason why the key slot looks like empty - because it is actually empty. You need to select a key handle which was allocated by key allocator.
Regards,
Lukas
Hi:
I try to remove one group of SHARED_SECRET in RAM catalog and disable cache,that i can get the right result. Now i have two questions:
1、If the cache is not disabled, why does the ImportEccKeyReq step report the 55A5A399 error, while all other steps are correct?
2、If there are two groups for SHARED_SECRET in the RAM catalog, why would it cause the error shown in the image below?
Thank you!
Hi @铅笔
1. It depends on the state of the cache memory. Based on the previous program or data flow, the parameters might or might not be present in physical memory. So, if the data cache is enabled, it could work in some cases—but in others, it might not. It's responsibility of user to keep all the data objects used for communication with HSE in non-cacheable memory.
2. Well, the key allocator doesn’t seem to be fully reliable. It tries to select the best available key slot, but it appears to malfunction when there are two identical key groups.
Regards,
Lukas
Hi @铅笔
I did quick test on my side and it works as expected:
My project is attached.
Have you tried to disable data cache?
Regards,
Lukas
What is inside KdfSP800_56C_ONESTEP_ReqTest_demo()? It looks like wrong key handle is used in this function.