Mbed-TLS / mbedtls

An open source, portable, easy to use, readable and flexible TLS library, and reference implementation of the PSA Cryptography API. Releases are on a varying cadence, typically around 3 - 6 months between releases.
https://www.trustedfirmware.org/projects/mbed-tls/
Other
5.02k stars 2.5k forks source link

Backport 2.28: Report configuration settings in the outcome file #9316

Open gilles-peskine-arm opened 2 days ago

gilles-peskine-arm commented 2 days ago

Backport of https://github.com/Mbed-TLS/mbedtls/pull/9172 and its framework companion https://github.com/Mbed-TLS/mbedtls-framework/pull/28.

I followed the same commit structure for the common content, but several things are different in 2.28.

PR checklist

Please tick as appropriate and edit the reasons (e.g.: "backport: not needed because this is a new feature")

gilles-peskine-arm commented 2 days ago

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.

coolleng2525 commented 1 day ago

@CodiumAI-Agent /review

CodiumAI-Agent commented 1 day ago

PR Reviewer Guide 🔍

⏱️ Estimated effort to review [1-5] 4
🧪 Relevant tests Yes
🔒 Security concerns No
⚡ Key issues to review Possible Bug:
The PR introduces a new script generate_config_tests.py which generates test cases for configuration settings. It is crucial to ensure that this script correctly handles all edge cases, especially since it deals with conditional dependencies and complex configurations.
Code Complexity:
The config.py script has been modified to include handling for inclusion guards and other complex parsing logic. This increases the complexity of the script, which could lead to maintenance challenges in the future.
Generated Data Verification:
The PR includes a large amount of automatically generated test data. It is important to verify that this data is correct and covers all necessary scenarios.