-
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
Document driver testing status #8566
Conversation
@gilles-peskine-arm @ronald-cron-arm Since you're probably the most familiar with this, I'd appreciate if you could take a look - maybe not a complete review but at high-level view to see if this looks reasonable or if you notice any misunderstanding or obvious omissions here. |
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 only found 1 typo, the rest is fine for me. However the CI is not fully happy about the change made to generate_ec_key
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
I think that at least 3 out of 4 errors found in
I think we should fix this (as we did recently) by adding a specific hit counter instead of |
Sounds good, thanks for the suggestion! I hadn't even looked at the CI results yet, thanks for analyzing the failures! |
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 only found 1 typo which I didn't see before. The rest is fine for me :)
tests/configs/user-config-for-test.h
Outdated
@@ -37,34 +37,76 @@ | |||
#endif | |||
|
|||
/* Use the accelerator driver for all cryptographic mechanisms for which | |||
* the test driver implemented. */ | |||
* the test driver is implemented. This is copied from psa/crypto_config.h | |||
* with the parts not implmented by the test driver commented out. */ |
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.
* with the parts not implmented by the test driver commented out. */ | |
* with the parts not implemented by the test driver commented out. */ |
be21b16
to
9cf821c
Compare
Note to self: update names of cipher/aead components when #8641 has been merged. |
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
Improved by Mbed-TLS#8616 - closing 8553. Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
Been merged in the meantime. Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
Mbed-TLS#8700 merged in the meantime. Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
@gilles-peskine-arm Thanks for your review! I believe I have addressed your feedback. I've also had to rebase to resolve a conflict. Turns out the commit "Fix failure in some configs by being more precise" was no longer needed as something similar had been done in development in the meantime. |
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 except for a typo, and maybe one bit of explanation to add.
As before, I haven't reviewed the details of which entry points are covered, and I intend to approve regardless. I'm confident that even if there are mistakes, they're minor, and no worse than what this document is likely to become over time when people improve the tests and forget to update the document.
implementing the operation. This will remain hard to test until we have proper | ||
support for JSON-defined drivers with auto-generation of dispatch code. | ||
(The `MBEDTLS_PSA_ACCEL_xxx` macros we currently use are not expressive enough | ||
to specify which entry points are support for a given mechanism.) |
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.
to specify which entry points are support for a given mechanism.) | |
to specify which entry points are supported for a given mechanism.) |
operation: entry points always return `NOT_SUPPORTED`. | ||
The opaque driver implements the declared entry points, and can use any | ||
backend: internal or libtestdriver1. However it does not implement the | ||
instrumentation (hits, forced output/status), as this [was not an immediate |
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.
From a chat with Ronald: hits is actually probably an obsolete concern. With the internal backend, hits were how we knew that the driver was called, as opposed to directly calling the built-in code. With libtestdriver1, we check that by ensuring that the built-in code is not present, so if the operation gives the correct result, only a driver call can have calculated that result. So there is low value in checking the hit count. There is still some value for hit counts, e.g. checking that we don't call a multipart entry point when we intended to call the one-shot entry point, but it's limited.
And fix a typo while at it. Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
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 ;)
Description
This PR's main goal is to document the strategy used to test the PSA Crypto driver interface, as well as the current implementation status of that strategy.
Along the way, a couple of minor things are modified, but the PR's goal is not to fix things, or even to provide a complete plan for action - only to document the current state of things (which could be the first step towards an action plan).
Main gaps identified:
Two gaps in driver-only testing (compared to what we're supposed to support).Fixed in the meantime: 8616, 8734.test_suite_psa_crypto_driver_wrapper.data
.PR checklist