Skip to content

Fix PSA ITS UID 0 error code - #835

Open
yiwu0b11 wants to merge 3 commits into
Mbed-TLS:developmentfrom
yiwu0b11:psa_its_uid0_errorcode_fix
Open

Fix PSA ITS UID 0 error code#835
yiwu0b11 wants to merge 3 commits into
Mbed-TLS:developmentfrom
yiwu0b11:psa_its_uid0_errorcode_fix

Conversation

@yiwu0b11

@yiwu0b11 yiwu0b11 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Description

Fix psa_its_set() to return PSA_ERROR_INVALID_ARGUMENT when called with UID 0,
to match the PSA Storage API requirement.

Update the test and function description.

Fixes #826.

PR checklist

  • changelog no user-visible change
  • framework PR not required
  • TF-PSA-Crypto development PR provided # here
  • TF-PSA-Crypto 1.1 PR provided # TODO
  • mbedtls development PR not required because: tf-crypto only
  • mbedtls 4.1 PR not required because: tf-crypto only
  • mbedtls 3.6 PR provided: TODO (need to double check)
  • tests provided

Signed-off-by: Yi Wu <yi.wu2@arm.com>
@yiwu0b11 yiwu0b11 changed the title Fix psa_its_set error code for UID 0 Fix PSA ITS UID 0 error code Jul 9, 2026
@yiwu0b11 yiwu0b11 added needs-review Every commit must be reviewed by at least two team members needs-reviewer This PR needs someone to pick it up for review priority-medium Medium priority - this can be reviewed as time permits size-xs Estimated task size: extra small (a few hours at most) needs-work needs-ci Needs to pass CI tests labels Jul 9, 2026
@gilles-peskine-arm
gilles-peskine-arm self-requested a review July 9, 2026 08:57
@gilles-peskine-arm gilles-peskine-arm removed needs-work needs-ci Needs to pass CI tests labels Jul 9, 2026

@gilles-peskine-arm gilles-peskine-arm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for the fix, but it shouldn't have a changelog entry and I'm not sure about completeness.

Comment thread ChangeLog.d/psa-its-uid0-errcode-fix.txt Outdated
Comment thread core/psa_crypto_its.h Outdated
Comment thread core/psa_its_file.c
return status;
}

psa_status_t psa_its_get(psa_storage_uid_t uid,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the other three functions? Do they return the standard error code for uid=0?

Note, even if they don't, we might not want to fix it if it increases the code size. psa_crypto_its.h does not aim to be a fully compliant implementation of the PSA storage specification, only something that's good enough to run PSA crypto.

yiwu0b11 added 2 commits July 10, 2026 10:12
Signed-off-by: Yi Wu <yi.wu2@arm.com>
@yiwu0b11
yiwu0b11 marked this pull request as ready for review July 10, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Every commit must be reviewed by at least two team members needs-reviewer This PR needs someone to pick it up for review needs-work priority-medium Medium priority - this can be reviewed as time permits size-xs Estimated task size: extra small (a few hours at most)

Projects

Status: In Development

Development

Successfully merging this pull request may close these issues.

Test inconsistent with documentation

2 participants