-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Backport 2.28: Report configuration settings in the outcome file #9316
Backport 2.28: Report configuration settings in the outcome file #9316
Conversation
Fix PSA_CRYPTO_CONFIG_H being treated as a configuration setting in include/psa/crypto_config.h. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Add a test suite intended to report configuration options in the outcome file: we're only interested in SKIP vs PASS. Add a few test cases for some interesting combinations of options. The selection here is just for illustration purposes, more will be added later. A subsequent commit will automatically generate test cases for single options. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Generate option-on and option-off cases for test_suite_config, for all boolean options (MBEDTLS_xxx and PSA_WANT_xxx, collected from the mbedtls and PSA config files). Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
When option A is only meaningful if option B is enabled, when enumerating single-option test cases, emit A:B and !A:B rather than A and !A. This way the "!A" case is actually meaningful. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
I had accidentally reused a variable name inside the same function. Python copes but mypy doesn't. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
The two were used interchangeably. Align on "setting", which is what config.py uses in its documentation. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
"Super settings" were effectively the dependencies of a setting, so align on that terminology. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
* Move to the correct location. * Adjust the package name for auxiliary modules. * Adjust the hack to import a module from scripts. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Gilles Peskine <Gilles.Peskine@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.
Just to be sure, do we really need that in 2.28? Its end of life is at the end of the year thus what the point to "Check that all configuration options are tested in all.sh" now for it?
I don't think it's worth it to enforce the same level of configuration testing in 2.28. And in that respect, I didn't go digging for options with dependencies in 2.28 (options where A requires B so we want to check A:B and !A:B, not just A and !A), not even to the small level I did for 3.6. But to even evaluate this, I need to get the reports from this pull request. Doing the backport was only about ½h of engineering time, plus the time to review it. I think that's well worth it. |
@CodiumAI-Agent /review |
PR Reviewer Guide 🔍
|
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, just one question.
@@ -102,4 +102,5 @@ check scripts/generate_visualc_files.pl visualc/VS2010 | |||
check scripts/generate_psa_constants.py programs/psa/psa_constant_names_generated.c | |||
check tests/scripts/generate_psa_wrappers.py tests/include/test/psa_test_wrappers.h tests/src/psa_test_wrappers.c | |||
check tests/scripts/generate_bignum_tests.py $(tests/scripts/generate_bignum_tests.py --list) | |||
check tests/scripts/generate_config_tests.py $(tests/scripts/generate_bignum_tests.py --list) |
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.
Was this deliberate or copypasta? I don't think generate_config_tests.py
has a --list
option, but is the generate_bignum_tests.py
list compatible?
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.
Woops, copypasta. Fixed.
All the generate_xxx_tests.py
use the same main
function from test_data_generation.py
and they take the same command line options.
Signed-off-by: Gilles Peskine <Gilles.Peskine@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.
I've checked the backport and reviewed the additional commits. One comment otherwise this looks good to me.
# tests that only run Mbed TLS against itself, which only run in | ||
# configurations with both sides enabled. | ||
if name.startswith('MBEDTLS_SSL_TLS1_3_'): | ||
return 'MBEDTLS_SSL_CLI_C:MBEDTLS_SSL_SRV_C:MBEDTLS_SSL_PROTO_TLS1_3' |
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.
return 'MBEDTLS_SSL_CLI_C:MBEDTLS_SSL_SRV_C:MBEDTLS_SSL_PROTO_TLS1_3' | |
return 'MBEDTLS_SSL_CLI_C:MBEDTLS_SSL_SRV_C:MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL' |
TLS 1.3 is actually not supported in 2.28 thus we could probably just remove this case.
TLS 1.3 is still experimental and partial, and SSL3 is obsolete, so we don't expect much coverage about them, in particular we don't expect them to be the sole supported version. TLS 1.0 and 1.1 exist and we expect good coverage for them. Signed-off-by: Gilles Peskine <Gilles.Peskine@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, thanks.
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
3218ccf
Backport of #9172 and its framework companion Mbed-TLS/mbedtls-framework#28.
I followed the same commit structure for the common content, but several things are different in 2.28.
dependencies_of_setting
needs more 2.28-only stuff but we can do that later based on looking at outcome analysis.check-generated-files
. In 2.28, there is no handling of generated files in**/Makefile
and**/CMakeLists.txt
, and no framework submodule to update.PR checklist
Please tick as appropriate and edit the reasons (e.g.: "backport: not needed because this is a new feature")