-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Make enrollement "optional" in pk_can_do_ext() #8607
Conversation
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.
Thanks! Normally I request tests in PRs that lack them, this is the rare instance where it's the other way round ;) But thanks for testing anyway!
tests/scripts/all.sh
Outdated
@@ -1510,6 +1510,28 @@ component_test_sw_inet_pton () { | |||
make test | |||
} | |||
|
|||
# Disabling of key enrollment function in PK module is experimental, so albeit |
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.
Thanks for trying it out, I generally insist on automated tests, but in this instance, I think this is overkill. In particular, I'm not a big fan of having to mark a bunch of cases as depending on MBEDTLS_PSA_CRYPTO_CLIENT
as this might send the wrong message.
I think for the level of support we want now (which is no official support), it's better not to test this.
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 understand :)
Side question: what about the fixes I did in the tests? Without anything that can test those depends_on
additions it's hard to provide a clear justification for them. I would say that also the fixes I did for the tests are to be removed. Wdyt?
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, actually removing those is the primary reason I'd like to remove this.
library/pk.c
Outdated
* defined, i.e. when the Mbed TLS implementation of PSA Crypto is being used. | ||
* Even though we don't officially support using other implementations of PSA | ||
* Crypto with TLS and X.509 (yet), we're still trying to simplify the life of | ||
* people who would like to try it before it's officially supported. |
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.
Minor: I'd prefer this comment to be just before the first #if defined(MBEDTLS_PSA_CRYPTO_CLIENT)
, in order to be more discoverable and avoiding people getting the wrong impression when reading this #if` without the comment.
Use key enrollment function only when MBEDTLS_PSA_CRYPTO_CLIENT is enabled, i.e. when the Mbed TLS implementation of PSA Crypto is being used. Signed-off-by: Valerio Setti <[email protected]>
74ae6f1
to
2bd5366
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
@valeriosetti This PR only addresess use of |
Assuming #8612 will be merged soon, the only usages I still see are in |
I think that is the only one, atleast the only one I saw when compiling for TF-M. |
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
Removing from the merge queue and labeling needs-design-approval as I've got indirect feedback that the approach does not satisfy everyone. @frkv Can you make your point here so that we can discuss it directly? |
For the record of my current view of how it is or will be possible to build things and what we can assume in each case (I may misunderstand things, but I'm trying to make my view explicit to support discussion):
Currently, only (1) is officially supported. The situation about (2) is a bit more complex: it's not officially supported by Mbed TLS mostly because we have not tests for this (though that's planned for next year), but TF-M is already working on a demo doing this. Then (3) is neither officially supported nor planned in the short to medium term, though it's certainly something we want to support in the long run. A consequence of the above is that in every build that has |
I have a different take on the proposed defines and their meaning
So for the logical relationship between the two current proposed defines:
|
Thanks for clarifying your views. We seem to be in agreement about the meaning of
Do you think that's an accurate summary of the differences in our views? I think it is useful to distinguish between the case where the server is based on Mbed TLS and the case where we make no assumptions about the server. While the later is indeed a reasonable expectation, and a long-term goal we have, it's currently not on our roadmap*. The former on the other hand is something that should be happening next year, and it is IMO an important intermediate step towards the later. *As I noted elsewhere feel free to request we put in our our roadmap, but please be explicit about it - I think both from a technical and planning perspective we really need to distinguish between the server being based on Mbed TLS or not. |
Not just “the PSA crypto API” as in an implementation of the PSA Crypto API specification, but the PSA crypto API as implemented by Mbed TLS. We have never designed Mbed TLS to support using the X.509/TLS part with a different implementation of the crypto part. This feature is on our engineering roadmap as a far-future thing. You can either build Mbed TLS as a single library, or in two parts with separation: crypto/keystore and pk/X.509/TLS. If you build with separation, then:
We are now making a few adjustments to enable the X.509/TLS part of the library to be used with an alternative implementation of the PSA crypto specification, but these are ad hoc adjustments that we are doing on a case-by-case basis to help some Arm partners. Whether the alternative implementation of the crypto API is client-server or not is an implementation detail that is not directly relevant. However, since these are merely ad hoc adjustments, it's ok if they happen to only work when the alternative implementation is a client-server one. Thus, interpreting |
This PR introduces guards (
MBEDTLS_PSA_CRYPTO_CLIENT
) in PK module for using key enrollment functions.Resolves #8602
PR checklist