-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Refactor Crypto Service Proxy #10036
Refactor Crypto Service Proxy #10036
Conversation
@itayzafrir, thank you for your changes. |
How much space did it save? |
I'll post the size diff tomorrow, but this PR affects the non-secure side only. I'm planning on refactoring the secure side as well when I get a chance... |
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.
Looks great, main focus is consistency
probably needed to be documented that the ipc_call returns BAD_STATE on a bad handle
But again looks great
components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/psa_crypto_spm.c
Outdated
Show resolved
Hide resolved
components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/psa_crypto_spm.c
Outdated
Show resolved
Hide resolved
components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/psa_crypto_spm.c
Show resolved
Hide resolved
components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/psa_crypto_spm.c
Outdated
Show resolved
Hide resolved
components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/psa_crypto_spm.c
Show resolved
Hide resolved
components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/psa_crypto_spm.c
Outdated
Show resolved
Hide resolved
components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/psa_crypto_spm.c
Outdated
Show resolved
Hide resolved
components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/psa_crypto_spm.c
Outdated
Show resolved
Hide resolved
components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/psa_crypto_spm.c
Outdated
Show resolved
Hide resolved
components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/psa_crypto_spm.c
Outdated
Show resolved
Hide resolved
@orenc17 thanks for the review. I've added some more commits, please take a look. Currently running tests on NXP & Cypress: crypto-sanity, crypto-access-control, crypto-compliance @0xc0170 can you please remove the needs work label and add the needs review? |
All tests passed locally on both Cypress & NXP:
|
2c87258
to
5bd8591
Compare
- Use designated initializers for IPC structs - Unify variables declaration and initialization
5bd8591
to
c97b90a
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
5.12.1 release target? |
This isn't anything urgent, it can wait. |
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.
One small change. Otherwise looks fine
{ | ||
psa_status_t status; | ||
psa_crypto_ipc_t psa_crypto_ipc = { 0, 0, 0 }; | ||
//TODO: add retry mechanism to make sure resources were deallocated. |
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.
We should not leave TODO in the code, create a tracking issue rather
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.
I removed the comment as it's not relevant anymore.
@avolinski please review |
While waiting for final approval, CI started |
|
||
status = psa_call(handle, NULL, 0, NULL, 0); | ||
psa_close(handle); | ||
psa_status_t status = psa_call(*handle, in_vec, in_vec_size, out_vec, out_vec_size); |
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.
if call failed, do we close anyway?
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.
yes, if close == true
Test run: SUCCESSSummary: 13 of 13 test jobs passed |
Please hold the merge until @avolinski completes his review. |
All reviews are done, can we get this merged please |
Description
Refactor common functionality in crypto service proxy (client side) to prevent code duplication and save some flash space.
Tested locally:
Cypress - crypto sanity + crypto access control + crypto compliance - PASSED
NXP - crypto sanity + crypto access control + crypto compliance - PASSED
Pull request type
Reviewers
@avolinski @NirSonnenschein
Release Notes