Skip to content
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

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/ssl-opt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm Nov 23, 2023

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

grep 'TLS-\|TLS1-3' |
tr -s ' \n' ' ')"
requires_ciphersuite_enabled() {
Expand Down