-
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
ssl-opt.sh: Fix getting the list of supported ciphersuites. #8561
ssl-opt.sh: Fix getting the list of supported ciphersuites. #8561
Conversation
Signed-off-by: Ronald Cron <[email protected]>
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 catching this! I'm approving, but that code is fragile so I'd prefer to add a sanity check.
tests/ssl-opt.sh
Outdated
@@ -358,7 +358,7 @@ requires_protocol_version() { | |||
|
|||
# Space-separated list of ciphersuites supported by this build of | |||
# Mbed TLS. | |||
P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | | |||
P_CIPHERSUITES=" $($P_CLI help_ciphersuites 2>/dev/null | |
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.
ssl_client2 --help
returns a nonzero status, but this did not cause the script to abort, despite using set -e
, because the nonzero status is on the left-hand side of a pipe and the status of the pipeline is just the status of the right-hand side. (The rationale for that design is to ignore SIGPIPE if it happens to the left-hand side.)
We should add some other sanity check here. We do expect at least one cipher suite:
if [ "$LIST_TESTS" -eq 0 ] && [ -z "${P_CIPHERSUITES# }" ]; then
echo >&2 "$0: fatal error: no cipher suites found!"
exit 125
fi
Signed-off-by: Ronald Cron <[email protected]>
Fix some dependencies on symmetric crypto that were not correct in case of driver but not builtin support. Revealed by "Analyze driver test_psa_crypto_config_accel_cipher_aead vs reference test_psa_crypto_config_reference_cipher_aead" in analyze_outcomes.py. Signed-off-by: Ronald Cron <[email protected]>
tests/ssl-opt.sh
Outdated
@@ -2332,7 +2341,7 @@ run_test "Opaque key for server authentication: invalid alg: ecdh with RSA ke | |||
requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | |||
requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | |||
requires_hash_alg SHA_256 | |||
requires_config_enabled MBEDTLS_CCM_C | |||
requires_config_enabled PSA_WANT_ALG_CCM |
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.
Is this line required? I thought that the automatic requirements for the cipher suite would take care of it.
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 not required, I have removed them.
Same test cases as in the previous commit. Remove the redundant symmetric crypto dependency. The dependency is ensured by the fact that: 1) the test case forces a cipher suite 2) ssl-opt.sh enforces automatically that the forced ciphersuite is available. 3) The fact that the forced ciphersuite is available implies that the symmetric cipher algorithm it uses is available as well. Signed-off-by: Ronald Cron <[email protected]>
Signed-off-by: Ronald Cron <[email protected]>
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
I could still see a lot of warnings of |
Description
Since the merge of #7844 (3.5.x not impacted) the detection of the supported ciphersuites in ssl-opt.sh is broken and some test cases are not run anymore. This PR fixes this.
PR checklist
Please tick as appropriate and edit the reasons (e.g.: "backport: not needed because this is a new feature")