Skip to content

Commit a739096

Browse files
author
Ben Taylor
committed
Remove ECDH from ssl-opt
Signed-off-by: Ben Taylor <[email protected]>
1 parent 43c74b5 commit a739096

File tree

1 file changed

+7
-56
lines changed

1 file changed

+7
-56
lines changed

tests/ssl-opt.sh

Lines changed: 7 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -433,14 +433,12 @@ requires_cipher_enabled() {
433433
# - $1 = command line (call to a TLS client or server program)
434434
# - $2 = client/server
435435
# - $3 = TLS version (TLS12 or TLS13)
436-
# - $4 = Use an external tool without ECDH support
437-
# - $5 = run test options
436+
# - $4 = run test options
438437
detect_required_features() {
439438
CMD_LINE=$1
440439
ROLE=$2
441440
TLS_VERSION=$3
442-
EXT_WO_ECDH=$4
443-
TEST_OPTIONS=${5:-}
441+
TEST_OPTIONS=${4:-}
444442

445443
case "$CMD_LINE" in
446444
*\ force_version=*)
@@ -520,24 +518,9 @@ detect_required_features() {
520518
else
521519
# For TLS12 requirements are different between server and client
522520
if [ "$ROLE" = "server" ]; then
523-
# If the server uses "server5*" certificates, then an ECDSA based
524-
# key exchange is required. However gnutls also does not
525-
# support ECDH, so this limit the choice to ECDHE-ECDSA
526-
if [ "$EXT_WO_ECDH" = "yes" ]; then
527-
requires_any_configs_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
528-
else
529-
requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT
530-
fi
521+
requires_any_configs_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
531522
elif [ "$ROLE" = "client" ]; then
532-
# On the client side it is enough to have any certificate
533-
# based authentication together with support for ECDSA.
534-
# Of course the GnuTLS limitation mentioned above applies
535-
# also here.
536-
if [ "$EXT_WO_ECDH" = "yes" ]; then
537-
requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH
538-
else
539-
requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT
540-
fi
523+
requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH
541524
requires_pk_alg "ECDSA"
542525
fi
543526
fi
@@ -799,10 +782,6 @@ requires_openssl_tls1_3_with_ffdh() {
799782
# skip next test if openssl cannot handle ephemeral key exchange
800783
requires_openssl_tls1_3_with_compatible_ephemeral() {
801784
requires_openssl_next
802-
803-
if !(is_config_enabled "PSA_WANT_ALG_ECDH"); then
804-
requires_openssl_tls1_3_with_ffdh
805-
fi
806785
}
807786

808787
# skip next test if tls1_3 is not available
@@ -1300,28 +1279,6 @@ is_gnutls() {
13001279
esac
13011280
}
13021281

1303-
# Some external tools (gnutls or openssl) might not have support for static ECDH
1304-
# and this limit the tests that can be run with them. This function checks server
1305-
# and client command lines, given as input, to verify if the current test
1306-
# is using one of these tools.
1307-
use_ext_tool_without_ecdh_support() {
1308-
case "$1" in
1309-
*$GNUTLS_SERV*|\
1310-
*${GNUTLS_NEXT_SERV:-"gnutls-serv-dummy"}*|\
1311-
*${OPENSSL_NEXT:-"openssl-dummy"}*)
1312-
echo "yes"
1313-
return;;
1314-
esac
1315-
case "$2" in
1316-
*$GNUTLS_CLI*|\
1317-
*${GNUTLS_NEXT_CLI:-"gnutls-cli-dummy"}*|\
1318-
*${OPENSSL_NEXT:-"openssl-dummy"}*)
1319-
echo "yes"
1320-
return;;
1321-
esac
1322-
echo "no"
1323-
}
1324-
13251282
# Generate random psk_list argument for ssl_server2
13261283
get_srv_psk_list ()
13271284
{
@@ -1808,26 +1765,20 @@ run_test() {
18081765
requires_config_enabled MBEDTLS_SSL_PROTO_DTLS
18091766
fi
18101767

1811-
# Check if we are trying to use an external tool which does not support ECDH
1812-
EXT_WO_ECDH=$(use_ext_tool_without_ecdh_support "$SRV_CMD" "$CLI_CMD")
18131768

18141769
# Guess the TLS version which is going to be used.
18151770
# Note that this detection is wrong in some cases, which causes unduly
18161771
# skipped test cases in builds with TLS 1.3 but not TLS 1.2.
18171772
# https://github.com/Mbed-TLS/mbedtls/issues/9560
1818-
if [ "$EXT_WO_ECDH" = "no" ]; then
1819-
TLS_VERSION=$(get_tls_version "$SRV_CMD" "$CLI_CMD")
1820-
else
1821-
TLS_VERSION="TLS12"
1822-
fi
1773+
TLS_VERSION="TLS12"
18231774

18241775
# If we're in a PSK-only build and the test can be adapted to PSK, do that.
18251776
maybe_adapt_for_psk "$@"
18261777

18271778
# If the client or server requires certain features that can be detected
18281779
# from their command-line arguments, check whether they're enabled.
1829-
detect_required_features "$SRV_CMD" "server" "$TLS_VERSION" "$EXT_WO_ECDH" "$@"
1830-
detect_required_features "$CLI_CMD" "client" "$TLS_VERSION" "$EXT_WO_ECDH" "$@"
1780+
detect_required_features "$SRV_CMD" "server" "$TLS_VERSION" "$@"
1781+
detect_required_features "$CLI_CMD" "client" "$TLS_VERSION" "$@"
18311782

18321783
# should we skip?
18331784
if [ "X$SKIP_NEXT" = "XYES" ]; then

0 commit comments

Comments
 (0)