-
Couldn't load subscription status.
- Fork 96
SE driver: make persistent data work #285
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
SE driver: make persistent data work #285
Conversation
When registering a key in a secure element, go through the transaction mechanism. This makes the code simpler, at the expense of a few extra storage operations. Given that registering a key is typically very rare over the lifetime of a device, this is an acceptable loss. Drivers must now have a p_validate_slot_number method, otherwise registering a key is not possible. This reduces the risk that due to a mistake during the integration of a device, an application might claim a slot in a way that is not supported by the driver.
Add a parameter to the p_validate_slot_number method to allow the driver to modify the persistent data. With the current structure of the core, the persistent data is already updated. All it took was adding a way to modify it.
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.
Would be good to have some more context or justification described in the commit messages, but otherwise OK
The persistent data was not loaded correctly (the code was loading 0 bytes instead of the correct size).
Add invasive checks that peek at the stored persistent data after some successful import, generation or destruction operations and after reinitialization to ensure that the persistent data in storage has the expected content.
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
|
CI passed on -head. The failures on -merge are due to a recent CI instability. The PR is from a recent branch and we'd have been happy to merge with a CI job that had run on exactly the same content as the -head job. So CI is ok to merge. |
* ARMmbed#272: Insert doxygen comments on old algorithms so they appear in PSA documentation * ARMmbed#285: SE driver: make persistent data work * ARMmbed#279: Include IANA reference in the definition of ECC curves and DH groups * ARMmbed#287: DRBG documentation improvements * ARMmbed#297: Fix int overflow in mbedtls_asn1_get_int (Credit to OSS-Fuzz)
Secure element interface changes:
p_validate_slot_numbermethod no longer allows registering an existing key withmbedtls_psa_register_se_key.p_validate_slot_numbermethod now takes an extra read-write parameterpersistent_data, likep_allocate.New features and bug fixes:
p_initdriver method duringpsa_crypto_init.