Fix code using psa_key_id_t that should be using psa_key_handle_t #529
+6
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes
I can't build Mbed for targets using PSA with the latest GCC, because they appear to have upgraded a pointer-related warning into an error. It seems that there are several places in the code that pass a pointer to a
psa_key_id_t(equivalent to uint32_t) to places expecting apsa_key_handle_t *(equivalent to uint16_t *), and the compiler will no longer compile this code. Honestly I don't know the deeper meaning behind these two different types, but I believe it was working because there was still enough room in the type it was passing to store the handle. So, I changed all the erroring locations to use thepsa_key_handle_ttype. This should not affect the behavior of the code, but fixes the compiler error.Note that I did check upstream in the latest version of Mbed TLS 3 (which we really need to upgrade to at some point) and this error seems to appear there too, but not 100% sure due to them moving a lot of files around in the latest release. So we may have to file a bug upstream when we finally upgrade Mbed TLS.
I was able to find one reference to this issue in the Mbed TLS changelog: https://github.com/Mbed-TLS/mbedtls/blob/216c1950f33cc81677ae4e915a94d7fe4fcc689c/ChangeLog#L2335
Looks like this might be a holdover from supporting an older version of PSA, and they consider these two types to be equivalent, even though they actually aren't.
Impact of changes
Migration actions required
Documentation
Pull request type
Test results