-
Notifications
You must be signed in to change notification settings - Fork 19
Crypto API update - slots to handles #13
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
Conversation
main.cpp
Outdated
@@ -214,7 +214,9 @@ static psa_status_t cipher_example_encrypt_decrypt_aes_cbc_nopad_1_block(void) | |||
ASSERT_STATUS(status, PSA_SUCCESS); | |||
|
|||
exit: | |||
psa_destroy_key(key_slot_cipher); | |||
if (key_handle != 0) { | |||
psa_destroy_key(key_handle); |
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.
Is it not safe to call psa_destroy_key(0)
?
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.
double checked, it is safe, rebased.
5eea0d6
to
cde93a5
Compare
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
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. Builds and runs fine with the tip of ARMmbed/mbed-os#9529
psa_key_usage_t key_usage, | ||
psa_algorithm_t alg) | ||
{ | ||
psa_status_t status; | ||
psa_key_policy_t policy; | ||
psa_key_policy_t policy = psa_key_policy_init(); |
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.
crypto code uses psa_key_policy_t policy = PSA_KEY_POLICY_INIT;
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.
You can do it either way, it's the same
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.
unless macro hides another stuff. and when the internals will change using macro will still allow abstraction...
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.
psa_key_policy_init()
is an API function, it's not internal.
The macro can be only used as an initializer.
I believe this can't be merged to master, as this example would fail for 5.11.x releases (this is on 5.11 branch https://github.com/ARMmbed/mbed-os/blob/mbed-os-5.11/tools/test/examples/examples.json#L292 ) As soon as this lands on master, it breaks 5.11.x release candidates |
OK got it, I'll keep my fork as is for the time being. |
Merging to development instead of master, to allow us to build up, test, and integrate a branch suitable for 5.12 well in advance of the 5.12 code freeze, without breaking patch releases. |
Update the examples to use the latest crypto API.
Depends on ARMmbed/mbed-os#9529.
PLEASE DO NOT MERGE until ARMmbed/mbed-os#9529 has been merged (or the crypto API has been updated in Mbed OS).
This PR also fixes a typo in the README.md file.
Note: The hash in file
mbed-os.lib
will need to be updated before merging.