-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[crypto] Introduce PSAKeyAllocator #37332
[crypto] Introduce PSAKeyAllocator #37332
Conversation
PR #37332: Size comparison from 3044eeb to 08dc578 Full report (14 builds for cc13x4_26x4, cc32xx, nrfconnect, qpg, stm32, tizen)
|
08dc578
to
efcd0cc
Compare
PR #37332: Size comparison from 3044eeb to efcd0cc Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
efcd0cc
to
47dcf0c
Compare
PR #37332: Size comparison from 11a4c4a to 47dcf0c Full report (72 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
- Moved the PSA key definitions from CHIPCryptoPALPSA.h file to the newly created PSAKeyAllocator. - The new PSAKeyAllocator class allows for the allocation of keys in secure storage. Users can create their own PSAKeyAllocator implementation and set it to be used by the Matter stack. - If the custom implementation is not provided the default one is used and it works as the legacy solution and the mechanism is about stored keys in the PSA ITS storage. Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
The unit test: - Verifies the defaultKeyAllocator instance, key allocation and if attributes are ont changed. - Creates a new testing key allocator and verifies if it works as expected and differently than the default ones. - Switches back to the defaultKeyAllocator instance and checks if code works properly. Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
47dcf0c
to
c09d133
Compare
PR #37332: Size comparison from 5398152 to c09d133 Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
* Base of the PSA key identifier range used by Matter. | ||
* | ||
* Cryptographic keys stored in the PSA Internal Trusted Storage must have | ||
* a user-assigned identifer from the range PSA_KEY_ID_USER_MIN to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
identifer -> identifier
* [crypto] Introduce PSAKeyAllocator - Moved the PSA key definitions from CHIPCryptoPALPSA.h file to the newly created PSAKeyAllocator. - The new PSAKeyAllocator class allows for the allocation of keys in secure storage. Users can create their own PSAKeyAllocator implementation and set it to be used by the Matter stack. - If the custom implementation is not provided the default one is used and it works as the legacy solution and the mechanism is about stored keys in the PSA ITS storage. Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no> * [crypto] Added a unit test for PSAKeyAllocator The unit test: - Verifies the defaultKeyAllocator instance, key allocation and if attributes are ont changed. - Creates a new testing key allocator and verifies if it works as expected and differently than the default ones. - Switches back to the defaultKeyAllocator instance and checks if code works properly. Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no> --------- Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
The PSAKeyAllocator introduces a new possibility to manage PSA keys depending on the platform.
Now we can still use common PSA API in the Matter stack, but we can inject the platform-specific implementation for storing the persistent keys. Thanks to that we can use PSA ITS as well as custom a crypto driver which is available on vendor-specific platform
Allowed setting session keystore by platform. If any keystore is not set, assign the default one.
Moved the PSA key definitions from the CHIPCryptoPALPSA.h file to
the newly created PSAKeyAllocator.
The new PSAKeyAllocator class allows for the allocation of keys
in secure storage. Users can create their own PSAKeyAllocator
implementation and set it to be used by the Matter stack.
If the custom implementation is not provided the default one is
used and it works as the legacy solution the mechanism is
about stored keys in the PSA ITS storage.
Testing
Added a new unit test for the PSAKeyAllocator under the
TestPSAOpKeyStore
test suite (Separate commit in this PR).The solution is tested within the examples-nrfconnect workflow where the unit tests of the TestPSAOpKeyStore suite are run on the Posix platform.