mbedtls
mbedtls copied to clipboard
Driver-only hashes: TLS 1.2: `ssl-opt.sh`
This is a follow-up to #6128. After having TLS 1.2 build and test_suite_ssl pass in a build with driver-only hashes, we want the rest of the TLS 1.2 tests to pass; this task is about ssl-opt.sh.
- [ ] Add a new function
requires_hash_algthat takes as argument a string likeSHA-256,SHA-384, etc and setsSKIP_NEXTor not depending on whether the hash is available; for example SHA-256 is available if(!USE_PSA && SHA256_C) || (USE_PSA && PSA_WANT_ALG_SHA_256). This should be done with a series of invocations ofquery_compile_time_configand the result should be cached (see other similar functions). (Note: this is very similar to theMBEDTLS_HAS_xxx_VIA_MD_OR_PSA_BASED_ON_USE_PSAmacros fromlibrary/legacy_or_psa.h; however this header is internal, soquery_compile_time_configdoes not (and should not) allow queries about it.) - [ ] Go over the dependencies declarations on
MBEDTLS_SHAxxx_Cintests/ssl-opt.shand replace them with uses of the above function. (Note: 36 occurrences today.) - [ ] Run
ssl-opt.shin configuration similar toall.sh'scomponent_test_psa_crypto_config_accel_hash_use_psa, but without drivers and all hashes provided in software (so, essentially the default config minus things like PKCS5, PKCS12, etc.), and fix any failure that my arise - most likely undeclared dependencies (for example when loading password-protected keys). - [ ] Add a run of
ssl-opt.shat the end ofall.sh'scomponent_test_psa_crypto_config_accel_hash_use_psa. - [ ] Fix any failures that may arise.
- [ ] Ensure coverage parity (between runs before and after this PR, and between the above
all.shcomponent and a similar config with software hashes). This could be done by comparing the output of the script from theall.shcomponent of interest with a similar build, or by using the outcome files - seedocs/architecture/psa-migration/outcome-analysis.shwhich could be extended to coverssl-opt.sh.
Depends on: #6128, #6131