Lines Matching +full:protocol +full:- +full:tests
3 # ssl-opt.sh
6 # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
10 # Executes tests to prove various TLS/SSL options and extensions.
16 # The tests assume a build with default options, with exceptions expressed
17 # with a dependency. The tests focus on functionality and do not consider
21 set -u
25 ulimit -f 20971520
38 : ${GNUTLS_CLI:=gnutls-cli}
39 : ${GNUTLS_SERV:=gnutls-serv}
54 if git diff --quiet ../include/mbedtls/mbedtls_config.h 2>/dev/null; then
62 : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"}
64 O_SRV="$OPENSSL s_server -www -cert data_files/server5.crt -key data_files/server5.key"
66 G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key"
67 G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt"
72 if [ -n "${OPENSSL_LEGACY:-}" ]; then
73 …O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.k…
80 if [ -n "${OPENSSL_NEXT:-}" ]; then
81 … O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key"
82 …O_NEXT_SRV_EARLY_DATA="$OPENSSL_NEXT s_server -early_data -cert data_files/server5.crt -key data_f…
83 O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www "
84 O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client -CAfile data_files/test-ca_cat12.crt"
94 if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then
95 …G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/serve…
102 if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then
103 G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt"
110 TESTS=0
125 # Pick a "unique" server port in the range 10000-19999, and a proxy
133 printf " -h|--help\tPrint this help.\n"
134 printf " -m|--memcheck\tCheck memory leaks and errors.\n"
135 printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n"
136 printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n"
137 printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n"
138 printf " -s|--show-numbers\tShow test numbers in front of test names\n"
139 printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n"
140 printf " --outcome-file\tFile where test outcomes are written\n"
142 printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n"
143 printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n"
144 printf " --seed \tInteger seed value to use for this test run\n"
148 while [ $# -gt 0 ]; do
150 -f|--filter)
153 -e|--exclude)
156 -m|--memcheck)
159 -n|--number)
162 -s|--show-numbers)
165 -p|--preserve-logs)
168 --outcome-file)
171 --port)
174 --proxy-port)
177 --seed)
180 -h|--help)
195 # testing. Skip non-boolean options (with something other than spaces
197 # space-separated list of symbols.
198 CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )"
199 # Skip next test; use this macro to skip tests which are legitimate
200 # in theory and expected to be re-introduced at some point, but
232 if ! $P_QUERY -all $*
239 if $P_QUERY -any $*
246 if ! $P_QUERY -any $*
253 if $P_QUERY -all $*
277 if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_2
280 elif ! $P_QUERY -all MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED
299 if [ -z "$VAL" ]; then
303 elif [ "$VAL" -lt "$2" ]; then
310 if [ -z "$VAL" ]; then
314 elif [ "$VAL" -gt "$2" ]; then
321 if [ -z "$VAL" ]; then
325 elif [ "$VAL" -ne "$2" ]; then
330 # Require Mbed TLS to support the given protocol version.
333 # * $1: protocol version in mbedtls syntax (argument to force_version=)
339 *) echo "Unknown required protocol version: $1"; exit 1;;
343 # Space-separated list of ciphersuites supported by this build of
345 P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null |
346 grep 'TLS-\|TLS1-3' |
347 tr -s ' \n' ' ')"
357 # - $1 = command line (call to a TLS client or server program)
358 # - $2 = client/server
359 # - $3 = TLS version (TLS12 or TLS13)
360 # - $4 = Use an external tool without ECDH support
361 # - $5 = run test options
367 TEST_OPTIONS=${5:-}
372 tmp="${tmp%%[!-0-9A-Z_a-z]*}"
379 tmp="${tmp%%[!-0-9A-Z_a-z]*}"
384 *[-_\ =]tickets=[^0]*)
388 *[-_\ =]alpn=*)
395 *dir-maxpath*)
404 # support ECDH, so this limit the choice to ECDHE-ECDSA
444 *openssl*) s='-psk abc123 -nocert';;
445 *gnutls-*) s='--pskkey=abc123';;
453 # If running in a PSK-only build, maybe adapt the test to use a pre-shared key.
455 # If not running in a PSK-only build, do nothing.
456 # If the test looks like it doesn't use a pre-shared key but can run with a
457 # pre-shared key, pass a pre-shared key. If the test looks like it can't run
458 # with a pre-shared key, skip it. If the test looks like it's already using
459 # a pre-shared key, do nothing.
461 # This code does not consider builds with ECDHE-PSK or RSA-PSK.
465 # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges).
469 # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments.
479 *[-_\ =]psk*|*[-_\ =]PSK*)
482 # The test case forces a non-PSK cipher suite. In some cases, a
487 *\ auth_mode=*|*[-_\ =]crt[_=]*)
556 echo "Unsupported hash alg - $1"
588 if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then
589 if $OPENSSL s_client -help 2>&1 | grep fallback_scsv >/dev/null
609 if [ -z "${GNUTLS_AVAILABLE:-}" ]; then
621 # skip next test if GnuTLS-next isn't available
623 if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then
624 if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then
635 # skip next test if OpenSSL-legacy isn't available
637 if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then
638 if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then
650 if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then
651 if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then
668 if [ -z "${OPENSSL_3_X_AVAILABLE:-}" ]; then
701 if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then
702 if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null
720 if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then
721 if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null
739 if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then
740 if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null
758 if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then
759 if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null
786 if [ -z "${HAS_IPV6:-}" ]; then
791 if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then
796 rm -r $SRV_OUT
806 if [ -z "${IS_I686:-}" ]; then
809 if [ -z "$(uname -a | grep i686)" ]; then
825 if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then
828 if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then
834 if [ "$MAX_OUT_LEN" -ne 16384 ]; then
841 if [ "$MEMCHECK" -gt 0 ]; then
848 if [ "$MEMCHECK" -eq 0 ]; then
865 TESTS=$(( $TESTS + 1 ))
868 if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then
869 LINE="$TESTS "
874 LEN=$(( 72 - `echo "$LINE" | wc -c` ))
880 # record_outcome <outcome> [<failure-reason>]
885 if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then
888 "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \
889 "$1" "${2-}" \
909 if [ $TIMES_LEFT -eq 0 ]; then
926 mv $SRV_OUT o-srv-${TESTS}.log
927 mv $CLI_OUT o-cli-${TESTS}.log
928 if [ -n "$PXY_CMD" ]; then
929 mv $PXY_OUT o-pxy-${TESTS}.log
931 echo " ! outputs saved to o-XXX-${TESTS}.log"
933 if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then
935 cat o-srv-${TESTS}.log
938 cat o-cli-${TESTS}.log
939 if [ -n "$PXY_CMD" ]; then
942 cat o-pxy-${TESTS}.log
959 # openssl s_server doesn't have -www with DTLS
962 *s_server*-dtls*)
964 SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";;
971 if [ $NEEDS_INPUT -eq 0 ]; then
983 if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" &&
984 grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null
998 if [ "$DTLS" -eq 1 ]; then
1005 SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t)
1011 if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then
1043 SERVER_HELLO_TIME="$(sed -n 's/.*server hello, current time: //p' < "$1")"
1049 if [ -z "$SERVER_HELLO_TIME" ]; then
1054 if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then
1057 elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then
1071 …MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*…
1074 if [ -z "$MEM_USAGE" ]; then
1095 if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then
1132 *dtls=1*|*-dtls*|*-u*) DTLS=1;;
1140 *gnutls-cli*)
1143 *gnutls-serv*)
1153 # and this limit the tests that can be run with them. This function checks server
1159 *${GNUTLS_NEXT_SERV:-"gnutls-serv-dummy"}*|\
1160 *${OPENSSL_NEXT:-"openssl-dummy"}*)
1166 *${GNUTLS_NEXT_CLI:-"gnutls-cli-dummy"}*|\
1167 *${OPENSSL_NEXT:-"openssl-dummy"}*)
1177 case $(( TESTS % 3 )) in
1205 case ${1-} in
1222 srv_pattern=$(grep -m 1 "$1" "$2");
1223 if [ -z "$srv_pattern" ]; then
1254 if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then
1267 if [ "$CMD_IS_GNUTLS" -eq 1 ]; then
1269 *--priority*) :;;
1270 *) SRV_CMD="$SRV_CMD --priority=NORMAL";;
1279 if [ "$CMD_IS_GNUTLS" -eq 1 ]; then
1281 *--priority*) :;;
1282 *) CLI_CMD="$CLI_CMD --priority=NORMAL";;
1287 if [ -n "$PXY_CMD" ]; then
1294 if [ "$MEMCHECK" -gt 0 ]; then
1296 SRV_CMD="valgrind --leak-check=full $SRV_CMD"
1299 CLI_CMD="valgrind --leak-check=full $CLI_CMD"
1319 if [ $TIMES_LEFT -gt 0 ] &&
1322 outcome="RETRY(client-timeout)"
1327 # (useful to avoid tests with only negative assertions and non-zero
1358 if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \
1359 \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ]
1368 while [ $# -gt 0 ]
1371 "-s")
1372 …if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null…
1378 "-c")
1379 …if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null…
1385 "-S")
1386 …if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null…
1394 "-C")
1395 …if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null…
1403 # The filtering in the following two options (-u and -U) do the following
1404 # - ignore valgrind output
1405 # - filter out everything but lines right after the pattern occurrences
1406 # - keep one of each non-unique line
1407 # - count how many lines remain
1408 …# A line with '--' will remain in the result from previous outputs, so the number of lines in the …
1410 "-U")
1411 …if [ $(grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | …
1417 "-u")
1418 …if [ $(grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | …
1423 "-F")
1429 "-f")
1435 "-g")
1450 if [ "$MEMCHECK" -gt 0 ]; then
1478 if [ -n "$PXY_CMD" ]; then
1508 if [ -n "$PXY_CMD" ]; then
1519 # for the sake of tests' filtering (especially in conjunction with the
1522 # - we can force a ciphersuite which contains "WITH" in its name, meaning
1524 # - etc etc
1562 if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_3
1570 # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]]
1571 # Options: -s pattern pattern that must be present in server output
1572 # -c pattern pattern that must be present in client output
1573 # -u pattern lines after pattern must be unique in client output
1574 # -f call shell function on client output
1575 # -S pattern pattern that must be absent in server output
1576 # -C pattern pattern that must be absent in client output
1577 # -U pattern lines after pattern must be unique in server output
1578 # -F call shell function on server output
1579 # -g call shell function on server and client output
1592 # Do we only run numbered tests?
1593 if [ -n "$RUN_TEST_NUMBER" ]; then
1595 *",$TESTS,"*) :;;
1601 if [ "X$1" = "X-p" ]; then
1622 if [ "$DTLS" -eq 1 ]; then
1637 # from their command-line arguments, check whether they're enabled.
1641 # If we're in a PSK-only build and the test can be adapted to PSK, do that.
1656 while [ $TIMES_LEFT -gt 0 ]; do
1657 TIMES_LEFT=$(( $TIMES_LEFT - 1 ))
1671 if [ "$PRESERVE_LOGS" -gt 0 ]; then
1672 mv $SRV_OUT o-srv-${TESTS}.log
1673 mv $CLI_OUT o-cli-${TESTS}.log
1674 if [ -n "$PXY_CMD" ]; then
1675 mv $PXY_OUT o-pxy-${TESTS}.log
1679 rm -f $SRV_OUT $CLI_OUT $PXY_OUT
1685 run_test "PSA-supported ciphersuite: $1" \
1689 -c "$maybe_calc_verify" \
1690 -c "calc PSA finished" \
1691 -s "$maybe_calc_verify" \
1692 -s "calc PSA finished" \
1693 -s "Protocol is TLSv1.2" \
1694 -c "Perform PSA-based ECDH computation."\
1695 -c "Perform PSA-based computation of digest of ServerKeyExchange" \
1696 -S "error" \
1697 -C "error"
1704 run_test "PSA - ECDH with $1" \
1706 … "$P_CLI debug_level=4 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 groups=$1" \
1708 -c "$maybe_calc_verify" \
1709 -c "calc PSA finished" \
1710 -s "$maybe_calc_verify" \
1711 -s "calc PSA finished" \
1712 -s "Protocol is TLSv1.2" \
1713 -c "Perform PSA-based ECDH computation."\
1714 -c "Perform PSA-based computation of digest of ServerKeyExchange" \
1715 -S "error" \
1716 -C "error"
1726 # The test passes if the difference is around 2*(16k-MFL)
1727 MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))"
1736 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \
1738 -F "handshake_memory_check $MEMORY_USAGE_LIMIT"
1746 # all tests in this sequence requires the same configuration (see requires_config_enabled())
1751 run_test "Handshake memory usage initial (MFL 16384 - default)" \
1755 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \
1757 -F "handshake_memory_get MEMORY_USAGE_MFL_16K"
1773 rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION
1774 rm -f context_srv.txt
1775 rm -f context_cli.txt
1776 test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1
1777 test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1
1778 test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1
1779 test -n "${DOG_PID:-}" && kill $DOG_PID >/dev/null 2>&1
1790 # to .../tests
1807 # (e.g. '-f "DTLS 1.2"').
1814 *) # No regexp or shell-pattern special character
1822 *) # No regexp or shell-pattern special character
1825 if [ -n "$need_grep" ]; then
1827 ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE"
1843 if [ ! -x "$P_SRV_BIN" ]; then
1847 if [ ! -x "$P_CLI_BIN" ]; then
1851 if [ ! -x "$P_PXY_BIN" ]; then
1855 if [ "$MEMCHECK" -gt 0 ]; then
1869 # We use somewhat arbitrary delays for tests:
1870 # - how long do we wait for the server to start (when lsof not available)?
1871 # - how long do we allow for the client to finish?
1875 # Note: without lsof, there is a trade-off between the running time of this
1879 if [ "$MEMCHECK" -gt 0 ]; then
1887 # some particular tests need more time:
1888 # - for the client, we multiply the usual watchdog limit by a factor
1889 # - for the server, we sleep for a number of seconds after the client exits
1901 O_SRV="$O_SRV -accept $SRV_PORT"
1902 O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT"
1903 G_SRV="$G_SRV -p $SRV_PORT"
1904 G_CLI="$G_CLI -p +SRV_PORT"
1906 if [ -n "${OPENSSL_LEGACY:-}" ]; then
1907 O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem"
1908 O_LEGACY_CLI="$O_LEGACY_CLI -connect 127.0.0.1:+SRV_PORT"
1912 # low-security ones. This covers not just cipher suites but also protocol
1916 # a way to discover it from -help, so check the openssl version.
1920 O_CLI="$O_CLI -cipher ALL@SECLEVEL=0"
1921 O_SRV="$O_SRV -cipher ALL@SECLEVEL=0"
1925 if [ -n "${OPENSSL_NEXT:-}" ]; then
1926 O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT"
1927 O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT"
1928 O_NEXT_SRV_EARLY_DATA="$O_NEXT_SRV_EARLY_DATA -accept $SRV_PORT"
1929 O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT"
1930 O_NEXT_CLI_NO_CERT="$O_NEXT_CLI_NO_CERT -connect 127.0.0.1:+SRV_PORT"
1933 if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then
1934 G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT"
1935 G_NEXT_SRV_NO_CERT="$G_NEXT_SRV_NO_CERT -p $SRV_PORT"
1938 if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then
1939 G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT"
1940 G_NEXT_CLI_NO_CERT="$G_NEXT_CLI_NO_CERT -p +SRV_PORT localhost"
1943 # Allow SHA-1, because many of our test certificates use it
1960 # - things work with all ciphersuites active (used with config-full in all.sh)
1961 # - the expected parameters are selected
1962 requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256
1970 -s "Protocol is TLSv1.2" \
1971 -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \
1972 -s "client hello v3, signature_algorithm ext: 6" \
1973 -s "ECDHE curve: x25519" \
1974 -S "error" \
1975 -C "error"
1978 requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256
1983 -s "Protocol is DTLSv1.2" \
1984 -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256"
2002 "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" \
2004 -c "Detected downgrade to TLS 1.2 from TLS 1.3"
2014 "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" \
2016 -s "Protocol is TLSv1.2" \
2017 -c "HTTP/1.0 200 OK"
2026 …"$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+VERS-TLS1.2:%DISABLE_TLS13_COMPAT…
2028 -s "Protocol is TLSv1.3" \
2029 -c "HTTP/1.0 200 OK"
2037 run_test "Server selecting TLS 1.3, over TLS 1.2 if supported - compat mode enabled" \
2039 "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+VERS-TLS1.2" \
2041 -s "Protocol is TLSv1.3" \
2042 -c "HTTP/1.0 200 OK"
2049 -s "Verifying peer X.509 certificate... ok"
2051 run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \
2053 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \
2055 -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \
2056 -c "Key size is 256"
2058 run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
2060 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
2062 -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
2063 -c "Key size is 128"
2094 -c "use CA callback for X.509 CRT verification" \
2095 -S "error" \
2096 -C "error"
2106 -c "use CA callback for X.509 CRT verification" \
2107 -s "Verifying peer X.509 certificate... ok" \
2108 -S "error" \
2109 -C "error"
2116 run_test "Opaque key for client authentication: ECDHE-ECDSA" \
2120 key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \
2122 -c "key type: Opaque" \
2123 -c "Ciphersuite is TLS-ECDHE-ECDSA" \
2124 -s "Verifying peer X.509 certificate... ok" \
2125 -s "Ciphersuite is TLS-ECDHE-ECDSA" \
2126 -S "error" \
2127 -C "error"
2135 run_test "Opaque key for client authentication: ECDHE-RSA" \
2136 "$P_SRV force_version=tls12 auth_mode=required crt_file=data_files/server2-sha256.crt \
2138 "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \
2139 key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \
2141 -c "key type: Opaque" \
2142 -c "Ciphersuite is TLS-ECDHE-RSA" \
2143 -s "Verifying peer X.509 certificate... ok" \
2144 -s "Ciphersuite is TLS-ECDHE-RSA" \
2145 -S "error" \
2146 -C "error"
2152 run_test "Opaque key for client authentication: DHE-RSA" \
2153 "$P_SRV force_version=tls12 auth_mode=required crt_file=data_files/server2-sha256.crt \
2155 "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \
2156 key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
2157 key_opaque_algs=rsa-sign-pkcs1,none" \
2159 -c "key type: Opaque" \
2160 -c "Ciphersuite is TLS-DHE-RSA" \
2161 -s "Verifying peer X.509 certificate... ok" \
2162 -s "Ciphersuite is TLS-DHE-RSA" \
2163 -S "error" \
2164 -C "error"
2171 run_test "Opaque key for server authentication: ECDHE-ECDSA" \
2173 key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \
2176 -c "Verifying peer X.509 certificate... ok" \
2177 -c "Ciphersuite is TLS-ECDHE-ECDSA" \
2178 -s "key types: Opaque, none" \
2179 -s "Ciphersuite is TLS-ECDHE-ECDSA" \
2180 -S "error" \
2181 -C "error"
2186 run_test "Opaque key for server authentication: ECDH-" \
2188 crt_file=data_files/server5.ku-ka.crt\
2192 -c "Verifying peer X.509 certificate... ok" \
2193 -c "Ciphersuite is TLS-ECDH-" \
2194 -s "key types: Opaque, none" \
2195 -s "Ciphersuite is TLS-ECDH-" \
2196 -S "error" \
2197 -C "error"
2205 key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \
2209 -s "key types: Opaque, none" \
2210 -s "error" \
2211 -c "error" \
2212 -c "Public key type mismatch"
2221 "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \
2226 -s "key types: Opaque, none" \
2227 -s "error" \
2228 -c "error" \
2229 -c "Public key type mismatch"
2237 key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \
2241 -s "key types: Opaque, none" \
2242 -s "got ciphersuites in common, but none of them usable" \
2243 -s "error" \
2244 -c "error"
2252 "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \
2257 -s "key types: Opaque, none" \
2258 -s "got ciphersuites in common, but none of them usable" \
2259 -s "error" \
2260 -c "error"
2266 run_test "Opaque key for server authentication: invalid alg: ECDHE-ECDSA with ecdh" \
2270 "$P_CLI force_version=tls12 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \
2272 -s "key types: Opaque, none" \
2273 -s "got ciphersuites in common, but none of them usable" \
2274 -s "error" \
2275 -c "error"
2282 run_test "Opaque keys for server authentication: EC keys with different algs, force ECDHE-ECDSA"…
2286 key_opaque_algs2=ecdsa-sign,none" \
2289 -c "Verifying peer X.509 certificate... ok" \
2290 -c "Ciphersuite is TLS-ECDHE-ECDSA" \
2291 -c "CN=Polarssl Test EC CA" \
2292 -s "key types: Opaque, Opaque" \
2293 -s "Ciphersuite is TLS-ECDHE-ECDSA" \
2294 -S "error" \
2295 -C "error"
2301 run_test "Opaque keys for server authentication: EC keys with different algs, force ECDH-ECDSA" \
2303 key_file=data_files/server7.key key_opaque_algs=ecdsa-sign,none \
2306 … "$P_CLI force_version=tls12 force_ciphersuite=TLS-ECDH-ECDSA-WITH-CAMELLIA-256-CBC-SHA384" \
2308 -c "Verifying peer X.509 certificate... ok" \
2309 -c "Ciphersuite is TLS-ECDH-ECDSA" \
2310 -c "CN=Polarssl Test EC CA" \
2311 -s "key types: Opaque, Opaque" \
2312 -s "Ciphersuite is TLS-ECDH-ECDSA" \
2313 -S "error" \
2314 -C "error"
2321 run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \
2323 key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \
2324 crt_file2=data_files/server2-sha256.crt \
2325 key_file2=data_files/server2.key key_opaque_algs2=rsa-sign-pkcs1,none" \
2326 "$P_CLI force_version=tls12 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \
2328 -c "Verifying peer X.509 certificate... ok" \
2329 -c "Ciphersuite is TLS-ECDHE-ECDSA" \
2330 -c "CN=Polarssl Test EC CA" \
2331 -s "key types: Opaque, Opaque" \
2332 -s "Ciphersuite is TLS-ECDHE-ECDSA" \
2333 -S "error" \
2334 -C "error"
2342 … "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs=rsa-decrypt,none" \
2343 "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \
2345 -c "key type: Opaque" \
2346 -s "key types: Opaque, Opaque" \
2347 -c "error" \
2348 -s "no suitable signature algorithm"
2356 … "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \
2357 "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \
2359 -c "key type: Opaque" \
2360 -s "key types: Opaque, Opaque" \
2361 -C "error" \
2362 -S "error"
2370 … "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs=rsa-sign-pss-sha512,none" \
2373 -s "key types: Opaque, Opaque" \
2374 -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \
2375 -s "CertificateVerify signature with rsa_pss_rsae_sha512" \
2376 -C "error" \
2377 -S "error" \
2385 …th_mode=required key_opaque=1 key_opaque_algs2=ecdsa-sign,none key_opaque_algs=rsa-decrypt,rsa-sig…
2386 "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \
2388 -c "key type: Opaque" \
2389 -s "key types: Opaque, Opaque" \
2390 -C "error" \
2391 -S "error" \
2399 run_test "Opaque key for server authentication: ECDHE-RSA" \
2400 "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \
2401 key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \
2404 -c "Verifying peer X.509 certificate... ok" \
2405 -c "Ciphersuite is TLS-ECDHE-RSA" \
2406 -s "key types: Opaque, none" \
2407 -s "Ciphersuite is TLS-ECDHE-RSA" \
2408 -S "error" \
2409 -C "error"
2415 run_test "Opaque key for server authentication: DHE-RSA" \
2416 "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \
2417 key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \
2418 "$P_CLI force_version=tls12 force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \
2420 -c "Verifying peer X.509 certificate... ok" \
2421 -c "Ciphersuite is TLS-DHE-RSA" \
2422 -s "key types: Opaque, none" \
2423 -s "Ciphersuite is TLS-DHE-RSA" \
2424 -S "error" \
2425 -C "error"
2431 run_test "Opaque key for server authentication: RSA-PSK" \
2432 "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \
2434 "$P_CLI force_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \
2437 -c "Verifying peer X.509 certificate... ok" \
2438 -c "Ciphersuite is TLS-RSA-PSK-" \
2439 -s "key types: Opaque, Opaque" \
2440 -s "Ciphersuite is TLS-RSA-PSK-" \
2441 -S "error" \
2442 -C "error"
2448 run_test "Opaque key for server authentication: RSA-" \
2449 "$P_SRV debug_level=3 key_opaque=1 key_opaque_algs=rsa-decrypt,none " \
2450 "$P_CLI force_version=tls12 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA256" \
2452 -c "Verifying peer X.509 certificate... ok" \
2453 -c "Ciphersuite is TLS-RSA-" \
2454 -s "key types: Opaque, Opaque" \
2455 -s "Ciphersuite is TLS-RSA-" \
2456 -S "error" \
2457 -C "error"
2463 run_test "Opaque key for server authentication: DHE-RSA, PSS instead of PKCS1" \
2464 "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \
2465 key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \
2466 "$P_CLI crt_file=data_files/server2-sha256.crt \
2467 key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \
2469 -s "key types: Opaque, none" \
2470 -s "got ciphersuites in common, but none of them usable" \
2471 -s "error" \
2472 -c "error"
2481 …$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \
2482 key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none \
2484 key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \
2487 -c "Verifying peer X.509 certificate... ok" \
2488 -c "Ciphersuite is TLS-ECDHE-RSA" \
2489 -c "CN=Polarssl Test EC CA" \
2490 -s "key types: Opaque, Opaque" \
2491 -s "Ciphersuite is TLS-ECDHE-RSA" \
2492 -S "error" \
2493 -C "error"
2501 run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \
2503 key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \
2505 key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \
2506 "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \
2508 -c "Verifying peer X.509 certificate... ok" \
2509 -c "Ciphersuite is TLS-DHE-RSA" \
2510 -c "CN=Polarssl Test EC CA" \
2511 -s "key types: Opaque, Opaque" \
2512 -s "Ciphersuite is TLS-DHE-RSA" \
2513 -S "error" \
2514 -C "error"
2521 run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \
2523 key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \
2525 key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \
2527 -c "key type: Opaque" \
2528 -c "Verifying peer X.509 certificate... ok" \
2529 -c "Ciphersuite is TLS-ECDHE-ECDSA" \
2530 -s "key types: Opaque, none" \
2531 -s "Verifying peer X.509 certificate... ok" \
2532 -s "Ciphersuite is TLS-ECDHE-ECDSA" \
2533 -S "error" \
2534 -C "error"
2542 run_test "Opaque key for client/server authentication: ECDHE-RSA" \
2543 "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \
2544 key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \
2545 "$P_CLI force_version=tls12 key_opaque=1 crt_file=data_files/server2-sha256.crt \
2546 key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \
2548 -c "key type: Opaque" \
2549 -c "Verifying peer X.509 certificate... ok" \
2550 -c "Ciphersuite is TLS-ECDHE-RSA" \
2551 -s "key types: Opaque, none" \
2552 -s "Verifying peer X.509 certificate... ok" \
2553 -s "Ciphersuite is TLS-ECDHE-RSA" \
2554 -S "error" \
2555 -C "error"
2561 run_test "Opaque key for client/server authentication: DHE-RSA" \
2562 "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \
2563 key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \
2564 "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \
2565 key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none \
2566 force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \
2568 -c "key type: Opaque" \
2569 -c "Verifying peer X.509 certificate... ok" \
2570 -c "Ciphersuite is TLS-DHE-RSA" \
2571 -s "key types: Opaque, none" \
2572 -s "Verifying peer X.509 certificate... ok" \
2573 -s "Ciphersuite is TLS-DHE-RSA" \
2574 -S "error" \
2575 -C "error"
2580 run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM
2581 run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8
2582 run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM
2583 run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8
2584 run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
2585 run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384
2586 run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA
2587 run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256
2588 run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384
2607 ## (https://github.com/Mbed-TLS/mbedtls/issues/3541),
2610 ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet.
2624 -f "check_server_hello_time" \
2625 -F "check_server_hello_time"
2630 … "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \
2632 -u "IV used" \
2633 -U "IV used"
2648 -c "Supported Signature Algorithm found: 04 03"
2657 "$O_CLI -cert data_files/server6.crt \
2658 -key data_files/server6.key" \
2661 # Tests for certificate verification callback
2662 run_test "Configuration-specific CRT verification callback" \
2666 -S "error" \
2667 -c "Verify requested for " \
2668 -c "Use configuration-specific verification callback" \
2669 -C "Use context-specific verification callback" \
2670 -C "error"
2672 run_test "Context-specific CRT verification callback" \
2676 -S "error" \
2677 -c "Verify requested for " \
2678 -c "Use context-specific verification callback" \
2679 -C "Use configuration-specific verification callback" \
2680 -C "error"
2682 # Tests for SHA-1 support
2683 run_test "SHA-1 forbidden by default in server certificate" \
2687 -c "The certificate is signed with an unacceptable hash"
2689 run_test "SHA-1 explicitly allowed in server certificate" \
2694 run_test "SHA-256 allowed by default in server certificate" \
2695 "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \
2699 run_test "SHA-1 forbidden by default in client certificate" \
2701 "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \
2703 -s "The certificate is signed with an unacceptable hash"
2705 run_test "SHA-1 explicitly allowed in client certificate" \
2707 "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \
2710 run_test "SHA-256 allowed by default in client certificate" \
2712 "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \
2715 # Tests for datagram packing
2721 -c "next record in same datagram" \
2722 -s "next record in same datagram"
2729 -s "next record in same datagram" \
2730 -C "next record in same datagram"
2737 -S "next record in same datagram" \
2738 -c "next record in same datagram"
2745 -S "next record in same datagram" \
2746 -C "next record in same datagram"
2748 # Tests for Context serialization
2753 … "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
2755 -c "Deserializing connection..." \
2756 -S "Deserializing connection..."
2761 …P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA2…
2763 -c "Deserializing connection..." \
2764 -S "Deserializing connection..."
2769 …"$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \
2771 -c "Deserializing connection..." \
2772 -S "Deserializing connection..."
2781 -c "Deserializing connection..." \
2782 -S "Deserializing connection..."
2787 … "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
2789 -C "Deserializing connection..." \
2790 -s "Deserializing connection..."
2795 …P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA2…
2797 -C "Deserializing connection..." \
2798 -s "Deserializing connection..."
2803 …"$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \
2805 -C "Deserializing connection..." \
2806 -s "Deserializing connection..."
2815 -C "Deserializing connection..." \
2816 -s "Deserializing connection..."
2821 … "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
2823 -c "Deserializing connection..." \
2824 -s "Deserializing connection..."
2829 …P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA2…
2831 -c "Deserializing connection..." \
2832 -s "Deserializing connection..."
2837 …"$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \
2839 -c "Deserializing connection..." \
2840 -s "Deserializing connection..."
2849 -c "Deserializing connection..." \
2850 -s "Deserializing connection..."
2853 run_test "Context serialization, re-init, client serializes, CCM" \
2855 … "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
2857 -c "Deserializing connection..." \
2858 -S "Deserializing connection..."
2862 run_test "Context serialization, re-init, client serializes, ChaChaPoly" \
2864 …P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA2…
2866 -c "Deserializing connection..." \
2867 -S "Deserializing connection..."
2870 run_test "Context serialization, re-init, client serializes, GCM" \
2872 …"$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \
2874 -c "Deserializing connection..." \
2875 -S "Deserializing connection..."
2880 run_test "Context serialization, re-init, client serializes, with CID" \
2884 -c "Deserializing connection..." \
2885 -S "Deserializing connection..."
2888 run_test "Context serialization, re-init, server serializes, CCM" \
2890 … "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
2892 -C "Deserializing connection..." \
2893 -s "Deserializing connection..."
2896 run_test "Context serialization, re-init, server serializes, ChaChaPoly" \
2898 …P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA2…
2900 -C "Deserializing connection..." \
2901 -s "Deserializing connection..."
2904 run_test "Context serialization, re-init, server serializes, GCM" \
2906 …P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA2…
2908 -C "Deserializing connection..." \
2909 -s "Deserializing connection..."
2914 run_test "Context serialization, re-init, server serializes, with CID" \
2918 -C "Deserializing connection..." \
2919 -s "Deserializing connection..."
2922 run_test "Context serialization, re-init, both serialize, CCM" \
2924 … "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
2926 -c "Deserializing connection..." \
2927 -s "Deserializing connection..."
2930 run_test "Context serialization, re-init, both serialize, ChaChaPoly" \
2932 …P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA2…
2934 -c "Deserializing connection..." \
2935 -s "Deserializing connection..."
2938 run_test "Context serialization, re-init, both serialize, GCM" \
2940 …P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA2…
2942 -c "Deserializing connection..." \
2943 -s "Deserializing connection..."
2948 run_test "Context serialization, re-init, both serialize, with CID" \
2952 -c "Deserializing connection..." \
2953 -s "Deserializing connection..."
2961 -s "Save serialized context to a file... ok" \
2962 -c "Save serialized context to a file... ok"
2963 rm -f context_srv.txt
2964 rm -f context_cli.txt
2966 # Tests for DTLS Connection ID extension
2978 -s "Disable use of CID extension." \
2979 -s "found CID extension" \
2980 -s "Client sent CID extension, but CID disabled" \
2981 -c "Enable use of CID extension." \
2982 -c "client hello, adding CID extension" \
2983 -S "server hello, adding CID extension" \
2984 -C "found CID extension" \
2985 -S "Copy CIDs into SSL transform" \
2986 -C "Copy CIDs into SSL transform" \
2987 -c "Use of Connection ID was rejected by the server"
2995 -c "Disable use of CID extension." \
2996 -C "client hello, adding CID extension" \
2997 -S "found CID extension" \
2998 -s "Enable use of CID extension." \
2999 -S "server hello, adding CID extension" \
3000 -C "found CID extension" \
3001 -S "Copy CIDs into SSL transform" \
3002 -C "Copy CIDs into SSL transform" \
3003 -s "Use of Connection ID was not offered by client"
3011 -c "Enable use of CID extension." \
3012 -s "Enable use of CID extension." \
3013 -c "client hello, adding CID extension" \
3014 -s "found CID extension" \
3015 -s "Use of CID extension negotiated" \
3016 -s "server hello, adding CID extension" \
3017 -c "found CID extension" \
3018 -c "Use of CID extension negotiated" \
3019 -s "Copy CIDs into SSL transform" \
3020 -c "Copy CIDs into SSL transform" \
3021 -c "Peer CID (length 2 Bytes): de ad" \
3022 -s "Peer CID (length 2 Bytes): be ef" \
3023 -s "Use of Connection ID has been negotiated" \
3024 -c "Use of Connection ID has been negotiated"
3029 -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \
3033 -c "Enable use of CID extension." \
3034 -s "Enable use of CID extension." \
3035 -c "client hello, adding CID extension" \
3036 -s "found CID extension" \
3037 -s "Use of CID extension negotiated" \
3038 -s "server hello, adding CID extension" \
3039 -c "found CID extension" \
3040 -c "Use of CID extension negotiated" \
3041 -s "Copy CIDs into SSL transform" \
3042 -c "Copy CIDs into SSL transform" \
3043 -c "Peer CID (length 2 Bytes): de ad" \
3044 -s "Peer CID (length 2 Bytes): be ef" \
3045 -s "Use of Connection ID has been negotiated" \
3046 -c "Use of Connection ID has been negotiated" \
3047 -c "ignoring unexpected CID" \
3048 -s "ignoring unexpected CID"
3053 -p "$P_PXY mtu=800" \
3057 -c "Enable use of CID extension." \
3058 -s "Enable use of CID extension." \
3059 -c "client hello, adding CID extension" \
3060 -s "found CID extension" \
3061 -s "Use of CID extension negotiated" \
3062 -s "server hello, adding CID extension" \
3063 -c "found CID extension" \
3064 -c "Use of CID extension negotiated" \
3065 -s "Copy CIDs into SSL transform" \
3066 -c "Copy CIDs into SSL transform" \
3067 -c "Peer CID (length 2 Bytes): de ad" \
3068 -s "Peer CID (length 2 Bytes): be ef" \
3069 -s "Use of Connection ID has been negotiated" \
3070 -c "Use of Connection ID has been negotiated"
3075 -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \
3079 -c "Enable use of CID extension." \
3080 -s "Enable use of CID extension." \
3081 -c "client hello, adding CID extension" \
3082 -s "found CID extension" \
3083 -s "Use of CID extension negotiated" \
3084 -s "server hello, adding CID extension" \
3085 -c "found CID extension" \
3086 -c "Use of CID extension negotiated" \
3087 -s "Copy CIDs into SSL transform" \
3088 -c "Copy CIDs into SSL transform" \
3089 -c "Peer CID (length 2 Bytes): de ad" \
3090 -s "Peer CID (length 2 Bytes): be ef" \
3091 -s "Use of Connection ID has been negotiated" \
3092 -c "Use of Connection ID has been negotiated" \
3093 -c "ignoring unexpected CID" \
3094 -s "ignoring unexpected CID"
3102 -c "Enable use of CID extension." \
3103 -s "Enable use of CID extension." \
3104 -c "client hello, adding CID extension" \
3105 -s "found CID extension" \
3106 -s "Use of CID extension negotiated" \
3107 -s "server hello, adding CID extension" \
3108 -c "found CID extension" \
3109 -c "Use of CID extension negotiated" \
3110 -s "Copy CIDs into SSL transform" \
3111 -c "Copy CIDs into SSL transform" \
3112 -c "Peer CID (length 4 Bytes): de ad be ef" \
3113 -s "Peer CID (length 0 Bytes):" \
3114 -s "Use of Connection ID has been negotiated" \
3115 -c "Use of Connection ID has been negotiated"
3123 -c "Enable use of CID extension." \
3124 -s "Enable use of CID extension." \
3125 -c "client hello, adding CID extension" \
3126 -s "found CID extension" \
3127 -s "Use of CID extension negotiated" \
3128 -s "server hello, adding CID extension" \
3129 -c "found CID extension" \
3130 -c "Use of CID extension negotiated" \
3131 -s "Copy CIDs into SSL transform" \
3132 -c "Copy CIDs into SSL transform" \
3133 -s "Peer CID (length 4 Bytes): de ad be ef" \
3134 -c "Peer CID (length 0 Bytes):" \
3135 -s "Use of Connection ID has been negotiated" \
3136 -c "Use of Connection ID has been negotiated"
3144 -c "Enable use of CID extension." \
3145 -s "Enable use of CID extension." \
3146 -c "client hello, adding CID extension" \
3147 -s "found CID extension" \
3148 -s "Use of CID extension negotiated" \
3149 -s "server hello, adding CID extension" \
3150 -c "found CID extension" \
3151 -c "Use of CID extension negotiated" \
3152 -s "Copy CIDs into SSL transform" \
3153 -c "Copy CIDs into SSL transform" \
3154 -S "Use of Connection ID has been negotiated" \
3155 -C "Use of Connection ID has been negotiated"
3158 run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CCM-8" \
3160 …CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
3162 -c "Enable use of CID extension." \
3163 -s "Enable use of CID extension." \
3164 -c "client hello, adding CID extension" \
3165 -s "found CID extension" \
3166 -s "Use of CID extension negotiated" \
3167 -s "server hello, adding CID extension" \
3168 -c "found CID extension" \
3169 -c "Use of CID extension negotiated" \
3170 -s "Copy CIDs into SSL transform" \
3171 -c "Copy CIDs into SSL transform" \
3172 -c "Peer CID (length 2 Bytes): de ad" \
3173 -s "Peer CID (length 2 Bytes): be ef" \
3174 -s "Use of Connection ID has been negotiated" \
3175 -c "Use of Connection ID has been negotiated"
3178 run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CCM-8" \
3180 … "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
3182 -c "Enable use of CID extension." \
3183 -s "Enable use of CID extension." \
3184 -c "client hello, adding CID extension" \
3185 -s "found CID extension" \
3186 -s "Use of CID extension negotiated" \
3187 -s "server hello, adding CID extension" \
3188 -c "found CID extension" \
3189 -c "Use of CID extension negotiated" \
3190 -s "Copy CIDs into SSL transform" \
3191 -c "Copy CIDs into SSL transform" \
3192 -c "Peer CID (length 4 Bytes): de ad be ef" \
3193 -s "Peer CID (length 0 Bytes):" \
3194 -s "Use of Connection ID has been negotiated" \
3195 -c "Use of Connection ID has been negotiated"
3198 run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CCM-8" \
3200 …debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
3202 -c "Enable use of CID extension." \
3203 -s "Enable use of CID extension." \
3204 -c "client hello, adding CID extension" \
3205 -s "found CID extension" \
3206 -s "Use of CID extension negotiated" \
3207 -s "server hello, adding CID extension" \
3208 -c "found CID extension" \
3209 -c "Use of CID extension negotiated" \
3210 -s "Copy CIDs into SSL transform" \
3211 -c "Copy CIDs into SSL transform" \
3212 -s "Peer CID (length 4 Bytes): de ad be ef" \
3213 -c "Peer CID (length 0 Bytes):" \
3214 -s "Use of Connection ID has been negotiated" \
3215 -c "Use of Connection ID has been negotiated"
3218 run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CCM-8" \
3220 … "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
3222 -c "Enable use of CID extension." \
3223 -s "Enable use of CID extension." \
3224 -c "client hello, adding CID extension" \
3225 -s "found CID extension" \
3226 -s "Use of CID extension negotiated" \
3227 -s "server hello, adding CID extension" \
3228 -c "found CID extension" \
3229 -c "Use of CID extension negotiated" \
3230 -s "Copy CIDs into SSL transform" \
3231 -c "Copy CIDs into SSL transform" \
3232 -S "Use of Connection ID has been negotiated" \
3233 -C "Use of Connection ID has been negotiated"
3236 run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CBC" \
3238 …debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256"…
3240 -c "Enable use of CID extension." \
3241 -s "Enable use of CID extension." \
3242 -c "client hello, adding CID extension" \
3243 -s "found CID extension" \
3244 -s "Use of CID extension negotiated" \
3245 -s "server hello, adding CID extension" \
3246 -c "found CID extension" \
3247 -c "Use of CID extension negotiated" \
3248 -s "Copy CIDs into SSL transform" \
3249 -c "Copy CIDs into SSL transform" \
3250 -c "Peer CID (length 2 Bytes): de ad" \
3251 -s "Peer CID (length 2 Bytes): be ef" \
3252 -s "Use of Connection ID has been negotiated" \
3253 -c "Use of Connection ID has been negotiated"
3256 run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CBC" \
3258 … "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \
3260 -c "Enable use of CID extension." \
3261 -s "Enable use of CID extension." \
3262 -c "client hello, adding CID extension" \
3263 -s "found CID extension" \
3264 -s "Use of CID extension negotiated" \
3265 -s "server hello, adding CID extension" \
3266 -c "found CID extension" \
3267 -c "Use of CID extension negotiated" \
3268 -s "Copy CIDs into SSL transform" \
3269 -c "Copy CIDs into SSL transform" \
3270 -c "Peer CID (length 4 Bytes): de ad be ef" \
3271 -s "Peer CID (length 0 Bytes):" \
3272 -s "Use of Connection ID has been negotiated" \
3273 -c "Use of Connection ID has been negotiated"
3276 run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CBC" \
3278 …g_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256"…
3280 -c "Enable use of CID extension." \
3281 -s "Enable use of CID extension." \
3282 -c "client hello, adding CID extension" \
3283 -s "found CID extension" \
3284 -s "Use of CID extension negotiated" \
3285 -s "server hello, adding CID extension" \
3286 -c "found CID extension" \
3287 -c "Use of CID extension negotiated" \
3288 -s "Copy CIDs into SSL transform" \
3289 -c "Copy CIDs into SSL transform" \
3290 -s "Peer CID (length 4 Bytes): de ad be ef" \
3291 -c "Peer CID (length 0 Bytes):" \
3292 -s "Use of Connection ID has been negotiated" \
3293 -c "Use of Connection ID has been negotiated"
3296 run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CBC" \
3298 … "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \
3300 -c "Enable use of CID extension." \
3301 -s "Enable use of CID extension." \
3302 -c "client hello, adding CID extension" \
3303 -s "found CID extension" \
3304 -s "Use of CID extension negotiated" \
3305 -s "server hello, adding CID extension" \
3306 -c "found CID extension" \
3307 -c "Use of CID extension negotiated" \
3308 -s "Copy CIDs into SSL transform" \
3309 -c "Copy CIDs into SSL transform" \
3310 -S "Use of Connection ID has been negotiated" \
3311 -C "Use of Connection ID has been negotiated"
3320 -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
3321 -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
3322 -s "(initial handshake) Use of Connection ID has been negotiated" \
3323 -c "(initial handshake) Use of Connection ID has been negotiated" \
3324 -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
3325 -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
3326 -s "(after renegotiation) Use of Connection ID has been negotiated" \
3327 -c "(after renegotiation) Use of Connection ID has been negotiated"
3336 -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
3337 -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
3338 -s "(initial handshake) Use of Connection ID has been negotiated" \
3339 -c "(initial handshake) Use of Connection ID has been negotiated" \
3340 -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
3341 -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
3342 -s "(after renegotiation) Use of Connection ID has been negotiated" \
3343 -c "(after renegotiation) Use of Connection ID has been negotiated"
3352 -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
3353 -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
3354 -s "(initial handshake) Use of Connection ID has been negotiated" \
3355 -c "(initial handshake) Use of Connection ID has been negotiated" \
3356 -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
3357 -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
3358 -s "(after renegotiation) Use of Connection ID has been negotiated" \
3359 -c "(after renegotiation) Use of Connection ID has been negotiated"
3365 -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \
3369 -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
3370 -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
3371 -s "(initial handshake) Use of Connection ID has been negotiated" \
3372 -c "(initial handshake) Use of Connection ID has been negotiated" \
3373 -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
3374 -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
3375 -s "(after renegotiation) Use of Connection ID has been negotiated" \
3376 -c "(after renegotiation) Use of Connection ID has been negotiated" \
3377 -c "ignoring unexpected CID" \
3378 -s "ignoring unexpected CID"
3387 -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
3388 -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
3389 -s "(initial handshake) Use of Connection ID has been negotiated" \
3390 -c "(initial handshake) Use of Connection ID has been negotiated" \
3391 -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
3392 -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
3393 -C "(after renegotiation) Use of Connection ID has been negotiated" \
3394 -S "(after renegotiation) Use of Connection ID has been negotiated"
3403 -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
3404 -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
3405 -s "(initial handshake) Use of Connection ID has been negotiated" \
3406 -c "(initial handshake) Use of Connection ID has been negotiated" \
3407 -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
3408 -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
3409 -C "(after renegotiation) Use of Connection ID has been negotiated" \
3410 -S "(after renegotiation) Use of Connection ID has been negotiated"
3416 -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \
3420 -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
3421 -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
3422 -s "(initial handshake) Use of Connection ID has been negotiated" \
3423 -c "(initial handshake) Use of Connection ID has been negotiated" \
3424 -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
3425 -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
3426 -C "(after renegotiation) Use of Connection ID has been negotiated" \
3427 -S "(after renegotiation) Use of Connection ID has been negotiated" \
3428 -c "ignoring unexpected CID" \
3429 -s "ignoring unexpected CID"
3438 -S "(initial handshake) Use of Connection ID has been negotiated" \
3439 -C "(initial handshake) Use of Connection ID has been negotiated" \
3440 -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
3441 -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
3442 -c "(after renegotiation) Use of Connection ID has been negotiated" \
3443 -s "(after renegotiation) Use of Connection ID has been negotiated"
3452 -S "(initial handshake) Use of Connection ID has been negotiated" \
3453 -C "(initial handshake) Use of Connection ID has been negotiated" \
3454 -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
3455 -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
3456 -c "(after renegotiation) Use of Connection ID has been negotiated" \
3457 -s "(after renegotiation) Use of Connection ID has been negotiated"
3463 -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \
3467 -S "(initial handshake) Use of Connection ID has been negotiated" \
3468 -C "(initial handshake) Use of Connection ID has been negotiated" \
3469 -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
3470 -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
3471 -c "(after renegotiation) Use of Connection ID has been negotiated" \
3472 -s "(after renegotiation) Use of Connection ID has been negotiated" \
3473 -c "ignoring unexpected CID" \
3474 -s "ignoring unexpected CID"
3483 -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
3484 -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
3485 -s "(initial handshake) Use of Connection ID has been negotiated" \
3486 -c "(initial handshake) Use of Connection ID has been negotiated" \
3487 -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
3488 -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
3489 -C "(after renegotiation) Use of Connection ID has been negotiated" \
3490 -S "(after renegotiation) Use of Connection ID has been negotiated" \
3491 -s "(after renegotiation) Use of Connection ID was not offered by client"
3497 -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \
3501 -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
3502 -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
3503 -s "(initial handshake) Use of Connection ID has been negotiated" \
3504 -c "(initial handshake) Use of Connection ID has been negotiated" \
3505 -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
3506 -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
3507 -C "(after renegotiation) Use of Connection ID has been negotiated" \
3508 -S "(after renegotiation) Use of Connection ID has been negotiated" \
3509 -s "(after renegotiation) Use of Connection ID was not offered by client" \
3510 -c "ignoring unexpected CID" \
3511 -s "ignoring unexpected CID"
3520 -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
3521 -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
3522 -s "(initial handshake) Use of Connection ID has been negotiated" \
3523 -c "(initial handshake) Use of Connection ID has been negotiated" \
3524 -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
3525 -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
3526 -C "(after renegotiation) Use of Connection ID has been negotiated" \
3527 -S "(after renegotiation) Use of Connection ID has been negotiated" \
3528 -c "(after renegotiation) Use of Connection ID was rejected by the server"
3534 -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \
3538 -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
3539 -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
3540 -s "(initial handshake) Use of Connection ID has been negotiated" \
3541 -c "(initial handshake) Use of Connection ID has been negotiated" \
3542 -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \
3543 -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \
3544 -C "(after renegotiation) Use of Connection ID has been negotiated" \
3545 -S "(after renegotiation) Use of Connection ID has been negotiated" \
3546 -c "(after renegotiation) Use of Connection ID was rejected by the server" \
3547 -c "ignoring unexpected CID" \
3548 -s "ignoring unexpected CID"
3551 # tests check that the buffer contents are reallocated when the message is
3558 …"$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_v…
3560 -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
3561 -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
3562 -s "(initial handshake) Use of Connection ID has been negotiated" \
3563 -c "(initial handshake) Use of Connection ID has been negotiated" \
3564 -s "Reallocating in_buf" \
3565 -s "Reallocating out_buf"
3572 …"$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_…
3574 -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \
3575 -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \
3576 -s "(initial handshake) Use of Connection ID has been negotiated" \
3577 -c "(initial handshake) Use of Connection ID has been negotiated" \
3578 -s "Reallocating in_buf" \
3579 -s "Reallocating out_buf"
3581 # Tests for Encrypt-then-MAC extension
3585 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
3588 -c "client hello, adding encrypt_then_mac extension" \
3589 -s "found encrypt then mac extension" \
3590 -s "server hello, adding encrypt then mac extension" \
3591 -c "found encrypt_then_mac extension" \
3592 -c "using encrypt then mac" \
3593 -s "using encrypt then mac"
3597 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
3600 -c "client hello, adding encrypt_then_mac extension" \
3601 -s "found encrypt then mac extension" \
3602 -S "server hello, adding encrypt then mac extension" \
3603 -C "found encrypt_then_mac extension" \
3604 -C "using encrypt then mac" \
3605 -S "using encrypt then mac"
3609 force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \
3612 -c "client hello, adding encrypt_then_mac extension" \
3613 -s "found encrypt then mac extension" \
3614 -S "server hello, adding encrypt then mac extension" \
3615 -C "found encrypt_then_mac extension" \
3616 -C "using encrypt then mac" \
3617 -S "using encrypt then mac"
3621 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
3624 -C "client hello, adding encrypt_then_mac extension" \
3625 -S "found encrypt then mac extension" \
3626 -S "server hello, adding encrypt then mac extension" \
3627 -C "found encrypt_then_mac extension" \
3628 -C "using encrypt then mac" \
3629 -S "using encrypt then mac"
3631 # Tests for Extended Master Secret extension
3638 -c "client hello, adding extended_master_secret extension" \
3639 -s "found extended master secret extension" \
3640 -s "server hello, adding extended master secret extension" \
3641 -c "found extended_master_secret extension" \
3642 -c "session hash for extended master secret" \
3643 -s "session hash for extended master secret"
3650 -c "client hello, adding extended_master_secret extension" \
3651 -s "found extended master secret extension" \
3652 -S "server hello, adding extended master secret extension" \
3653 -C "found extended_master_secret extension" \
3654 -C "session hash for extended master secret" \
3655 -S "session hash for extended master secret"
3662 -C "client hello, adding extended_master_secret extension" \
3663 -S "found extended master secret extension" \
3664 -S "server hello, adding extended master secret extension" \
3665 -C "found extended_master_secret extension" \
3666 -C "session hash for extended master secret" \
3667 -S "session hash for extended master secret"
3673 …"$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \
3675 -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \
3676 -s "dumping 'input payload after decrypt' (0 bytes)" \
3677 -c "0 bytes written in 1 fragments"
3684 -s "dumping 'input payload after decrypt' (0 bytes)" \
3685 -c "0 bytes written in 1 fragments"
3689 …_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls…
3691 -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \
3692 -s "dumping 'input payload after decrypt' (0 bytes)" \
3693 -c "0 bytes written in 1 fragments"
3700 -s "dumping 'input payload after decrypt' (0 bytes)" \
3701 -c "0 bytes written in 1 fragments"
3703 # Tests for CBC 1/n-1 record splitting
3707 "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \
3710 -s "Read from client: 123 bytes read" \
3711 -S "Read from client: 1 bytes read" \
3712 -S "122 bytes read"
3714 # Tests for Session Tickets
3720 -c "client hello, adding session ticket extension" \
3721 -s "found session ticket extension" \
3722 -s "server hello, adding session ticket extension" \
3723 -c "found session_ticket extension" \
3724 -c "parse new session ticket" \
3725 -S "session successfully restored from cache" \
3726 -s "session successfully restored from ticket" \
3727 -s "a session has been resumed" \
3728 -c "a session has been resumed"
3734 -c "client hello, adding session ticket extension" \
3735 -s "found session ticket extension" \
3736 -s "server hello, adding session ticket extension" \
3737 -c "found session_ticket extension" \
3738 -c "parse new session ticket" \
3739 -S "session successfully restored from cache" \
3740 -s "session successfully restored from ticket" \
3741 -s "a session has been resumed" \
3742 -c "a session has been resumed"
3748 -c "client hello, adding session ticket extension" \
3749 -s "found session ticket extension" \
3750 -s "server hello, adding session ticket extension" \
3751 -c "found session_ticket extension" \
3752 -c "parse new session ticket" \
3753 -S "session successfully restored from cache" \
3754 -s "session successfully restored from ticket" \
3755 -s "a session has been resumed" \
3756 -c "a session has been resumed"
3762 -c "client hello, adding session ticket extension" \
3763 -s "found session ticket extension" \
3764 -s "server hello, adding session ticket extension" \
3765 -c "found session_ticket extension" \
3766 -c "parse new session ticket" \
3767 -S "session successfully restored from cache" \
3768 -S "session successfully restored from ticket" \
3769 -S "a session has been resumed" \
3770 -C "a session has been resumed"
3776 -c "client hello, adding session ticket extension" \
3777 -s "found session ticket extension" \
3778 -s "server hello, adding session ticket extension" \
3779 -c "found session_ticket extension" \
3780 -c "parse new session ticket" \
3781 -S "session successfully restored from cache" \
3782 -s "session successfully restored from ticket" \
3783 -s "a session has been resumed" \
3784 -c "a session has been resumed"
3788 "$O_SRV -tls1_2" \
3791 -c "client hello, adding session ticket extension" \
3792 -c "found session_ticket extension" \
3793 -c "parse new session ticket" \
3794 -c "a session has been resumed"
3799 "( $O_CLI -sess_out $SESSION; \
3800 $O_CLI -sess_in $SESSION; \
3801 rm -f $SESSION )" \
3803 -s "found session ticket extension" \
3804 -s "server hello, adding session ticket extension" \
3805 -S "session successfully restored from cache" \
3806 -s "session successfully restored from ticket" \
3807 -s "a session has been resumed"
3809 run_test "Session resume using tickets: AES-128-GCM" \
3810 "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \
3813 -c "client hello, adding session ticket extension" \
3814 -s "found session ticket extension" \
3815 -s "server hello, adding session ticket extension" \
3816 -c "found session_ticket extension" \
3817 -c "parse new session ticket" \
3818 -S "session successfully restored from cache" \
3819 -s "session successfully restored from ticket" \
3820 -s "a session has been resumed" \
3821 -c "a session has been resumed"
3823 run_test "Session resume using tickets: AES-192-GCM" \
3824 "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \
3827 -c "client hello, adding session ticket extension" \
3828 -s "found session ticket extension" \
3829 -s "server hello, adding session ticket extension" \
3830 -c "found session_ticket extension" \
3831 -c "parse new session ticket" \
3832 -S "session successfully restored from cache" \
3833 -s "session successfully restored from ticket" \
3834 -s "a session has been resumed" \
3835 -c "a session has been resumed"
3837 run_test "Session resume using tickets: AES-128-CCM" \
3838 "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \
3841 -c "client hello, adding session ticket extension" \
3842 -s "found session ticket extension" \
3843 -s "server hello, adding session ticket extension" \
3844 -c "found session_ticket extension" \
3845 -c "parse new session ticket" \
3846 -S "session successfully restored from cache" \
3847 -s "session successfully restored from ticket" \
3848 -s "a session has been resumed" \
3849 -c "a session has been resumed"
3851 run_test "Session resume using tickets: AES-192-CCM" \
3852 "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \
3855 -c "client hello, adding session ticket extension" \
3856 -s "found session ticket extension" \
3857 -s "server hello, adding session ticket extension" \
3858 -c "found session_ticket extension" \
3859 -c "parse new session ticket" \
3860 -S "session successfully restored from cache" \
3861 -s "session successfully restored from ticket" \
3862 -s "a session has been resumed" \
3863 -c "a session has been resumed"
3865 run_test "Session resume using tickets: AES-256-CCM" \
3866 "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \
3869 -c "client hello, adding session ticket extension" \
3870 -s "found session ticket extension" \
3871 -s "server hello, adding session ticket extension" \
3872 -c "found session_ticket extension" \
3873 -c "parse new session ticket" \
3874 -S "session successfully restored from cache" \
3875 -s "session successfully restored from ticket" \
3876 -s "a session has been resumed" \
3877 -c "a session has been resumed"
3879 run_test "Session resume using tickets: CAMELLIA-128-CCM" \
3880 "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \
3883 -c "client hello, adding session ticket extension" \
3884 -s "found session ticket extension" \
3885 -s "server hello, adding session ticket extension" \
3886 -c "found session_ticket extension" \
3887 -c "parse new session ticket" \
3888 -S "session successfully restored from cache" \
3889 -s "session successfully restored from ticket" \
3890 -s "a session has been resumed" \
3891 -c "a session has been resumed"
3893 run_test "Session resume using tickets: CAMELLIA-192-CCM" \
3894 "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \
3897 -c "client hello, adding session ticket extension" \
3898 -s "found session ticket extension" \
3899 -s "server hello, adding session ticket extension" \
3900 -c "found session_ticket extension" \
3901 -c "parse new session ticket" \
3902 -S "session successfully restored from cache" \
3903 -s "session successfully restored from ticket" \
3904 -s "a session has been resumed" \
3905 -c "a session has been resumed"
3907 run_test "Session resume using tickets: CAMELLIA-256-CCM" \
3908 "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \
3911 -c "client hello, adding session ticket extension" \
3912 -s "found session ticket extension" \
3913 -s "server hello, adding session ticket extension" \
3914 -c "found session_ticket extension" \
3915 -c "parse new session ticket" \
3916 -S "session successfully restored from cache" \
3917 -s "session successfully restored from ticket" \
3918 -s "a session has been resumed" \
3919 -c "a session has been resumed"
3921 run_test "Session resume using tickets: ARIA-128-GCM" \
3922 "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \
3925 -c "client hello, adding session ticket extension" \
3926 -s "found session ticket extension" \
3927 -s "server hello, adding session ticket extension" \
3928 -c "found session_ticket extension" \
3929 -c "parse new session ticket" \
3930 -S "session successfully restored from cache" \
3931 -s "session successfully restored from ticket" \
3932 -s "a session has been resumed" \
3933 -c "a session has been resumed"
3935 run_test "Session resume using tickets: ARIA-192-GCM" \
3936 "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \
3939 -c "client hello, adding session ticket extension" \
3940 -s "found session ticket extension" \
3941 -s "server hello, adding session ticket extension" \
3942 -c "found session_ticket extension" \
3943 -c "parse new session ticket" \
3944 -S "session successfully restored from cache" \
3945 -s "session successfully restored from ticket" \
3946 -s "a session has been resumed" \
3947 -c "a session has been resumed"
3949 run_test "Session resume using tickets: ARIA-256-GCM" \
3950 "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \
3953 -c "client hello, adding session ticket extension" \
3954 -s "found session ticket extension" \
3955 -s "server hello, adding session ticket extension" \
3956 -c "found session_ticket extension" \
3957 -c "parse new session ticket" \
3958 -S "session successfully restored from cache" \
3959 -s "session successfully restored from ticket" \
3960 -s "a session has been resumed" \
3961 -c "a session has been resumed"
3963 run_test "Session resume using tickets: ARIA-128-CCM" \
3964 "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \
3967 -c "client hello, adding session ticket extension" \
3968 -s "found session ticket extension" \
3969 -s "server hello, adding session ticket extension" \
3970 -c "found session_ticket extension" \
3971 -c "parse new session ticket" \
3972 -S "session successfully restored from cache" \
3973 -s "session successfully restored from ticket" \
3974 -s "a session has been resumed" \
3975 -c "a session has been resumed"
3977 run_test "Session resume using tickets: ARIA-192-CCM" \
3978 "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \
3981 -c "client hello, adding session ticket extension" \
3982 -s "found session ticket extension" \
3983 -s "server hello, adding session ticket extension" \
3984 -c "found session_ticket extension" \
3985 -c "parse new session ticket" \
3986 -S "session successfully restored from cache" \
3987 -s "session successfully restored from ticket" \
3988 -s "a session has been resumed" \
3989 -c "a session has been resumed"
3991 run_test "Session resume using tickets: ARIA-256-CCM" \
3992 "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \
3995 -c "client hello, adding session ticket extension" \
3996 -s "found session ticket extension" \
3997 -s "server hello, adding session ticket extension" \
3998 -c "found session_ticket extension" \
3999 -c "parse new session ticket" \
4000 -S "session successfully restored from cache" \
4001 -s "session successfully restored from ticket" \
4002 -s "a session has been resumed" \
4003 -c "a session has been resumed"
4005 run_test "Session resume using tickets: CHACHA20-POLY1305" \
4006 "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \
4009 -c "client hello, adding session ticket extension" \
4010 -s "found session ticket extension" \
4011 -s "server hello, adding session ticket extension" \
4012 -c "found session_ticket extension" \
4013 -c "parse new session ticket" \
4014 -S "session successfully restored from cache" \
4015 -s "session successfully restored from ticket" \
4016 -s "a session has been resumed" \
4017 -c "a session has been resumed"
4019 # Tests for Session Tickets with DTLS
4026 -c "client hello, adding session ticket extension" \
4027 -s "found session ticket extension" \
4028 -s "server hello, adding session ticket extension" \
4029 -c "found session_ticket extension" \
4030 -c "parse new session ticket" \
4031 -S "session successfully restored from cache" \
4032 -s "session successfully restored from ticket" \
4033 -s "a session has been resumed" \
4034 -c "a session has been resumed"
4041 -c "client hello, adding session ticket extension" \
4042 -s "found session ticket extension" \
4043 -s "server hello, adding session ticket extension" \
4044 -c "found session_ticket extension" \
4045 -c "parse new session ticket" \
4046 -S "session successfully restored from cache" \
4047 -s "session successfully restored from ticket" \
4048 -s "a session has been resumed" \
4049 -c "a session has been resumed"
4056 -c "client hello, adding session ticket extension" \
4057 -s "found session ticket extension" \
4058 -s "server hello, adding session ticket extension" \
4059 -c "found session_ticket extension" \
4060 -c "parse new session ticket" \
4061 -S "session successfully restored from cache" \
4062 -S "session successfully restored from ticket" \
4063 -S "a session has been resumed" \
4064 -C "a session has been resumed"
4071 -c "client hello, adding session ticket extension" \
4072 -s "found session ticket extension" \
4073 -s "server hello, adding session ticket extension" \
4074 -c "found session_ticket extension" \
4075 -c "parse new session ticket" \
4076 -S "session successfully restored from cache" \
4077 -s "session successfully restored from ticket" \
4078 -s "a session has been resumed" \
4079 -c "a session has been resumed"
4083 "$O_SRV -dtls" \
4086 -c "client hello, adding session ticket extension" \
4087 -c "found session_ticket extension" \
4088 -c "parse new session ticket" \
4089 -c "a session has been resumed"
4097 "( $O_NEXT_CLI -dtls -sess_out $SESSION; \
4098 $O_NEXT_CLI -dtls -sess_in $SESSION; \
4099 rm -f $SESSION )" \
4101 -s "found session ticket extension" \
4102 -s "server hello, adding session ticket extension" \
4103 -S "session successfully restored from cache" \
4104 -s "session successfully restored from ticket" \
4105 -s "a session has been resumed"
4107 # Tests for Session Resume based on session-ID and cache
4114 -c "client hello, adding session ticket extension" \
4115 -s "found session ticket extension" \
4116 -S "server hello, adding session ticket extension" \
4117 -C "found session_ticket extension" \
4118 -C "parse new session ticket" \
4119 -s "session successfully restored from cache" \
4120 -S "session successfully restored from ticket" \
4121 -s "a session has been resumed" \
4122 -c "a session has been resumed"
4129 -C "client hello, adding session ticket extension" \
4130 -S "found session ticket extension" \
4131 -S "server hello, adding session ticket extension" \
4132 -C "found session_ticket extension" \
4133 -C "parse new session ticket" \
4134 -s "session successfully restored from cache" \
4135 -S "session successfully restored from ticket" \
4136 -s "a session has been resumed" \
4137 -c "a session has been resumed"
4144 -S "session successfully restored from cache" \
4145 -S "session successfully restored from ticket" \
4146 -S "a session has been resumed" \
4147 -C "a session has been resumed"
4154 -s "session successfully restored from cache" \
4155 -S "session successfully restored from ticket" \
4156 -s "a session has been resumed" \
4157 -c "a session has been resumed"
4164 -C "client hello, adding session ticket extension" \
4165 -S "found session ticket extension" \
4166 -S "server hello, adding session ticket extension" \
4167 -C "found session_ticket extension" \
4168 -C "parse new session ticket" \
4169 -S "session successfully restored from cache" \
4170 -S "session successfully restored from ticket" \
4171 -S "a session has been resumed" \
4172 -C "a session has been resumed"
4180 -s "session successfully restored from cache" \
4181 -S "session successfully restored from ticket" \
4182 -s "a session has been resumed" \
4183 -c "a session has been resumed"
4190 -S "session successfully restored from cache" \
4191 -S "session successfully restored from ticket" \
4192 -S "a session has been resumed" \
4193 -C "a session has been resumed"
4200 -s "session successfully restored from cache" \
4201 -S "session successfully restored from ticket" \
4202 -s "a session has been resumed" \
4203 -c "a session has been resumed"
4210 -s "session successfully restored from cache" \
4211 -S "session successfully restored from ticket" \
4212 -s "a session has been resumed" \
4213 -c "a session has been resumed"
4218 "( $O_CLI -sess_out $SESSION; \
4219 $O_CLI -sess_in $SESSION; \
4220 rm -f $SESSION )" \
4222 -s "found session ticket extension" \
4223 -S "server hello, adding session ticket extension" \
4224 -s "session successfully restored from cache" \
4225 -S "session successfully restored from ticket" \
4226 -s "a session has been resumed"
4231 "$O_SRV -tls1_2" \
4234 -C "found session_ticket extension" \
4235 -C "parse new session ticket" \
4236 -c "a session has been resumed"
4238 # Tests for Session resume and extensions
4246 -c "Enable use of CID extension." \
4247 -s "Enable use of CID extension." \
4248 -c "client hello, adding CID extension" \
4249 -s "found CID extension" \
4250 -s "Use of CID extension negotiated" \
4251 -s "server hello, adding CID extension" \
4252 -c "found CID extension" \
4253 -c "Use of CID extension negotiated" \
4254 -s "Copy CIDs into SSL transform" \
4255 -c "Copy CIDs into SSL transform" \
4256 -c "Peer CID (length 2 Bytes): de ad" \
4257 -s "Peer CID (length 2 Bytes): be ef" \
4258 -s "Use of Connection ID has been negotiated" \
4259 -c "Use of Connection ID has been negotiated"
4261 # Tests for Session Resume based on session-ID and cache, DTLS
4269 -c "client hello, adding session ticket extension" \
4270 -s "found session ticket extension" \
4271 -S "server hello, adding session ticket extension" \
4272 -C "found session_ticket extension" \
4273 -C "parse new session ticket" \
4274 -s "session successfully restored from cache" \
4275 -S "session successfully restored from ticket" \
4276 -s "a session has been resumed" \
4277 -c "a session has been resumed"
4285 -C "client hello, adding session ticket extension" \
4286 -S "found session ticket extension" \
4287 -S "server hello, adding session ticket extension" \
4288 -C "found session_ticket extension" \
4289 -C "parse new session ticket" \
4290 -s "session successfully restored from cache" \
4291 -S "session successfully restored from ticket" \
4292 -s "a session has been resumed" \
4293 -c "a session has been resumed"
4301 -S "session successfully restored from cache" \
4302 -S "session successfully restored from ticket" \
4303 -S "a session has been resumed" \
4304 -C "a session has been resumed"
4312 -s "session successfully restored from cache" \
4313 -S "session successfully restored from ticket" \
4314 -s "a session has been resumed" \
4315 -c "a session has been resumed"
4323 -s "session successfully restored from cache" \
4324 -S "session successfully restored from ticket" \
4325 -s "a session has been resumed" \
4326 -c "a session has been resumed"
4334 -S "session successfully restored from cache" \
4335 -S "session successfully restored from ticket" \
4336 -S "a session has been resumed" \
4337 -C "a session has been resumed"
4345 -s "session successfully restored from cache" \
4346 -S "session successfully restored from ticket" \
4347 -s "a session has been resumed" \
4348 -c "a session has been resumed"
4356 -s "session successfully restored from cache" \
4357 -S "session successfully restored from ticket" \
4358 -s "a session has been resumed" \
4359 -c "a session has been resumed"
4368 "( $O_NEXT_CLI -dtls -sess_out $SESSION; \
4369 $O_NEXT_CLI -dtls -sess_in $SESSION; \
4370 rm -f $SESSION )" \
4372 -s "found session ticket extension" \
4373 -S "server hello, adding session ticket extension" \
4374 -s "session successfully restored from cache" \
4375 -S "session successfully restored from ticket" \
4376 -s "a session has been resumed"
4381 "$O_SRV -dtls" \
4384 -C "found session_ticket extension" \
4385 -C "parse new session ticket" \
4386 -c "a session has been resumed"
4388 # Tests for Max Fragment Length extension
4396 -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \
4397 -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \
4398 -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \
4399 -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \
4400 -C "client hello, adding max_fragment_length extension" \
4401 -S "found max fragment length extension" \
4402 -S "server hello, max_fragment_length extension" \
4403 -C "found max_fragment_length extension"
4411 -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \
4412 -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \
4413 -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \
4414 -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \
4415 -C "client hello, adding max_fragment_length extension" \
4416 -S "found max fragment length extension" \
4417 -S "server hello, max_fragment_length extension" \
4418 -C "found max_fragment_length extension" \
4419 -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \
4420 -s "$MAX_CONTENT_LEN bytes read" \
4421 -s "1 bytes read"
4429 -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \
4430 -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \
4431 -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \
4432 -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \
4433 -C "client hello, adding max_fragment_length extension" \
4434 -S "found max fragment length extension" \
4435 -S "server hello, max_fragment_length extension" \
4436 -C "found max_fragment_length extension" \
4437 -c "fragment larger than.*maximum "
4439 # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled
4449 -C "Maximum incoming record payload length is 16384" \
4450 -C "Maximum outgoing record payload length is 16384" \
4451 -S "Maximum incoming record payload length is 16384" \
4452 -S "Maximum outgoing record payload length is 16384" \
4453 -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \
4454 -s "$MAX_CONTENT_LEN bytes read" \
4455 -s "1 bytes read"
4463 -C "Maximum incoming record payload length is 16384" \
4464 -C "Maximum outgoing record payload length is 16384" \
4465 -S "Maximum incoming record payload length is 16384" \
4466 -S "Maximum outgoing record payload length is 16384" \
4467 -c "fragment larger than.*maximum "
4475 -c "Maximum incoming record payload length is 4096" \
4476 -c "Maximum outgoing record payload length is 4096" \
4477 -s "Maximum incoming record payload length is 4096" \
4478 -s "Maximum outgoing record payload length is 4096" \
4479 -c "client hello, adding max_fragment_length extension" \
4480 -s "found max fragment length extension" \
4481 -s "server hello, max_fragment_length extension" \
4482 -c "found max_fragment_length extension"
4490 -c "Maximum incoming record payload length is 512" \
4491 -c "Maximum outgoing record payload length is 512" \
4492 -s "Maximum incoming record payload length is 512" \
4493 -s "Maximum outgoing record payload length is 512" \
4494 -c "client hello, adding max_fragment_length extension" \
4495 -s "found max fragment length extension" \
4496 -s "server hello, max_fragment_length extension" \
4497 -c "found max_fragment_length extension"
4505 -c "Maximum incoming record payload length is 512" \
4506 -c "Maximum outgoing record payload length is 512" \
4507 -s "Maximum incoming record payload length is 512" \
4508 -s "Maximum outgoing record payload length is 512" \
4509 -c "client hello, adding max_fragment_length extension" \
4510 -s "found max fragment length extension" \
4511 -s "server hello, max_fragment_length extension" \
4512 -c "found max_fragment_length extension"
4520 -c "Maximum incoming record payload length is 512" \
4521 -c "Maximum outgoing record payload length is 512" \
4522 -s "Maximum incoming record payload length is 512" \
4523 -s "Maximum outgoing record payload length is 512" \
4524 -c "client hello, adding max_fragment_length extension" \
4525 -s "found max fragment length extension" \
4526 -s "server hello, max_fragment_length extension" \
4527 -c "found max_fragment_length extension"
4535 -c "Maximum incoming record payload length is 1024" \
4536 -c "Maximum outgoing record payload length is 1024" \
4537 -s "Maximum incoming record payload length is 1024" \
4538 -s "Maximum outgoing record payload length is 512" \
4539 -c "client hello, adding max_fragment_length extension" \
4540 -s "found max fragment length extension" \
4541 -s "server hello, max_fragment_length extension" \
4542 -c "found max_fragment_length extension"
4550 -c "Maximum incoming record payload length is 1024" \
4551 -c "Maximum outgoing record payload length is 1024" \
4552 -s "Maximum incoming record payload length is 1024" \
4553 -s "Maximum outgoing record payload length is 1024" \
4554 -c "client hello, adding max_fragment_length extension" \
4555 -s "found max fragment length extension" \
4556 -s "server hello, max_fragment_length extension" \
4557 -c "found max_fragment_length extension"
4565 -c "Maximum incoming record payload length is 1024" \
4566 -c "Maximum outgoing record payload length is 1024" \
4567 -s "Maximum incoming record payload length is 1024" \
4568 -s "Maximum outgoing record payload length is 1024" \
4569 -c "client hello, adding max_fragment_length extension" \
4570 -s "found max fragment length extension" \
4571 -s "server hello, max_fragment_length extension" \
4572 -c "found max_fragment_length extension"
4580 -c "Maximum incoming record payload length is 2048" \
4581 -c "Maximum outgoing record payload length is 2048" \
4582 -s "Maximum incoming record payload length is 2048" \
4583 -s "Maximum outgoing record payload length is 512" \
4584 -c "client hello, adding max_fragment_length extension" \
4585 -s "found max fragment length extension" \
4586 -s "server hello, max_fragment_length extension" \
4587 -c "found max_fragment_length extension"
4595 -c "Maximum incoming record payload length is 2048" \
4596 -c "Maximum outgoing record payload length is 2048" \
4597 -s "Maximum incoming record payload length is 2048" \
4598 -s "Maximum outgoing record payload length is 1024" \
4599 -c "client hello, adding max_fragment_length extension" \
4600 -s "found max fragment length extension" \
4601 -s "server hello, max_fragment_length extension" \
4602 -c "found max_fragment_length extension"
4610 -c "Maximum incoming record payload length is 2048" \
4611 -c "Maximum outgoing record payload length is 2048" \
4612 -s "Maximum incoming record payload length is 2048" \
4613 -s "Maximum outgoing record payload length is 2048" \
4614 -c "client hello, adding max_fragment_length extension" \
4615 -s "found max fragment length extension" \
4616 -s "server hello, max_fragment_length extension" \
4617 -c "found max_fragment_length extension"
4625 -c "Maximum incoming record payload length is 4096" \
4626 -c "Maximum outgoing record payload length is 4096" \
4627 -s "Maximum incoming record payload length is 4096" \
4628 -s "Maximum outgoing record payload length is 512" \
4629 -c "client hello, adding max_fragment_length extension" \
4630 -s "found max fragment length extension" \
4631 -s "server hello, max_fragment_length extension" \
4632 -c "found max_fragment_length extension"
4640 -c "Maximum incoming record payload length is 4096" \
4641 -c "Maximum outgoing record payload length is 4096" \
4642 -s "Maximum incoming record payload length is 4096" \
4643 -s "Maximum outgoing record payload length is 1024" \
4644 -c "client hello, adding max_fragment_length extension" \
4645 -s "found max fragment length extension" \
4646 -s "server hello, max_fragment_length extension" \
4647 -c "found max_fragment_length extension"
4655 -c "Maximum incoming record payload length is 4096" \
4656 -c "Maximum outgoing record payload length is 4096" \
4657 -s "Maximum incoming record payload length is 4096" \
4658 -s "Maximum outgoing record payload length is 2048" \
4659 -c "client hello, adding max_fragment_length extension" \
4660 -s "found max fragment length extension" \
4661 -s "server hello, max_fragment_length extension" \
4662 -c "found max_fragment_length extension"
4670 -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \
4671 -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \
4672 -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \
4673 -s "Maximum outgoing record payload length is 4096" \
4674 -C "client hello, adding max_fragment_length extension" \
4675 -S "found max fragment length extension" \
4676 -S "server hello, max_fragment_length extension" \
4677 -C "found max_fragment_length extension"
4684 "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \
4687 -c "Maximum incoming record payload length is 4096" \
4688 -c "Maximum outgoing record payload length is 4096" \
4689 -c "client hello, adding max_fragment_length extension" \
4690 -c "found max_fragment_length extension"
4698 -c "Maximum incoming record payload length is 2048" \
4699 -c "Maximum outgoing record payload length is 2048" \
4700 -s "Maximum incoming record payload length is 2048" \
4701 -s "Maximum outgoing record payload length is 2048" \
4702 -c "client hello, adding max_fragment_length extension" \
4703 -s "found max fragment length extension" \
4704 -s "server hello, max_fragment_length extension" \
4705 -c "found max_fragment_length extension" \
4706 -c "2048 bytes written in 1 fragments" \
4707 -s "2048 bytes read"
4715 -c "Maximum incoming record payload length is 2048" \
4716 -c "Maximum outgoing record payload length is 2048" \
4717 -s "Maximum incoming record payload length is 2048" \
4718 -s "Maximum outgoing record payload length is 2048" \
4719 -c "client hello, adding max_fragment_length extension" \
4720 -s "found max fragment length extension" \
4721 -s "server hello, max_fragment_length extension" \
4722 -c "found max_fragment_length extension" \
4723 -c "2345 bytes written in 2 fragments" \
4724 -s "2048 bytes read" \
4725 -s "297 bytes read"
4734 -c "Maximum incoming record payload length is 2048" \
4735 -c "Maximum outgoing record payload length is 2048" \
4736 -s "Maximum incoming record payload length is 2048" \
4737 -s "Maximum outgoing record payload length is 2048" \
4738 -c "client hello, adding max_fragment_length extension" \
4739 -s "found max fragment length extension" \
4740 -s "server hello, max_fragment_length extension" \
4741 -c "found max_fragment_length extension" \
4742 -c "fragment larger than.*maximum"
4744 # Tests for Record Size Limit extension
4749 run_test "Record Size Limit: TLS 1.3: Server-side parsing, debug output and fatal alert" \
4751 "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4" \
4753 -c "Preparing extension (Record Size Limit/28) for 'client hello'" \
4754 -c "Sending extension Record Size Limit/28 (2 bytes)" \
4755 -s "ClientHello: record_size_limit(28) extension received."\
4756 -s "found record_size_limit extension" \
4757 -s "RecordSizeLimit: 16385 Bytes" \
4758 -c "Received alert \[110]: An unsupported extension was sent"
4764 run_test "Record Size Limit: TLS 1.3: Client-side parsing, debug output and fatal alert" \
4765 …"$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%DISABLE_TLS13_COMPAT_MODE --dis…
4768 -s "Preparing extension (Record Size Limit/28) for 'encrypted extensions'"
4771 # -s "Parsing extension 'Record Size Limit/28 (2 bytes)" \
4772 # -s "Sending extension Record Size Limit/28 (2 bytes)" \
4773 # -c "EncryptedExtensions: record_size_limit(28) extension received."\
4774 # -c "found record_size_limit extension" \
4775 # -c "RecordSizeLimit: 16385 Bytes" \
4776 # -s "Received alert \[110]: An unsupported extension was sent"
4778 # Tests for renegotiation
4785 -C "client hello, adding renegotiation extension" \
4786 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
4787 -S "found renegotiation extension" \
4788 -s "server hello, secure renegotiation extension" \
4789 -c "found renegotiation extension" \
4790 -C "=> renegotiate" \
4791 -S "=> renegotiate" \
4792 -S "write hello request"
4795 run_test "Renegotiation: client-initiated" \
4799 -c "client hello, adding renegotiation extension" \
4800 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
4801 -s "found renegotiation extension" \
4802 -s "server hello, secure renegotiation extension" \
4803 -c "found renegotiation extension" \
4804 -c "=> renegotiate" \
4805 -s "=> renegotiate" \
4806 -S "write hello request"
4809 run_test "Renegotiation: server-initiated" \
4813 -c "client hello, adding renegotiation extension" \
4814 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
4815 -s "found renegotiation extension" \
4816 -s "server hello, secure renegotiation extension" \
4817 -c "found renegotiation extension" \
4818 -c "=> renegotiate" \
4819 -s "=> renegotiate" \
4820 -s "write hello request"
4822 # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that
4824 # algorithm stronger than SHA-1 is enabled in mbedtls_config.h
4826 run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \
4830 -c "client hello, adding renegotiation extension" \
4831 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
4832 -s "found renegotiation extension" \
4833 -s "server hello, secure renegotiation extension" \
4834 -c "found renegotiation extension" \
4835 -c "=> renegotiate" \
4836 -s "=> renegotiate" \
4837 -S "write hello request" \
4838 -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated?
4840 # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that
4842 # algorithm stronger than SHA-1 is enabled in mbedtls_config.h
4844 run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \
4848 -c "client hello, adding renegotiation extension" \
4849 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
4850 -s "found renegotiation extension" \
4851 -s "server hello, secure renegotiation extension" \
4852 -c "found renegotiation extension" \
4853 -c "=> renegotiate" \
4854 -s "=> renegotiate" \
4855 -s "write hello request" \
4856 -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated?
4863 -c "client hello, adding renegotiation extension" \
4864 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
4865 -s "found renegotiation extension" \
4866 -s "server hello, secure renegotiation extension" \
4867 -c "found renegotiation extension" \
4868 -c "=> renegotiate" \
4869 -s "=> renegotiate" \
4870 -s "write hello request"
4877 …gotiation=1 renegotiate=1 max_frag_len=2048 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \
4879 -c "Maximum incoming record payload length is 2048" \
4880 -c "Maximum outgoing record payload length is 2048" \
4881 -s "Maximum incoming record payload length is 2048" \
4882 -s "Maximum outgoing record payload length is 512" \
4883 -c "client hello, adding max_fragment_length extension" \
4884 -s "found max fragment length extension" \
4885 -s "server hello, max_fragment_length extension" \
4886 -c "found max_fragment_length extension" \
4887 -c "client hello, adding renegotiation extension" \
4888 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
4889 -s "found renegotiation extension" \
4890 -s "server hello, secure renegotiation extension" \
4891 -c "found renegotiation extension" \
4892 -c "=> renegotiate" \
4893 -s "=> renegotiate" \
4894 -s "write hello request"
4897 run_test "Renegotiation: client-initiated, server-rejected" \
4901 -c "client hello, adding renegotiation extension" \
4902 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
4903 -S "found renegotiation extension" \
4904 -s "server hello, secure renegotiation extension" \
4905 -c "found renegotiation extension" \
4906 -c "=> renegotiate" \
4907 -S "=> renegotiate" \
4908 -S "write hello request" \
4909 -c "SSL - Unexpected message at ServerHello in renegotiation" \
4910 -c "failed"
4913 run_test "Renegotiation: server-initiated, client-rejected, default" \
4917 -C "client hello, adding renegotiation extension" \
4918 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
4919 -S "found renegotiation extension" \
4920 -s "server hello, secure renegotiation extension" \
4921 -c "found renegotiation extension" \
4922 -C "=> renegotiate" \
4923 -S "=> renegotiate" \
4924 -s "write hello request" \
4925 -S "SSL - An unexpected message was received from our peer" \
4926 -S "failed"
4929 run_test "Renegotiation: server-initiated, client-rejected, not enforced" \
4931 renego_delay=-1 auth_mode=optional" \
4934 -C "client hello, adding renegotiation extension" \
4935 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
4936 -S "found renegotiation extension" \
4937 -s "server hello, secure renegotiation extension" \
4938 -c "found renegotiation extension" \
4939 -C "=> renegotiate" \
4940 -S "=> renegotiate" \
4941 -s "write hello request" \
4942 -S "SSL - An unexpected message was received from our peer" \
4943 -S "failed"
4947 run_test "Renegotiation: server-initiated, client-rejected, delay 2" \
4952 -C "client hello, adding renegotiation extension" \
4953 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
4954 -S "found renegotiation extension" \
4955 -s "server hello, secure renegotiation extension" \
4956 -c "found renegotiation extension" \
4957 -C "=> renegotiate" \
4958 -S "=> renegotiate" \
4959 -s "write hello request" \
4960 -S "SSL - An unexpected message was received from our peer" \
4961 -S "failed"
4964 run_test "Renegotiation: server-initiated, client-rejected, delay 0" \
4969 -C "client hello, adding renegotiation extension" \
4970 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
4971 -S "found renegotiation extension" \
4972 -s "server hello, secure renegotiation extension" \
4973 -c "found renegotiation extension" \
4974 -C "=> renegotiate" \
4975 -S "=> renegotiate" \
4976 -s "write hello request" \
4977 -s "SSL - An unexpected message was received from our peer"
4980 run_test "Renegotiation: server-initiated, client-accepted, delay 0" \
4985 -c "client hello, adding renegotiation extension" \
4986 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
4987 -s "found renegotiation extension" \
4988 -s "server hello, secure renegotiation extension" \
4989 -c "found renegotiation extension" \
4990 -c "=> renegotiate" \
4991 -s "=> renegotiate" \
4992 -s "write hello request" \
4993 -S "SSL - An unexpected message was received from our peer" \
4994 -S "failed"
5001 -C "client hello, adding renegotiation extension" \
5002 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
5003 -S "found renegotiation extension" \
5004 -s "server hello, secure renegotiation extension" \
5005 -c "found renegotiation extension" \
5006 -S "record counter limit reached: renegotiate" \
5007 -C "=> renegotiate" \
5008 -S "=> renegotiate" \
5009 -S "write hello request" \
5010 -S "SSL - An unexpected message was received from our peer" \
5011 -S "failed"
5019 -c "client hello, adding renegotiation extension" \
5020 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
5021 -s "found renegotiation extension" \
5022 -s "server hello, secure renegotiation extension" \
5023 -c "found renegotiation extension" \
5024 -s "record counter limit reached: renegotiate" \
5025 -c "=> renegotiate" \
5026 -s "=> renegotiate" \
5027 -s "write hello request" \
5028 -S "SSL - An unexpected message was received from our peer" \
5029 -S "failed"
5036 -c "client hello, adding renegotiation extension" \
5037 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
5038 -s "found renegotiation extension" \
5039 -s "server hello, secure renegotiation extension" \
5040 -c "found renegotiation extension" \
5041 -s "record counter limit reached: renegotiate" \
5042 -c "=> renegotiate" \
5043 -s "=> renegotiate" \
5044 -s "write hello request" \
5045 -S "SSL - An unexpected message was received from our peer" \
5046 -S "failed"
5053 -C "client hello, adding renegotiation extension" \
5054 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
5055 -S "found renegotiation extension" \
5056 -s "server hello, secure renegotiation extension" \
5057 -c "found renegotiation extension" \
5058 -S "record counter limit reached: renegotiate" \
5059 -C "=> renegotiate" \
5060 -S "=> renegotiate" \
5061 -S "write hello request" \
5062 -S "SSL - An unexpected message was received from our peer" \
5063 -S "failed"
5066 run_test "Renegotiation: nbio, client-initiated" \
5070 -c "client hello, adding renegotiation extension" \
5071 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
5072 -s "found renegotiation extension" \
5073 -s "server hello, secure renegotiation extension" \
5074 -c "found renegotiation extension" \
5075 -c "=> renegotiate" \
5076 -s "=> renegotiate" \
5077 -S "write hello request"
5080 run_test "Renegotiation: nbio, server-initiated" \
5084 -c "client hello, adding renegotiation extension" \
5085 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
5086 -s "found renegotiation extension" \
5087 -s "server hello, secure renegotiation extension" \
5088 -c "found renegotiation extension" \
5089 -c "=> renegotiate" \
5090 -s "=> renegotiate" \
5091 -s "write hello request"
5095 run_test "Renegotiation: openssl server, client-initiated" \
5096 "$O_SRV -www -tls1_2" \
5099 -c "client hello, adding renegotiation extension" \
5100 -c "found renegotiation extension" \
5101 -c "=> renegotiate" \
5102 -C "ssl_hanshake() returned" \
5103 -C "error" \
5104 -c "HTTP/1.0 200 [Oo][Kk]"
5109 run_test "Renegotiation: gnutls server strict, client-initiated" \
5110 "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%SAFE_RENEGOTIATION" \
5113 -c "client hello, adding renegotiation extension" \
5114 -c "found renegotiation extension" \
5115 -c "=> renegotiate" \
5116 -C "ssl_hanshake() returned" \
5117 -C "error" \
5118 -c "HTTP/1.0 200 [Oo][Kk]"
5123 run_test "Renegotiation: gnutls server unsafe, client-initiated default" \
5124 "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \
5127 -c "client hello, adding renegotiation extension" \
5128 -C "found renegotiation extension" \
5129 -c "=> renegotiate" \
5130 -c "mbedtls_ssl_handshake() returned" \
5131 -c "error" \
5132 -C "HTTP/1.0 200 [Oo][Kk]"
5137 run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \
5138 "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \
5142 -c "client hello, adding renegotiation extension" \
5143 -C "found renegotiation extension" \
5144 -c "=> renegotiate" \
5145 -c "mbedtls_ssl_handshake() returned" \
5146 -c "error" \
5147 -C "HTTP/1.0 200 [Oo][Kk]"
5152 run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \
5153 "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \
5157 -c "client hello, adding renegotiation extension" \
5158 -C "found renegotiation extension" \
5159 -c "=> renegotiate" \
5160 -C "ssl_hanshake() returned" \
5161 -C "error" \
5162 -c "HTTP/1.0 200 [Oo][Kk]"
5166 run_test "Renegotiation: DTLS, client-initiated" \
5170 -c "client hello, adding renegotiation extension" \
5171 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
5172 -s "found renegotiation extension" \
5173 -s "server hello, secure renegotiation extension" \
5174 -c "found renegotiation extension" \
5175 -c "=> renegotiate" \
5176 -s "=> renegotiate" \
5177 -S "write hello request"
5181 run_test "Renegotiation: DTLS, server-initiated" \
5186 -c "client hello, adding renegotiation extension" \
5187 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
5188 -s "found renegotiation extension" \
5189 -s "server hello, secure renegotiation extension" \
5190 -c "found renegotiation extension" \
5191 -c "=> renegotiate" \
5192 -s "=> renegotiate" \
5193 -s "write hello request"
5201 -c "client hello, adding renegotiation extension" \
5202 -s "received TLS_EMPTY_RENEGOTIATION_INFO" \
5203 -s "found renegotiation extension" \
5204 -s "server hello, secure renegotiation extension" \
5205 -s "record counter limit reached: renegotiate" \
5206 -c "=> renegotiate" \
5207 -s "=> renegotiate" \
5208 -s "write hello request"
5213 run_test "Renegotiation: DTLS, gnutls server, client-initiated" \
5214 "$G_SRV -u --mtu 4096" \
5217 -c "client hello, adding renegotiation extension" \
5218 -c "found renegotiation extension" \
5219 -c "=> renegotiate" \
5220 -C "mbedtls_ssl_handshake returned" \
5221 -C "error" \
5222 -s "Extra-header:"
5229 "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%SAFE_RENEGOTIATION" \
5232 -c "found renegotiation extension" \
5233 -C "error" \
5234 -c "HTTP/1.0 200 [Oo][Kk]"
5239 "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \
5242 -C "found renegotiation extension" \
5243 -C "error" \
5244 -c "HTTP/1.0 200 [Oo][Kk]"
5249 "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \
5250 "$P_CLI debug_level=3 allow_legacy=-1" \
5252 -C "found renegotiation extension" \
5253 -c "error" \
5254 -C "HTTP/1.0 200 [Oo][Kk]"
5260 "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \
5262 -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \
5263 -s "server hello, secure renegotiation extension"
5269 "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \
5271 -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \
5272 -S "server hello, secure renegotiation extension"
5277 "$P_SRV debug_level=3 allow_legacy=-1" \
5278 "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \
5280 -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \
5281 -S "server hello, secure renegotiation extension"
5283 # Tests for silently dropping trailing extra bytes in .der certificates
5288 "$P_SRV crt_file=data_files/server5-der0.crt \
5292 -c "Handshake was completed" \
5297 "$P_SRV crt_file=data_files/server5-der1a.crt \
5301 -c "Handshake was completed" \
5306 "$P_SRV crt_file=data_files/server5-der1b.crt \
5310 -c "Handshake was completed" \
5315 "$P_SRV crt_file=data_files/server5-der2.crt \
5319 -c "Handshake was completed" \
5324 "$P_SRV crt_file=data_files/server5-der4.crt \
5328 -c "Handshake was completed" \
5333 "$P_SRV crt_file=data_files/server5-der8.crt \
5337 -c "Handshake was completed" \
5342 "$P_SRV crt_file=data_files/server5-der9.crt \
5346 -c "Handshake was completed" \
5348 # Tests for auth_mode, there are duplicated tests using ca callback for authentication
5349 # When updating these tests, modify the matching authentication tests accordingly
5353 "$P_SRV crt_file=data_files/server5-badsign.crt \
5357 -c "x509_verify_cert() returned" \
5358 -c "! The certificate is not correctly signed by the trusted CA" \
5359 -c "! mbedtls_ssl_handshake returned" \
5360 -c "X509 - Certificate verification failed"
5363 "$P_SRV crt_file=data_files/server5-badsign.crt \
5367 -c "x509_verify_cert() returned" \
5368 -c "! The certificate is not correctly signed by the trusted CA" \
5369 -C "! mbedtls_ssl_handshake returned" \
5370 -C "X509 - Certificate verification failed"
5377 -c "x509_verify_cert() returned" \
5378 -c "! The certificate is not correctly signed by the trusted CA" \
5379 -c "! Certificate verification flags"\
5380 -C "! mbedtls_ssl_handshake returned" \
5381 -C "X509 - Certificate verification failed" \
5382 -C "SSL - No CA Chain is set, but required to operate"
5389 -c "x509_verify_cert() returned" \
5390 -c "! The certificate is not correctly signed by the trusted CA" \
5391 -c "! Certificate verification flags"\
5392 -c "! mbedtls_ssl_handshake returned" \
5393 -c "SSL - No CA Chain is set, but required to operate"
5395 # The purpose of the next two tests is to test the client's behaviour when receiving a server
5397 # the client informs the server about the supported curves - it does, though, in the
5404 crt_file=data_files/server5.ku-ka.crt" \
5407 -c "bad certificate (EC key curve)"\
5408 -c "! Certificate verification flags"\
5409 -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage
5413 crt_file=data_files/server5.ku-ka.crt" \
5416 -c "bad certificate (EC key curve)"\
5417 -c "! Certificate verification flags"\
5418 -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check
5421 "$P_SRV crt_file=data_files/server5-badsign.crt \
5425 -C "x509_verify_cert() returned" \
5426 -C "! The certificate is not correctly signed by the trusted CA" \
5427 -C "! mbedtls_ssl_handshake returned" \
5428 -C "X509 - Certificate verification failed"
5435 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \
5437 -c "Supported Signature Algorithm found: 04 " \
5438 -c "Supported Signature Algorithm found: 05 "
5445 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \
5447 -c "Supported Signature Algorithm found: 04 " \
5448 -c "Supported Signature Algorithm found: 05 "
5456 -S "skip write certificate request" \
5457 -C "skip parse certificate request" \
5458 -c "got a certificate request" \
5459 -c "= write certificate$" \
5460 -C "skip write certificate$" \
5461 -S "x509_verify_cert() returned" \
5462 -s "peer has no certificate" \
5463 -s "! mbedtls_ssl_handshake returned" \
5464 … -s "No client certification received from the client, but required by the authentication mode"
5469 "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \
5472 -S "skip write certificate request" \
5473 -C "skip parse certificate request" \
5474 -c "got a certificate request" \
5475 -C "skip write certificate" \
5476 -C "skip write certificate verify" \
5477 -S "skip parse certificate verify" \
5478 -s "x509_verify_cert() returned" \
5479 -s "! The certificate is not correctly signed by the trusted CA" \
5480 -s "! mbedtls_ssl_handshake returned" \
5481 -s "send alert level=2 message=48" \
5482 -s "X509 - Certificate verification failed"
5488 run_test "Authentication: client cert self-signed and trusted, server required" \
5489 "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \
5490 "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \
5493 -S "skip write certificate request" \
5494 -C "skip parse certificate request" \
5495 -c "got a certificate request" \
5496 -C "skip write certificate" \
5497 -C "skip write certificate verify" \
5498 -S "skip parse certificate verify" \
5499 -S "x509_verify_cert() returned" \
5500 -S "! The certificate is not correctly signed" \
5501 -S "X509 - Certificate verification failed"
5506 "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \
5509 -S "skip write certificate request" \
5510 -C "skip parse certificate request" \
5511 -c "got a certificate request" \
5512 -C "skip write certificate" \
5513 -C "skip write certificate verify" \
5514 -S "skip parse certificate verify" \
5515 -s "x509_verify_cert() returned" \
5516 -s "! The certificate is not correctly signed by the trusted CA" \
5517 -s "! mbedtls_ssl_handshake returned" \
5518 -s "X509 - Certificate verification failed"
5523 "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \
5526 -S "skip write certificate request" \
5527 -C "skip parse certificate request" \
5528 -c "got a certificate request" \
5529 -C "skip write certificate" \
5530 -C "skip write certificate verify" \
5531 -S "skip parse certificate verify" \
5532 -s "x509_verify_cert() returned" \
5533 -s "! The certificate is not correctly signed by the trusted CA" \
5534 -S "! mbedtls_ssl_handshake returned" \
5535 -C "! mbedtls_ssl_handshake returned" \
5536 -S "X509 - Certificate verification failed"
5541 "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \
5544 -s "skip write certificate request" \
5545 -C "skip parse certificate request" \
5546 -c "got no certificate request" \
5547 -c "skip write certificate" \
5548 -c "skip write certificate verify" \
5549 -s "skip parse certificate verify" \
5550 -S "x509_verify_cert() returned" \
5551 -S "! The certificate is not correctly signed by the trusted CA" \
5552 -S "! mbedtls_ssl_handshake returned" \
5553 -C "! mbedtls_ssl_handshake returned" \
5554 -S "X509 - Certificate verification failed"
5561 -S "skip write certificate request" \
5562 -C "skip parse certificate request" \
5563 -c "got a certificate request" \
5564 -C "skip write certificate$" \
5565 -C "got no certificate to send" \
5566 -c "skip write certificate verify" \
5567 -s "skip parse certificate verify" \
5568 -s "! Certificate was missing" \
5569 -S "! mbedtls_ssl_handshake returned" \
5570 -C "! mbedtls_ssl_handshake returned" \
5571 -S "X509 - Certificate verification failed"
5577 "$O_NEXT_CLI_NO_CERT -no_middlebox" \
5579 -S "skip write certificate request" \
5580 -s "skip parse certificate verify" \
5581 -s "! Certificate was missing" \
5582 -S "! mbedtls_ssl_handshake returned" \
5583 -S "X509 - Certificate verification failed"
5587 "$O_SRV -verify 10 -tls1_2" \
5590 -C "skip parse certificate request" \
5591 -c "got a certificate request" \
5592 -C "skip write certificate$" \
5593 -c "skip write certificate verify" \
5594 -C "! mbedtls_ssl_handshake returned"
5598 "$O_SRV -Verify 10 -tls1_2" \
5601 -C "skip parse certificate request" \
5602 -c "got a certificate request" \
5603 -C "skip write certificate$" \
5604 -c "skip write certificate verify" \
5605 -c "! mbedtls_ssl_handshake returned"
5613 # The tests for the max_int tests can pass with any number higher than MAX_IM_CA
5615 # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions
5620 "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \
5621 key_file=data_files/dir-maxpath/09.key" \
5622 "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \
5624 -C "X509 - A fatal error occurred"
5629 "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \
5630 key_file=data_files/dir-maxpath/10.key" \
5631 "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \
5633 -c "X509 - A fatal error occurred"
5638 "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \
5639 key_file=data_files/dir-maxpath/10.key" \
5640 "$P_CLI force_version=tls12 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \
5643 -c "X509 - A fatal error occurred"
5648 "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \
5649 key_file=data_files/dir-maxpath/10.key" \
5650 "$P_CLI force_version=tls12 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \
5653 -C "X509 - A fatal error occurred"
5658 "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \
5659 "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \
5660 key_file=data_files/dir-maxpath/10.key" \
5662 -S "X509 - A fatal error occurred"
5667 "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \
5668 "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \
5669 key_file=data_files/dir-maxpath/10.key" \
5671 -s "X509 - A fatal error occurred"
5676 "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \
5677 "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \
5678 key_file=data_files/dir-maxpath/10.key" \
5680 -s "X509 - A fatal error occurred"
5685 "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \
5686 "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \
5687 key_file=data_files/dir-maxpath/09.key" \
5689 -S "X509 - A fatal error occurred"
5691 # Tests for CA list in CertificateRequest messages
5699 -s "requested DN"
5707 -S "requested DN"
5711 "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \
5714 -S "requested DN" \
5715 -s "x509_verify_cert() returned" \
5716 -s "! The certificate is not correctly signed by the trusted CA" \
5717 -s "! mbedtls_ssl_handshake returned" \
5718 -c "! mbedtls_ssl_handshake returned" \
5719 -s "X509 - Certificate verification failed"
5730 -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1"
5741 -c "DN hint: C=NL, O=PolarSSL, CN=localhost"
5752 -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1"
5754 # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests
5755 # When updating these tests, modify the matching authentication tests accordingly
5759 "$P_SRV crt_file=data_files/server5-badsign.crt \
5763 -c "use CA callback for X.509 CRT verification" \
5764 -c "x509_verify_cert() returned" \
5765 -c "! The certificate is not correctly signed by the trusted CA" \
5766 -c "! mbedtls_ssl_handshake returned" \
5767 -c "X509 - Certificate verification failed"
5771 "$P_SRV crt_file=data_files/server5-badsign.crt \
5775 -c "use CA callback for X.509 CRT verification" \
5776 -c "x509_verify_cert() returned" \
5777 -c "! The certificate is not correctly signed by the trusted CA" \
5778 -C "! mbedtls_ssl_handshake returned" \
5779 -C "X509 - Certificate verification failed"
5781 # The purpose of the next two tests is to test the client's behaviour when receiving a server
5783 # the client informs the server about the supported curves - it does, though, in the
5791 crt_file=data_files/server5.ku-ka.crt" \
5794 -c "use CA callback for X.509 CRT verification" \
5795 -c "bad certificate (EC key curve)" \
5796 -c "! Certificate verification flags" \
5797 -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage
5802 crt_file=data_files/server5.ku-ka.crt" \
5805 -c "use CA callback for X.509 CRT verification" \
5806 -c "bad certificate (EC key curve)"\
5807 -c "! Certificate verification flags"\
5808 -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check
5816 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \
5818 -s "use CA callback for X.509 CRT verification" \
5819 -c "Supported Signature Algorithm found: 04 " \
5820 -c "Supported Signature Algorithm found: 05 "
5828 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \
5830 -s "use CA callback for X.509 CRT verification" \
5831 -c "Supported Signature Algorithm found: 04 " \
5832 -c "Supported Signature Algorithm found: 05 "
5837 "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \
5840 -s "use CA callback for X.509 CRT verification" \
5841 -S "skip write certificate request" \
5842 -C "skip parse certificate request" \
5843 -c "got a certificate request" \
5844 -C "skip write certificate" \
5845 -C "skip write certificate verify" \
5846 -S "skip parse certificate verify" \
5847 -s "x509_verify_cert() returned" \
5848 -s "! The certificate is not correctly signed by the trusted CA" \
5849 -s "! mbedtls_ssl_handshake returned" \
5850 -s "send alert level=2 message=48" \
5851 -c "! mbedtls_ssl_handshake returned" \
5852 -s "X509 - Certificate verification failed"
5860 "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \
5863 -s "use CA callback for X.509 CRT verification" \
5864 -S "skip write certificate request" \
5865 -C "skip parse certificate request" \
5866 -c "got a certificate request" \
5867 -C "skip write certificate" \
5868 -C "skip write certificate verify" \
5869 -S "skip parse certificate verify" \
5870 -s "x509_verify_cert() returned" \
5871 -s "! The certificate is not correctly signed by the trusted CA" \
5872 -s "! mbedtls_ssl_handshake returned" \
5873 -c "! mbedtls_ssl_handshake returned" \
5874 -s "X509 - Certificate verification failed"
5879 "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \
5882 -s "use CA callback for X.509 CRT verification" \
5883 -S "skip write certificate request" \
5884 -C "skip parse certificate request" \
5885 -c "got a certificate request" \
5886 -C "skip write certificate" \
5887 -C "skip write certificate verify" \
5888 -S "skip parse certificate verify" \
5889 -s "x509_verify_cert() returned" \
5890 -s "! The certificate is not correctly signed by the trusted CA" \
5891 -S "! mbedtls_ssl_handshake returned" \
5892 -C "! mbedtls_ssl_handshake returned" \
5893 -S "X509 - Certificate verification failed"
5899 "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \
5900 key_file=data_files/dir-maxpath/09.key" \
5901 …version=tls12 ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \
5903 -c "use CA callback for X.509 CRT verification" \
5904 -C "X509 - A fatal error occurred"
5910 "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \
5911 key_file=data_files/dir-maxpath/10.key" \
5912 …version=tls12 debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \
5914 -c "use CA callback for X.509 CRT verification" \
5915 -c "X509 - A fatal error occurred"
5921 "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \
5922 key_file=data_files/dir-maxpath/10.key" \
5923 … "$P_CLI force_version=tls12 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \
5926 -c "use CA callback for X.509 CRT verification" \
5927 -c "X509 - A fatal error occurred"
5933 …"$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth…
5934 "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \
5935 key_file=data_files/dir-maxpath/10.key" \
5937 -s "use CA callback for X.509 CRT verification" \
5938 -s "X509 - A fatal error occurred"
5944 …"$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth…
5945 "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \
5946 key_file=data_files/dir-maxpath/10.key" \
5948 -s "use CA callback for X.509 CRT verification" \
5949 -s "X509 - A fatal error occurred"
5955 …"$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth…
5956 "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \
5957 key_file=data_files/dir-maxpath/09.key" \
5959 -s "use CA callback for X.509 CRT verification" \
5960 -S "X509 - A fatal error occurred"
5962 # Tests for certificate selection based on SHA version
5965 run_test "Certificate hash: client TLS 1.2 -> SHA-2" \
5968 crt_file2=data_files/server5-sha1.crt \
5972 -c "signed using.*ECDSA with SHA256" \
5973 -C "signed using.*ECDSA with SHA1"
5975 # tests for SNI
5984 -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \
5985 -c "subject name *: C=NL, O=PolarSSL, CN=localhost"
5992 …server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_file…
5995 -s "parse ServerName extension" \
5996 -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \
5997 -c "subject name *: C=NL, O=PolarSSL, CN=localhost"
6004 …server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_file…
6007 -s "parse ServerName extension" \
6008 -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \
6009 -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example"
6016 …server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_file…
6019 -s "parse ServerName extension" \
6020 -s "ssl_sni_wrapper() returned" \
6021 -s "mbedtls_ssl_handshake returned" \
6022 -c "mbedtls_ssl_handshake returned" \
6023 -c "SSL - A fatal alert message was received from our peer"
6029 sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \
6032 -S "skip write certificate request" \
6033 -C "skip parse certificate request" \
6034 -c "got a certificate request" \
6035 -C "skip write certificate" \
6036 -C "skip write certificate verify" \
6037 -S "skip parse certificate verify"
6040 run_test "SNI: client auth override: none -> optional" \
6043 sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \
6046 -S "skip write certificate request" \
6047 -C "skip parse certificate request" \
6048 -c "got a certificate request" \
6049 -C "skip write certificate" \
6050 -C "skip write certificate verify" \
6051 -S "skip parse certificate verify"
6054 run_test "SNI: client auth override: optional -> none" \
6057 sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \
6060 -s "skip write certificate request" \
6061 -C "skip parse certificate request" \
6062 -c "got no certificate request" \
6063 -c "skip write certificate"
6069 ca_file=data_files/test-ca.crt \
6070 sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \
6074 -S "skip write certificate request" \
6075 -C "skip parse certificate request" \
6076 -c "got a certificate request" \
6077 -C "skip write certificate" \
6078 -C "skip write certificate verify" \
6079 -S "skip parse certificate verify" \
6080 -s "x509_verify_cert() returned" \
6081 -s "! The certificate is not correctly signed by the trusted CA" \
6082 -S "The certificate has been revoked (is on a CRL)"
6088 ca_file=data_files/test-ca.crt \
6089 … sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \
6093 -S "skip write certificate request" \
6094 -C "skip parse certificate request" \
6095 -c "got a certificate request" \
6096 -C "skip write certificate" \
6097 -C "skip write certificate verify" \
6098 -S "skip parse certificate verify" \
6099 -S "x509_verify_cert() returned" \
6100 -S "! The certificate is not correctly signed by the trusted CA" \
6101 -S "The certificate has been revoked (is on a CRL)"
6107 ca_file=data_files/test-ca.crt \
6108 …t,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.p…
6112 -S "skip write certificate request" \
6113 -C "skip parse certificate request" \
6114 -c "got a certificate request" \
6115 -C "skip write certificate" \
6116 -C "skip write certificate verify" \
6117 -S "skip parse certificate verify" \
6118 -s "x509_verify_cert() returned" \
6119 -S "! The certificate is not correctly signed by the trusted CA" \
6120 -s "The certificate has been revoked (is on a CRL)"
6122 # Tests for SNI and DTLS
6131 -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \
6132 -c "subject name *: C=NL, O=PolarSSL, CN=localhost"
6139 …server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_file…
6142 -s "parse ServerName extension" \
6143 -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \
6144 -c "subject name *: C=NL, O=PolarSSL, CN=localhost"
6151 …server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_file…
6154 -s "parse ServerName extension" \
6155 -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \
6156 -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example"
6162 …server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_file…
6165 -s "parse ServerName extension" \
6166 -s "ssl_sni_wrapper() returned" \
6167 -s "mbedtls_ssl_handshake returned" \
6168 -c "mbedtls_ssl_handshake returned" \
6169 -c "SSL - A fatal alert message was received from our peer"
6175 sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \
6178 -S "skip write certificate request" \
6179 -C "skip parse certificate request" \
6180 -c "got a certificate request" \
6181 -C "skip write certificate" \
6182 -C "skip write certificate verify" \
6183 -S "skip parse certificate verify"
6186 run_test "SNI: DTLS, client auth override: none -> optional" \
6189 sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \
6192 -S "skip write certificate request" \
6193 -C "skip parse certificate request" \
6194 -c "got a certificate request" \
6195 -C "skip write certificate" \
6196 -C "skip write certificate verify" \
6197 -S "skip parse certificate verify"
6200 run_test "SNI: DTLS, client auth override: optional -> none" \
6203 sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \
6206 -s "skip write certificate request" \
6207 -C "skip parse certificate request" \
6208 -c "got no certificate request" \
6209 -c "skip write certificate" \
6210 -c "skip write certificate verify" \
6211 -s "skip parse certificate verify"
6217 ca_file=data_files/test-ca.crt \
6218 sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \
6222 -S "skip write certificate request" \
6223 -C "skip parse certificate request" \
6224 -c "got a certificate request" \
6225 -C "skip write certificate" \
6226 -C "skip write certificate verify" \
6227 -S "skip parse certificate verify" \
6228 -s "x509_verify_cert() returned" \
6229 -s "! The certificate is not correctly signed by the trusted CA" \
6230 -S "The certificate has been revoked (is on a CRL)"
6236 ca_file=data_files/test-ca.crt \
6237 … sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \
6241 -S "skip write certificate request" \
6242 -C "skip parse certificate request" \
6243 -c "got a certificate request" \
6244 -C "skip write certificate" \
6245 -C "skip write certificate verify" \
6246 -S "skip parse certificate verify" \
6247 -S "x509_verify_cert() returned" \
6248 -S "! The certificate is not correctly signed by the trusted CA" \
6249 -S "The certificate has been revoked (is on a CRL)"
6255 ca_file=data_files/test-ca.crt \
6256 …t,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.p…
6260 -S "skip write certificate request" \
6261 -C "skip parse certificate request" \
6262 -c "got a certificate request" \
6263 -C "skip write certificate" \
6264 -C "skip write certificate verify" \
6265 -S "skip parse certificate verify" \
6266 -s "x509_verify_cert() returned" \
6267 -S "! The certificate is not correctly signed by the trusted CA" \
6268 -s "The certificate has been revoked (is on a CRL)"
6270 # Tests for non-blocking I/O: exercise a variety of handshake flows
6273 run_test "Non-blocking I/O: basic handshake" \
6277 -S "mbedtls_ssl_handshake returned" \
6278 -C "mbedtls_ssl_handshake returned" \
6279 -c "Read from server: .* bytes read"
6282 run_test "Non-blocking I/O: client auth" \
6286 -S "mbedtls_ssl_handshake returned" \
6287 -C "mbedtls_ssl_handshake returned" \
6288 -c "Read from server: .* bytes read"
6291 run_test "Non-blocking I/O: ticket" \
6295 -S "mbedtls_ssl_handshake returned" \
6296 -C "mbedtls_ssl_handshake returned" \
6297 -c "Read from server: .* bytes read"
6300 run_test "Non-blocking I/O: ticket + client auth" \
6304 -S "mbedtls_ssl_handshake returned" \
6305 -C "mbedtls_ssl_handshake returned" \
6306 -c "Read from server: .* bytes read"
6309 run_test "Non-blocking I/O: TLS 1.2 + ticket + client auth + resume" \
6313 -S "mbedtls_ssl_handshake returned" \
6314 -C "mbedtls_ssl_handshake returned" \
6315 -c "Read from server: .* bytes read"
6320 run_test "Non-blocking I/O: TLS 1.3 + ticket + client auth + resume" \
6324 -S "mbedtls_ssl_handshake returned" \
6325 -C "mbedtls_ssl_handshake returned" \
6326 -c "Read from server: .* bytes read"
6329 run_test "Non-blocking I/O: TLS 1.2 + ticket + resume" \
6333 -S "mbedtls_ssl_handshake returned" \
6334 -C "mbedtls_ssl_handshake returned" \
6335 -c "Read from server: .* bytes read"
6340 run_test "Non-blocking I/O: TLS 1.3 + ticket + resume" \
6344 -S "mbedtls_ssl_handshake returned" \
6345 -C "mbedtls_ssl_handshake returned" \
6346 -c "Read from server: .* bytes read"
6349 run_test "Non-blocking I/O: session-id resume" \
6353 -S "mbedtls_ssl_handshake returned" \
6354 -C "mbedtls_ssl_handshake returned" \
6355 -c "Read from server: .* bytes read"
6357 # Tests for event-driven I/O: exercise a variety of handshake flows
6360 run_test "Event-driven I/O: basic handshake" \
6364 -S "mbedtls_ssl_handshake returned" \
6365 -C "mbedtls_ssl_handshake returned" \
6366 -c "Read from server: .* bytes read"
6369 run_test "Event-driven I/O: client auth" \
6373 -S "mbedtls_ssl_handshake returned" \
6374 -C "mbedtls_ssl_handshake returned" \
6375 -c "Read from server: .* bytes read"
6378 run_test "Event-driven I/O: ticket" \
6382 -S "mbedtls_ssl_handshake returned" \
6383 -C "mbedtls_ssl_handshake returned" \
6384 -c "Read from server: .* bytes read"
6387 run_test "Event-driven I/O: ticket + client auth" \
6391 -S "mbedtls_ssl_handshake returned" \
6392 -C "mbedtls_ssl_handshake returned" \
6393 -c "Read from server: .* bytes read"
6396 run_test "Event-driven I/O: TLS 1.2 + ticket + client auth + resume" \
6400 -S "mbedtls_ssl_handshake returned" \
6401 -C "mbedtls_ssl_handshake returned" \
6402 -c "Read from server: .* bytes read"
6407 run_test "Event-driven I/O: TLS 1.3 + ticket + client auth + resume" \
6411 -S "mbedtls_ssl_handshake returned" \
6412 -C "mbedtls_ssl_handshake returned" \
6413 -c "Read from server: .* bytes read"
6416 run_test "Event-driven I/O: TLS 1.2 + ticket + resume" \
6420 -S "mbedtls_ssl_handshake returned" \
6421 -C "mbedtls_ssl_handshake returned" \
6422 -c "Read from server: .* bytes read"
6427 run_test "Event-driven I/O: TLS 1.3 + ticket + resume" \
6431 -S "mbedtls_ssl_handshake returned" \
6432 -C "mbedtls_ssl_handshake returned" \
6433 -c "Read from server: .* bytes read"
6436 run_test "Event-driven I/O: session-id resume" \
6440 -S "mbedtls_ssl_handshake returned" \
6441 -C "mbedtls_ssl_handshake returned" \
6442 -c "Read from server: .* bytes read"
6445 run_test "Event-driven I/O, DTLS: basic handshake" \
6449 -c "Read from server: .* bytes read"
6452 run_test "Event-driven I/O, DTLS: client auth" \
6456 -c "Read from server: .* bytes read"
6459 run_test "Event-driven I/O, DTLS: ticket" \
6463 -c "Read from server: .* bytes read"
6466 run_test "Event-driven I/O, DTLS: ticket + client auth" \
6470 -c "Read from server: .* bytes read"
6473 run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \
6477 -c "Read from server: .* bytes read"
6480 run_test "Event-driven I/O, DTLS: ticket + resume" \
6484 -c "Read from server: .* bytes read"
6487 run_test "Event-driven I/O, DTLS: session-id resume" \
6491 -c "Read from server: .* bytes read"
6499 run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \
6500 -p "$P_PXY pack=50" \
6504 -c "Read from server: .* bytes read"
6506 # Tests for version negotiation
6508 run_test "Version check: all -> 1.2" \
6512 -S "mbedtls_ssl_handshake returned" \
6513 -C "mbedtls_ssl_handshake returned" \
6514 -s "Protocol is TLSv1.2" \
6515 -c "Protocol is TLSv1.2"
6520 "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \
6522 -s "Handshake protocol not within min/max boundaries" \
6523 -c "Error in protocol version" \
6524 -S "Protocol is TLSv1.0" \
6525 -C "Handshake was completed"
6530 "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \
6532 -s "Handshake protocol not within min/max boundaries" \
6533 -c "Error in protocol version" \
6534 -S "Protocol is TLSv1.1" \
6535 -C "Handshake was completed"
6539 "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \
6542 -s "Error in protocol version" \
6543 -c "Handshake protocol not within min/max boundaries" \
6544 -S "Version: TLS1.0" \
6545 -C "Protocol is TLSv1.0"
6549 "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \
6552 -s "Error in protocol version" \
6553 -c "Handshake protocol not within min/max boundaries" \
6554 -S "Version: TLS1.1" \
6555 -C "Protocol is TLSv1.1"
6557 # Tests for ALPN extension
6564 -C "client hello, adding alpn extension" \
6565 -S "found alpn extension" \
6566 -C "got an alert message, type: \\[2:120]" \
6567 -S "server side, adding alpn extension" \
6568 -C "found alpn extension " \
6569 -C "Application Layer Protocol is" \
6570 -S "Application Layer Protocol is"
6577 -c "client hello, adding alpn extension" \
6578 -s "found alpn extension" \
6579 -C "got an alert message, type: \\[2:120]" \
6580 -S "server side, adding alpn extension" \
6581 -C "found alpn extension " \
6582 -c "Application Layer Protocol is (none)" \
6583 -S "Application Layer Protocol is"
6590 -C "client hello, adding alpn extension" \
6591 -S "found alpn extension" \
6592 -C "got an alert message, type: \\[2:120]" \
6593 -S "server side, adding alpn extension" \
6594 -C "found alpn extension " \
6595 -C "Application Layer Protocol is" \
6596 -s "Application Layer Protocol is (none)"
6599 run_test "ALPN: both, common cli1-srv1" \
6603 -c "client hello, adding alpn extension" \
6604 -s "found alpn extension" \
6605 -C "got an alert message, type: \\[2:120]" \
6606 -s "server side, adding alpn extension" \
6607 -c "found alpn extension" \
6608 -c "Application Layer Protocol is abc" \
6609 -s "Application Layer Protocol is abc"
6612 run_test "ALPN: both, common cli2-srv1" \
6616 -c "client hello, adding alpn extension" \
6617 -s "found alpn extension" \
6618 -C "got an alert message, type: \\[2:120]" \
6619 -s "server side, adding alpn extension" \
6620 -c "found alpn extension" \
6621 -c "Application Layer Protocol is abc" \
6622 -s "Application Layer Protocol is abc"
6625 run_test "ALPN: both, common cli1-srv2" \
6629 -c "client hello, adding alpn extension" \
6630 -s "found alpn extension" \
6631 -C "got an alert message, type: \\[2:120]" \
6632 -s "server side, adding alpn extension" \
6633 -c "found alpn extension" \
6634 -c "Application Layer Protocol is 1234" \
6635 -s "Application Layer Protocol is 1234"
6642 -c "client hello, adding alpn extension" \
6643 -s "found alpn extension" \
6644 -c "got an alert message, type: \\[2:120]" \
6645 -S "server side, adding alpn extension" \
6646 -C "found alpn extension" \
6647 -C "Application Layer Protocol is 1234" \
6648 -S "Application Layer Protocol is 1234"
6651 # Tests for keyUsage in leaf certificates, part 1:
6652 # server-side certificate/suite selection
6654 run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \
6656 crt_file=data_files/server2.ku-ds.crt" \
6659 -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-"
6661 run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \
6663 crt_file=data_files/server2.ku-ke.crt" \
6666 -c "Ciphersuite is TLS-RSA-WITH-"
6668 run_test "keyUsage srv: RSA, keyAgreement -> fail" \
6670 crt_file=data_files/server2.ku-ka.crt" \
6673 -C "Ciphersuite is "
6676 run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \
6678 crt_file=data_files/server5.ku-ds.crt" \
6681 -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-"
6684 run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \
6686 crt_file=data_files/server5.ku-ka.crt" \
6689 -c "Ciphersuite is TLS-ECDH-"
6691 run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \
6693 crt_file=data_files/server5.ku-ke.crt" \
6696 -C "Ciphersuite is "
6698 # Tests for keyUsage in leaf certificates, part 2:
6699 # client-side checking of server cert
6702 "$O_SRV -tls1_2 -key data_files/server2.key \
6703 -cert data_files/server2.ku-ds_ke.crt" \
6705 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
6707 -C "bad certificate (usage extensions)" \
6708 -C "Processing of the Certificate handshake message failed" \
6709 -c "Ciphersuite is TLS-"
6711 run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \
6712 "$O_SRV -tls1_2 -key data_files/server2.key \
6713 -cert data_files/server2.ku-ds_ke.crt" \
6715 force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \
6717 -C "bad certificate (usage extensions)" \
6718 -C "Processing of the Certificate handshake message failed" \
6719 -c "Ciphersuite is TLS-"
6722 "$O_SRV -tls1_2 -key data_files/server2.key \
6723 -cert data_files/server2.ku-ke.crt" \
6725 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
6727 -C "bad certificate (usage extensions)" \
6728 -C "Processing of the Certificate handshake message failed" \
6729 -c "Ciphersuite is TLS-"
6731 run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \
6732 "$O_SRV -tls1_2 -key data_files/server2.key \
6733 -cert data_files/server2.ku-ke.crt" \
6735 force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \
6737 -c "bad certificate (usage extensions)" \
6738 -c "Processing of the Certificate handshake message failed" \
6739 -C "Ciphersuite is TLS-"
6741 run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \
6742 "$O_SRV -tls1_2 -key data_files/server2.key \
6743 -cert data_files/server2.ku-ke.crt" \
6745 force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \
6747 -c "bad certificate (usage extensions)" \
6748 -C "Processing of the Certificate handshake message failed" \
6749 -c "Ciphersuite is TLS-" \
6750 -c "! Usage does not match the keyUsage extension"
6752 run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \
6753 "$O_SRV -tls1_2 -key data_files/server2.key \
6754 -cert data_files/server2.ku-ds.crt" \
6756 force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \
6758 -C "bad certificate (usage extensions)" \
6759 -C "Processing of the Certificate handshake message failed" \
6760 -c "Ciphersuite is TLS-"
6763 "$O_SRV -tls1_2 -key data_files/server2.key \
6764 -cert data_files/server2.ku-ds.crt" \
6766 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
6768 -c "bad certificate (usage extensions)" \
6769 -c "Processing of the Certificate handshake message failed" \
6770 -C "Ciphersuite is TLS-"
6773 "$O_SRV -tls1_2 -key data_files/server2.key \
6774 -cert data_files/server2.ku-ds.crt" \
6776 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
6778 -c "bad certificate (usage extensions)" \
6779 -C "Processing of the Certificate handshake message failed" \
6780 -c "Ciphersuite is TLS-" \
6781 -c "! Usage does not match the keyUsage extension"
6787 "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \
6788 -cert data_files/server2.ku-ds_ke.crt" \
6791 -C "bad certificate (usage extensions)" \
6792 -C "Processing of the Certificate handshake message failed" \
6793 -c "Ciphersuite is"
6799 "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \
6800 -cert data_files/server2.ku-ke.crt" \
6803 -c "bad certificate (usage extensions)" \
6804 -c "Processing of the Certificate handshake message failed" \
6805 -C "Ciphersuite is"
6811 "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \
6812 -cert data_files/server2.ku-ka.crt" \
6815 -c "bad certificate (usage extensions)" \
6816 -c "Processing of the Certificate handshake message failed" \
6817 -C "Ciphersuite is"
6823 "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \
6824 -cert data_files/server5.ku-ds.crt" \
6827 -C "bad certificate (usage extensions)" \
6828 -C "Processing of the Certificate handshake message failed" \
6829 -c "Ciphersuite is"
6835 "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \
6836 -cert data_files/server5.ku-ke.crt" \
6839 -c "bad certificate (usage extensions)" \
6840 -c "Processing of the Certificate handshake message failed" \
6841 -C "Ciphersuite is"
6847 "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \
6848 -cert data_files/server5.ku-ka.crt" \
6851 -c "bad certificate (usage extensions)" \
6852 -c "Processing of the Certificate handshake message failed" \
6853 -C "Ciphersuite is"
6855 # Tests for keyUsage in leaf certificates, part 3:
6856 # server-side checking of client cert
6859 run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \
6861 "$O_CLI -key data_files/server2.key \
6862 -cert data_files/server2.ku-ds.crt" \
6864 -s "Verifying peer X.509 certificate... ok" \
6865 -S "bad certificate (usage extensions)" \
6866 -S "Processing of the Certificate handshake message failed"
6869 run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \
6871 "$O_CLI -key data_files/server2.key \
6872 -cert data_files/server2.ku-ke.crt" \
6874 -s "bad certificate (usage extensions)" \
6875 -S "Processing of the Certificate handshake message failed"
6878 run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \
6880 "$O_CLI -key data_files/server2.key \
6881 -cert data_files/server2.ku-ke.crt" \
6883 -s "bad certificate (usage extensions)" \
6884 -s "Processing of the Certificate handshake message failed"
6887 run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \
6889 "$O_CLI -key data_files/server5.key \
6890 -cert data_files/server5.ku-ds.crt" \
6892 -s "Verifying peer X.509 certificate... ok" \
6893 -S "bad certificate (usage extensions)" \
6894 -S "Processing of the Certificate handshake message failed"
6897 run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \
6899 "$O_CLI -key data_files/server5.key \
6900 -cert data_files/server5.ku-ka.crt" \
6902 -s "bad certificate (usage extensions)" \
6903 -S "Processing of the Certificate handshake message failed"
6908 run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \
6910 "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \
6911 -cert data_files/server2.ku-ds.crt" \
6913 -s "Verifying peer X.509 certificate... ok" \
6914 -S "bad certificate (usage extensions)" \
6915 -S "Processing of the Certificate handshake message failed"
6920 run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \
6922 "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \
6923 -cert data_files/server2.ku-ke.crt" \
6925 -s "bad certificate (usage extensions)" \
6926 -S "Processing of the Certificate handshake message failed"
6931 run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \
6933 "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \
6934 -cert data_files/server5.ku-ds.crt" \
6936 -s "Verifying peer X.509 certificate... ok" \
6937 -S "bad certificate (usage extensions)" \
6938 -S "Processing of the Certificate handshake message failed"
6943 run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (soft)" \
6945 "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \
6946 -cert data_files/server5.ku-ka.crt" \
6948 -s "bad certificate (usage extensions)" \
6949 -S "Processing of the Certificate handshake message failed"
6951 # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection
6954 run_test "extKeyUsage srv: serverAuth -> OK" \
6956 crt_file=data_files/server5.eku-srv.crt" \
6961 run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \
6963 crt_file=data_files/server5.eku-srv.crt" \
6968 run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \
6970 crt_file=data_files/server5.eku-cs_any.crt" \
6975 run_test "extKeyUsage srv: codeSign -> fail" \
6977 crt_file=data_files/server5.eku-cli.crt" \
6981 # Tests for extendedKeyUsage, part 2: client-side checking of server cert
6984 run_test "extKeyUsage cli: serverAuth -> OK" \
6985 "$O_SRV -tls1_2 -key data_files/server5.key \
6986 -cert data_files/server5.eku-srv.crt" \
6989 -C "bad certificate (usage extensions)" \
6990 -C "Processing of the Certificate handshake message failed" \
6991 -c "Ciphersuite is TLS-"
6994 run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \
6995 "$O_SRV -tls1_2 -key data_files/server5.key \
6996 -cert data_files/server5.eku-srv_cli.crt" \
6999 -C "bad certificate (usage extensions)" \
7000 -C "Processing of the Certificate handshake message failed" \
7001 -c "Ciphersuite is TLS-"
7004 run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \
7005 "$O_SRV -tls1_2 -key data_files/server5.key \
7006 -cert data_files/server5.eku-cs_any.crt" \
7009 -C "bad certificate (usage extensions)" \
7010 -C "Processing of the Certificate handshake message failed" \
7011 -c "Ciphersuite is TLS-"
7014 run_test "extKeyUsage cli: codeSign -> fail" \
7015 "$O_SRV -tls1_2 -key data_files/server5.key \
7016 -cert data_files/server5.eku-cs.crt" \
7019 -c "bad certificate (usage extensions)" \
7020 -c "Processing of the Certificate handshake message failed" \
7021 -C "Ciphersuite is TLS-"
7026 run_test "extKeyUsage cli 1.3: serverAuth -> OK" \
7027 "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \
7028 -cert data_files/server5.eku-srv.crt" \
7031 -C "bad certificate (usage extensions)" \
7032 -C "Processing of the Certificate handshake message failed" \
7033 -c "Ciphersuite is"
7038 run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \
7039 "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \
7040 -cert data_files/server5.eku-srv_cli.crt" \
7043 -C "bad certificate (usage extensions)" \
7044 -C "Processing of the Certificate handshake message failed" \
7045 -c "Ciphersuite is"
7050 run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \
7051 "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \
7052 -cert data_files/server5.eku-cs_any.crt" \
7055 -C "bad certificate (usage extensions)" \
7056 -C "Processing of the Certificate handshake message failed" \
7057 -c "Ciphersuite is"
7062 run_test "extKeyUsage cli 1.3: codeSign -> fail" \
7063 "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \
7064 -cert data_files/server5.eku-cs.crt" \
7067 -c "bad certificate (usage extensions)" \
7068 -c "Processing of the Certificate handshake message failed" \
7069 -C "Ciphersuite is"
7071 # Tests for extendedKeyUsage, part 3: server-side checking of client cert
7074 run_test "extKeyUsage cli-auth: clientAuth -> OK" \
7076 "$O_CLI -key data_files/server5.key \
7077 -cert data_files/server5.eku-cli.crt" \
7079 -S "bad certificate (usage extensions)" \
7080 -S "Processing of the Certificate handshake message failed"
7083 run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \
7085 "$O_CLI -key data_files/server5.key \
7086 -cert data_files/server5.eku-srv_cli.crt" \
7088 -S "bad certificate (usage extensions)" \
7089 -S "Processing of the Certificate handshake message failed"
7092 run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \
7094 "$O_CLI -key data_files/server5.key \
7095 -cert data_files/server5.eku-cs_any.crt" \
7097 -S "bad certificate (usage extensions)" \
7098 -S "Processing of the Certificate handshake message failed"
7101 run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \
7103 "$O_CLI -key data_files/server5.key \
7104 -cert data_files/server5.eku-cs.crt" \
7106 -s "bad certificate (usage extensions)" \
7107 -S "Processing of the Certificate handshake message failed"
7110 run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \
7112 "$O_CLI -key data_files/server5.key \
7113 -cert data_files/server5.eku-cs.crt" \
7115 -s "bad certificate (usage extensions)" \
7116 -s "Processing of the Certificate handshake message failed"
7121 run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \
7123 "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \
7124 -cert data_files/server5.eku-cli.crt" \
7126 -S "bad certificate (usage extensions)" \
7127 -S "Processing of the Certificate handshake message failed"
7132 run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \
7134 "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \
7135 -cert data_files/server5.eku-srv_cli.crt" \
7137 -S "bad certificate (usage extensions)" \
7138 -S "Processing of the Certificate handshake message failed"
7143 run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \
7145 "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \
7146 -cert data_files/server5.eku-cs_any.crt" \
7148 -S "bad certificate (usage extensions)" \
7149 -S "Processing of the Certificate handshake message failed"
7154 run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \
7156 "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \
7157 -cert data_files/server5.eku-cs.crt" \
7159 -s "bad certificate (usage extensions)" \
7160 -S "Processing of the Certificate handshake message failed"
7162 # Tests for DHM parameters loading
7166 "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
7169 -c "value of 'DHM: P ' (2048 bits)" \
7170 -c "value of 'DHM: G ' (2 bits)"
7174 "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
7177 -c "value of 'DHM: P ' (1024 bits)" \
7178 -c "value of 'DHM: G ' (2 bits)"
7180 # Tests for DHM client-side size checking
7184 "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
7187 -C "DHM prime too short:"
7191 "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
7194 -C "DHM prime too short:"
7198 "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
7201 -C "DHM prime too short:"
7205 "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
7208 -C "DHM prime too short:"
7212 "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
7215 -C "DHM prime too short:"
7219 "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
7222 -c "DHM prime too short:"
7226 "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
7229 -c "DHM prime too short:"
7233 "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
7236 -c "DHM prime too short:"
7240 "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
7243 -c "DHM prime too short:"
7247 "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \
7250 -c "DHM prime too short:"
7252 # Tests for PSK callback
7256 "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
7259 -S "SSL - The handshake negotiation failed" \
7260 -S "SSL - Unknown identity received" \
7261 -S "SSL - Verification of the message MAC failed"
7266 …_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
7269 -C "session hash for extended master secret"\
7270 -S "session hash for extended master secret"\
7271 -S "SSL - The handshake negotiation failed" \
7272 -S "SSL - Unknown identity received" \
7273 -S "SSL - Verification of the message MAC failed"
7276 run_test "PSK callback: opaque psk on client, no callback, SHA-384" \
7278 …I extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \
7281 -C "session hash for extended master secret"\
7282 -S "session hash for extended master secret"\
7283 -S "SSL - The handshake negotiation failed" \
7284 -S "SSL - Unknown identity received" \
7285 -S "SSL - Verification of the message MAC failed"
7290 …_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
7293 -c "session hash for extended master secret"\
7294 -s "session hash for extended master secret"\
7295 -S "SSL - The handshake negotiation failed" \
7296 -S "SSL - Unknown identity received" \
7297 -S "SSL - Verification of the message MAC failed"
7300 run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \
7302 …I extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \
7305 -c "session hash for extended master secret"\
7306 -s "session hash for extended master secret"\
7307 -S "SSL - The handshake negotiation failed" \
7308 -S "SSL - Unknown identity received" \
7309 -S "SSL - Verification of the message MAC failed"
7312 run_test "PSK callback: opaque rsa-psk on client, no callback" \
7314 …tended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \
7317 -C "session hash for extended master secret"\
7318 -S "session hash for extended master secret"\
7319 -S "SSL - The handshake negotiation failed" \
7320 -S "SSL - Unknown identity received" \
7321 -S "SSL - Verification of the message MAC failed"
7324 run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \
7326 …tended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \
7329 -C "session hash for extended master secret"\
7330 -S "session hash for extended master secret"\
7331 -S "SSL - The handshake negotiation failed" \
7332 -S "SSL - Unknown identity received" \
7333 -S "SSL - Verification of the message MAC failed"
7336 run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \
7338 … extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \
7341 -c "session hash for extended master secret"\
7342 -s "session hash for extended master secret"\
7343 -S "SSL - The handshake negotiation failed" \
7344 -S "SSL - Unknown identity received" \
7345 -S "SSL - Verification of the message MAC failed"
7348 run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \
7350 …tended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \
7353 -c "session hash for extended master secret"\
7354 -s "session hash for extended master secret"\
7355 -S "SSL - The handshake negotiation failed" \
7356 -S "SSL - Unknown identity received" \
7357 -S "SSL - Verification of the message MAC failed"
7360 run_test "PSK callback: opaque ecdhe-psk on client, no callback" \
7362 …nded_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \
7365 -C "session hash for extended master secret"\
7366 -S "session hash for extended master secret"\
7367 -S "SSL - The handshake negotiation failed" \
7368 -S "SSL - Unknown identity received" \
7369 -S "SSL - Verification of the message MAC failed"
7372 run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \
7374 …nded_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \
7377 -C "session hash for extended master secret"\
7378 -S "session hash for extended master secret"\
7379 -S "SSL - The handshake negotiation failed" \
7380 -S "SSL - Unknown identity received" \
7381 -S "SSL - Verification of the message MAC failed"
7384 run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \
7386 …xtended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \
7389 -c "session hash for extended master secret"\
7390 -s "session hash for extended master secret"\
7391 -S "SSL - The handshake negotiation failed" \
7392 -S "SSL - Unknown identity received" \
7393 -S "SSL - Verification of the message MAC failed"
7396 run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \
7398 …nded_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \
7401 -c "session hash for extended master secret"\
7402 -s "session hash for extended master secret"\
7403 -S "SSL - The handshake negotiation failed" \
7404 -S "SSL - Unknown identity received" \
7405 -S "SSL - Verification of the message MAC failed"
7408 run_test "PSK callback: opaque dhe-psk on client, no callback" \
7410 …tended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \
7413 -C "session hash for extended master secret"\
7414 -S "session hash for extended master secret"\
7415 -S "SSL - The handshake negotiation failed" \
7416 -S "SSL - Unknown identity received" \
7417 -S "SSL - Verification of the message MAC failed"
7420 run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \
7422 …tended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \
7425 -C "session hash for extended master secret"\
7426 -S "session hash for extended master secret"\
7427 -S "SSL - The handshake negotiation failed" \
7428 -S "SSL - Unknown identity received" \
7429 -S "SSL - Verification of the message MAC failed"
7432 run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \
7434 … extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \
7437 -c "session hash for extended master secret"\
7438 -s "session hash for extended master secret"\
7439 -S "SSL - The handshake negotiation failed" \
7440 -S "SSL - Unknown identity received" \
7441 -S "SSL - Verification of the message MAC failed"
7444 run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \
7446 …tended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \
7449 -c "session hash for extended master secret"\
7450 -s "session hash for extended master secret"\
7451 -S "SSL - The handshake negotiation failed" \
7452 -S "SSL - Unknown identity received" \
7453 -S "SSL - Verification of the message MAC failed"
7457 …3 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \
7458 …_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
7461 -C "session hash for extended master secret"\
7462 -S "session hash for extended master secret"\
7463 -S "SSL - The handshake negotiation failed" \
7464 -S "SSL - Unknown identity received" \
7465 -S "SSL - Verification of the message MAC failed"
7468 run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \
7469 …sk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \
7470 …I extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \
7473 -C "session hash for extended master secret"\
7474 -S "session hash for extended master secret"\
7475 -S "SSL - The handshake negotiation failed" \
7476 -S "SSL - Unknown identity received" \
7477 -S "SSL - Verification of the message MAC failed"
7482 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \
7483 "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
7486 -c "session hash for extended master secret"\
7487 -s "session hash for extended master secret"\
7488 -S "SSL - The handshake negotiation failed" \
7489 -S "SSL - Unknown identity received" \
7490 -S "SSL - Verification of the message MAC failed"
7495 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \
7496 … "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \
7499 -c "session hash for extended master secret"\
7500 -s "session hash for extended master secret"\
7501 -S "SSL - The handshake negotiation failed" \
7502 -S "SSL - Unknown identity received" \
7503 -S "SSL - Verification of the message MAC failed"
7506 run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \
7507 …k_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \
7508 … extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \
7511 -C "session hash for extended master secret"\
7512 -S "session hash for extended master secret"\
7513 -S "SSL - The handshake negotiation failed" \
7514 -S "SSL - Unknown identity received" \
7515 -S "SSL - Verification of the message MAC failed"
7518 run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \
7519 …dentity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384" \
7520 …tended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \
7523 -C "session hash for extended master secret"\
7524 -S "session hash for extended master secret"\
7525 -S "SSL - The handshake negotiation failed" \
7526 -S "SSL - Unknown identity received" \
7527 -S "SSL - Verification of the message MAC failed"
7530 run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \
7532 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \
7533 … "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \
7536 -c "session hash for extended master secret"\
7537 -s "session hash for extended master secret"\
7538 -S "SSL - The handshake negotiation failed" \
7539 -S "SSL - Unknown identity received" \
7540 -S "SSL - Verification of the message MAC failed"
7543 run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384…
7545 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \
7546 … "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \
7549 -c "session hash for extended master secret"\
7550 -s "session hash for extended master secret"\
7551 -S "SSL - The handshake negotiation failed" \
7552 -S "SSL - Unknown identity received" \
7553 -S "SSL - Verification of the message MAC failed"
7556 run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \
7557 …identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA" \
7558 …xtended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \
7561 -C "session hash for extended master secret"\
7562 -S "session hash for extended master secret"\
7563 -S "SSL - The handshake negotiation failed" \
7564 -S "SSL - Unknown identity received" \
7565 -S "SSL - Verification of the message MAC failed"
7568 run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \
7569 …ntity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384" \
7570 …nded_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \
7573 -C "session hash for extended master secret"\
7574 -S "session hash for extended master secret"\
7575 -S "SSL - The handshake negotiation failed" \
7576 -S "SSL - Unknown identity received" \
7577 -S "SSL - Verification of the message MAC failed"
7580 run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \
7582 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \
7583 … "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \
7586 -c "session hash for extended master secret"\
7587 -s "session hash for extended master secret"\
7588 -S "SSL - The handshake negotiation failed" \
7589 -S "SSL - Unknown identity received" \
7590 -S "SSL - Verification of the message MAC failed"
7593 run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA3…
7595 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \
7596 … "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \
7599 -c "session hash for extended master secret"\
7600 -s "session hash for extended master secret"\
7601 -S "SSL - The handshake negotiation failed" \
7602 -S "SSL - Unknown identity received" \
7603 -S "SSL - Verification of the message MAC failed"
7606 run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \
7607 …k_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \
7608 … extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \
7611 -C "session hash for extended master secret"\
7612 -S "session hash for extended master secret"\
7613 -S "SSL - The handshake negotiation failed" \
7614 -S "SSL - Unknown identity received" \
7615 -S "SSL - Verification of the message MAC failed"
7618 run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \
7619 …dentity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384" \
7620 …tended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \
7623 -C "session hash for extended master secret"\
7624 -S "session hash for extended master secret"\
7625 -S "SSL - The handshake negotiation failed" \
7626 -S "SSL - Unknown identity received" \
7627 -S "SSL - Verification of the message MAC failed"
7630 run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \
7632 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \
7633 … "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \
7636 -c "session hash for extended master secret"\
7637 -s "session hash for extended master secret"\
7638 -S "SSL - The handshake negotiation failed" \
7639 -S "SSL - Unknown identity received" \
7640 -S "SSL - Verification of the message MAC failed"
7643 run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384…
7645 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \
7646 … "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \
7649 -c "session hash for extended master secret"\
7650 -s "session hash for extended master secret"\
7651 -S "SSL - The handshake negotiation failed" \
7652 -S "SSL - Unknown identity received" \
7653 -S "SSL - Verification of the message MAC failed"
7657 …dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \
7658 …_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
7661 -C "session hash for extended master secret"\
7662 -S "session hash for extended master secret"\
7663 -S "SSL - The handshake negotiation failed" \
7664 -S "SSL - Unknown identity received" \
7665 -S "SSL - Verification of the message MAC failed"
7668 … "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, SHA-384" \
7669 …d,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \
7670 …I extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \
7673 -C "session hash for extended master secret"\
7674 -S "session hash for extended master secret"\
7675 -S "SSL - The handshake negotiation failed" \
7676 -S "SSL - Unknown identity received" \
7677 -S "SSL - Verification of the message MAC failed"
7682 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \
7683 "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
7686 -c "session hash for extended master secret"\
7687 -s "session hash for extended master secret"\
7688 -S "SSL - The handshake negotiation failed" \
7689 -S "SSL - Unknown identity received" \
7690 -S "SSL - Verification of the message MAC failed"
7695 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \
7696 … "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \
7699 -c "session hash for extended master secret"\
7700 -s "session hash for extended master secret"\
7701 -S "SSL - The handshake negotiation failed" \
7702 -S "SSL - Unknown identity received" \
7703 -S "SSL - Verification of the message MAC failed"
7706 run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from …
7707 …,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \
7708 … extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \
7711 -C "session hash for extended master secret"\
7712 -S "session hash for extended master secret"\
7713 -S "SSL - The handshake negotiation failed" \
7714 -S "SSL - Unknown identity received" \
7715 -S "SSL - Verification of the message MAC failed"
7718 run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from …
7719 …f,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384" \
7720 …tended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \
7723 -C "session hash for extended master secret"\
7724 -S "session hash for extended master secret"\
7725 -S "SSL - The handshake negotiation failed" \
7726 -S "SSL - Unknown identity received" \
7727 -S "SSL - Verification of the message MAC failed"
7730 run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from …
7732 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \
7733 … "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \
7736 -c "session hash for extended master secret"\
7737 -s "session hash for extended master secret"\
7738 -S "SSL - The handshake negotiation failed" \
7739 -S "SSL - Unknown identity received" \
7740 -S "SSL - Verification of the message MAC failed"
7743 run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from …
7745 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \
7746 … "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \
7749 -c "session hash for extended master secret"\
7750 -s "session hash for extended master secret"\
7751 -S "SSL - The handshake negotiation failed" \
7752 -S "SSL - Unknown identity received" \
7753 -S "SSL - Verification of the message MAC failed"
7756 run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK…
7757 …ef,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA" \
7758 …xtended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \
7761 -C "session hash for extended master secret"\
7762 -S "session hash for extended master secret"\
7763 -S "SSL - The handshake negotiation failed" \
7764 -S "SSL - Unknown identity received" \
7765 -S "SSL - Verification of the message MAC failed"
7768 …un_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK…
7769 …beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384" \
7770 …nded_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \
7773 -C "session hash for extended master secret"\
7774 -S "session hash for extended master secret"\
7775 -S "SSL - The handshake negotiation failed" \
7776 -S "SSL - Unknown identity received" \
7777 -S "SSL - Verification of the message MAC failed"
7780 run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK…
7782 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \
7783 … "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \
7786 -c "session hash for extended master secret"\
7787 -s "session hash for extended master secret"\
7788 -S "SSL - The handshake negotiation failed" \
7789 -S "SSL - Unknown identity received" \
7790 -S "SSL - Verification of the message MAC failed"
7793 run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK…
7795 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \
7796 … "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \
7799 -c "session hash for extended master secret"\
7800 -s "session hash for extended master secret"\
7801 -S "SSL - The handshake negotiation failed" \
7802 -S "SSL - Unknown identity received" \
7803 -S "SSL - Verification of the message MAC failed"
7806 run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from …
7807 …,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \
7808 … extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \
7811 -C "session hash for extended master secret"\
7812 -S "session hash for extended master secret"\
7813 -S "SSL - The handshake negotiation failed" \
7814 -S "SSL - Unknown identity received" \
7815 -S "SSL - Verification of the message MAC failed"
7818 run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from …
7819 …f,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384" \
7820 …tended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \
7823 -C "session hash for extended master secret"\
7824 -S "session hash for extended master secret"\
7825 -S "SSL - The handshake negotiation failed" \
7826 -S "SSL - Unknown identity received" \
7827 -S "SSL - Verification of the message MAC failed"
7830 run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from …
7832 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \
7833 … "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \
7836 -c "session hash for extended master secret"\
7837 -s "session hash for extended master secret"\
7838 -S "SSL - The handshake negotiation failed" \
7839 -S "SSL - Unknown identity received" \
7840 -S "SSL - Verification of the message MAC failed"
7843 run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from …
7845 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \
7846 … "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \
7849 -c "session hash for extended master secret"\
7850 -s "session hash for extended master secret"\
7851 -S "SSL - The handshake negotiation failed" \
7852 -S "SSL - Unknown identity received" \
7853 -S "SSL - Verification of the message MAC failed"
7857 …dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \
7858 …_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
7861 -C "session hash for extended master secret"\
7862 -S "session hash for extended master secret"\
7863 -S "SSL - The handshake negotiation failed" \
7864 -S "SSL - Unknown identity received" \
7865 -S "SSL - Verification of the message MAC failed"
7869 …dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \
7870 …_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
7873 -C "session hash for extended master secret"\
7874 -S "session hash for extended master secret"\
7875 -S "SSL - The handshake negotiation failed" \
7876 -S "SSL - Unknown identity received" \
7877 -S "SSL - Verification of the message MAC failed"
7881 …el=3 psk_list=abc,dead,def,beef min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \
7882 …_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
7885 -C "session hash for extended master secret"\
7886 -S "session hash for extended master secret"\
7887 -S "SSL - The handshake negotiation failed" \
7888 -S "SSL - Unknown identity received" \
7889 -S "SSL - Verification of the message MAC failed"
7892 run_test "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK f…
7893 …el=3 psk_list=abc,dead,def,beef min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \
7894 …_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
7897 -C "session hash for extended master secret"\
7898 -S "session hash for extended master secret"\
7899 -S "SSL - The handshake negotiation failed" \
7900 -S "SSL - Unknown identity received" \
7901 -S "SSL - Verification of the message MAC failed"
7905 …=3 psk_list=abc,dead,def,abc123 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \
7906 …_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
7909 -s "SSL - Verification of the message MAC failed"
7913 "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
7916 -s "SSL - The handshake negotiation failed" \
7917 -S "SSL - Unknown identity received" \
7918 -S "SSL - Verification of the message MAC failed"
7922 "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
7925 -S "SSL - The handshake negotiation failed" \
7926 -s "SSL - Unknown identity received" \
7927 -S "SSL - Verification of the message MAC failed"
7931 "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
7934 -S "SSL - The handshake negotiation failed" \
7935 -S "SSL - Unknown identity received" \
7936 -S "SSL - Verification of the message MAC failed"
7940 "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
7943 -S "SSL - The handshake negotiation failed" \
7944 -S "SSL - Unknown identity received" \
7945 -S "SSL - Verification of the message MAC failed"
7949 "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
7952 -S "SSL - The handshake negotiation failed" \
7953 -s "SSL - Unknown identity received" \
7954 -S "SSL - Verification of the message MAC failed"
7958 "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \
7961 -S "SSL - The handshake negotiation failed" \
7962 -S "SSL - Unknown identity received" \
7963 -s "SSL - Verification of the message MAC failed"
7965 # Tests for EC J-PAKE
7973 -C "add ciphersuite: 0xc0ff" \
7974 -C "adding ecjpake_kkpp extension" \
7975 -S "found ecjpake kkpp extension" \
7976 -S "skip ecjpake kkpp extension" \
7977 -S "ciphersuite mismatch: ecjpake not configured" \
7978 -S "server hello, ecjpake kkpp extension" \
7979 -C "found ecjpake_kkpp extension" \
7980 -S "SSL - The handshake negotiation failed"
7986 force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \
7988 -c "add ciphersuite: c0ff" \
7989 -c "adding ecjpake_kkpp extension" \
7990 -s "found ecjpake kkpp extension" \
7991 -s "skip ecjpake kkpp extension" \
7992 -s "ciphersuite mismatch: ecjpake not configured" \
7993 -S "server hello, ecjpake kkpp extension" \
7994 -C "found ecjpake_kkpp extension" \
7995 -s "SSL - The handshake negotiation failed"
8003 force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \
8005 -c "add ciphersuite: c0ff" \
8006 -c "adding ecjpake_kkpp extension" \
8007 -C "re-using cached ecjpake parameters" \
8008 -s "found ecjpake kkpp extension" \
8009 -S "skip ecjpake kkpp extension" \
8010 -S "ciphersuite mismatch: ecjpake not configured" \
8011 -s "server hello, ecjpake kkpp extension" \
8012 -c "found ecjpake_kkpp extension" \
8013 -S "SSL - The handshake negotiation failed" \
8014 -S "SSL - Verification of the message MAC failed"
8021 force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \
8023 -c "add ciphersuite: c0ff" \
8024 -c "adding ecjpake_kkpp extension" \
8025 -c "using opaque password" \
8026 -s "using opaque password" \
8027 -C "re-using cached ecjpake parameters" \
8028 -s "found ecjpake kkpp extension" \
8029 -S "skip ecjpake kkpp extension" \
8030 -S "ciphersuite mismatch: ecjpake not configured" \
8031 -s "server hello, ecjpake kkpp extension" \
8032 -c "found ecjpake_kkpp extension" \
8033 -S "SSL - The handshake negotiation failed" \
8034 -S "SSL - Verification of the message MAC failed"
8043 force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \
8045 -c "add ciphersuite: c0ff" \
8046 -c "adding ecjpake_kkpp extension" \
8047 -c "using opaque password" \
8048 -S "using opaque password" \
8049 -C "re-using cached ecjpake parameters" \
8050 -s "found ecjpake kkpp extension" \
8051 -S "skip ecjpake kkpp extension" \
8052 -S "ciphersuite mismatch: ecjpake not configured" \
8053 -s "server hello, ecjpake kkpp extension" \
8054 -c "found ecjpake_kkpp extension" \
8055 -S "SSL - The handshake negotiation failed" \
8056 -S "SSL - Verification of the message MAC failed"
8065 force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \
8067 -c "add ciphersuite: c0ff" \
8068 -c "adding ecjpake_kkpp extension" \
8069 -C "using opaque password" \
8070 -s "using opaque password" \
8071 -C "re-using cached ecjpake parameters" \
8072 -s "found ecjpake kkpp extension" \
8073 -S "skip ecjpake kkpp extension" \
8074 -S "ciphersuite mismatch: ecjpake not configured" \
8075 -s "server hello, ecjpake kkpp extension" \
8076 -c "found ecjpake_kkpp extension" \
8077 -S "SSL - The handshake negotiation failed" \
8078 -S "SSL - Verification of the message MAC failed"
8085 force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \
8087 -C "re-using cached ecjpake parameters" \
8088 -s "SSL - Verification of the message MAC failed"
8096 force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \
8098 -c "using opaque password" \
8099 -s "using opaque password" \
8100 -C "re-using cached ecjpake parameters" \
8101 -s "SSL - Verification of the message MAC failed"
8107 force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \
8109 -c "re-using cached ecjpake parameters" \
8110 -S "SSL - Verification of the message MAC failed"
8116 force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \
8118 -C "re-using cached ecjpake parameters" \
8119 -S "SSL - Verification of the message MAC failed"
8126 force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \
8128 -c "re-using cached ecjpake parameters" \
8129 -s "SSL - Verification of the message MAC failed"
8131 # for tests with configs/config-thread.h
8136 force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \
8144 "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \
8146 -s "dumping 'client hello extensions' (0 bytes)"
8148 # Tests for mbedtls_ssl_get_bytes_avail()
8150 # The server first reads buffer_size-1 bytes, then reads the remainder.
8156 -s "Read from client: 100 bytes read$"
8163 -s "Read from client: 101 bytes read (100 + 1)"
8171 -s "Read from client: 200 bytes read (100 + 100)"
8178 -s "Read from client: $MAX_CONTENT_LEN bytes read (100 + $((MAX_CONTENT_LEN - 100)))"
8180 # Tests for small client packets
8185 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
8187 -s "Read from client: 1 bytes read"
8192 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \
8194 -s "Read from client: 1 bytes read"
8199 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \
8201 -s "Read from client: 1 bytes read"
8206 force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \
8208 -s "Read from client: 1 bytes read"
8213 force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \
8215 -s "Read from client: 1 bytes read"
8221 force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \
8223 -s "Read from client: 1 bytes read"
8229 force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \
8231 -s "Read from client: 1 bytes read"
8233 # Tests for small client packets in DTLS
8239 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
8241 -s "Read from client: 1 bytes read"
8247 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
8249 -s "Read from client: 1 bytes read"
8251 # Tests for small server packets
8255 "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
8257 -c "Read from server: 1 bytes read"
8261 "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \
8263 -c "Read from server: 1 bytes read"
8267 "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \
8269 -c "Read from server: 1 bytes read"
8273 "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \
8275 -c "Read from server: 1 bytes read"
8279 "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \
8281 -c "Read from server: 1 bytes read"
8286 "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \
8288 -c "Read from server: 1 bytes read"
8293 "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \
8295 -c "Read from server: 1 bytes read"
8297 # Tests for small server packets in DTLS
8303 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
8305 -c "Read from server: 1 bytes read"
8311 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
8313 -c "Read from server: 1 bytes read"
8319 echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))"
8325 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
8327 -c "16384 bytes written in $(fragments_for_write 16384) fragments" \
8328 -s "Read from client: $MAX_CONTENT_LEN bytes read"
8333 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
8335 -s "Read from client: $MAX_CONTENT_LEN bytes read"
8340 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \
8342 -c "16384 bytes written in $(fragments_for_write 16384) fragments" \
8343 -s "Read from client: $MAX_CONTENT_LEN bytes read"
8348 force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \
8350 -c "16384 bytes written in $(fragments_for_write 16384) fragments" \
8351 -s "Read from client: $MAX_CONTENT_LEN bytes read"
8356 force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \
8358 -c "16384 bytes written in $(fragments_for_write 16384) fragments" \
8359 -s "Read from client: $MAX_CONTENT_LEN bytes read"
8365 force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \
8367 -c "16384 bytes written in $(fragments_for_write 16384) fragments" \
8368 -s "Read from client: $MAX_CONTENT_LEN bytes read"
8374 force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \
8376 -c "16384 bytes written in $(fragments_for_write 16384) fragments" \
8377 -s "Read from client: $MAX_CONTENT_LEN bytes read"
8379 # The tests below fail when the server's OUT_CONTENT_LEN is less than 16384.
8382 "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
8384 -c "Read from server: 16384 bytes read"
8388 "$P_CLI etm=0 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \
8390 -s "16384 bytes written in 1 fragments" \
8391 -c "Read from server: 16384 bytes read"
8395 "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \
8397 -c "Read from server: 16384 bytes read"
8401 "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \
8403 -s "16384 bytes written in 1 fragments" \
8404 -c "Read from server: 16384 bytes read"
8408 "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \
8410 -c "Read from server: 16384 bytes read"
8414 "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \
8416 -c "Read from server: 16384 bytes read"
8421 "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \
8423 -c "Read from server: 16384 bytes read"
8428 "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \
8430 -c "Read from server: 16384 bytes read"
8432 # Tests for restartable ECC
8440 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
8444 -C "x509_verify_cert.*4b00" \
8445 -C "mbedtls_pk_verify.*4b00" \
8446 -C "mbedtls_ecdh_make_public.*4b00" \
8447 -C "mbedtls_pk_sign.*4b00"
8453 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
8457 -C "x509_verify_cert.*4b00" \
8458 -C "mbedtls_pk_verify.*4b00" \
8459 -C "mbedtls_ecdh_make_public.*4b00" \
8460 -C "mbedtls_pk_sign.*4b00"
8466 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
8470 -C "x509_verify_cert.*4b00" \
8471 -C "mbedtls_pk_verify.*4b00" \
8472 -C "mbedtls_ecdh_make_public.*4b00" \
8473 -C "mbedtls_pk_sign.*4b00"
8481 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
8485 -c "x509_verify_cert.*4b00" \
8486 -c "mbedtls_pk_verify.*4b00" \
8487 -c "mbedtls_ecdh_make_public.*4b00" \
8488 -c "mbedtls_pk_sign.*4b00"
8497 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
8501 -c "x509_verify_cert.*4b00" \
8502 -c "mbedtls_pk_verify.*4b00" \
8503 -C "mbedtls_ecdh_make_public.*4b00" \
8504 -c "mbedtls_pk_sign.*4b00"
8512 crt_file=data_files/server5-badsign.crt \
8514 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
8518 -c "x509_verify_cert.*4b00" \
8519 -C "mbedtls_pk_verify.*4b00" \
8520 -C "mbedtls_ecdh_make_public.*4b00" \
8521 -C "mbedtls_pk_sign.*4b00" \
8522 -c "! The certificate is not correctly signed by the trusted CA" \
8523 -c "! mbedtls_ssl_handshake returned" \
8524 -c "X509 - Certificate verification failed"
8532 crt_file=data_files/server5-badsign.crt \
8534 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
8538 -c "x509_verify_cert.*4b00" \
8539 -c "mbedtls_pk_verify.*4b00" \
8540 -c "mbedtls_ecdh_make_public.*4b00" \
8541 -c "mbedtls_pk_sign.*4b00" \
8542 -c "! The certificate is not correctly signed by the trusted CA" \
8543 -C "! mbedtls_ssl_handshake returned" \
8544 -C "X509 - Certificate verification failed"
8553 crt_file=data_files/server5-badsign.crt \
8555 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
8559 -c "x509_verify_cert.*4b00" \
8560 -c "mbedtls_pk_verify.*4b00" \
8561 -C "mbedtls_ecdh_make_public.*4b00" \
8562 -c "mbedtls_pk_sign.*4b00" \
8563 -c "! The certificate is not correctly signed by the trusted CA" \
8564 -C "! mbedtls_ssl_handshake returned" \
8565 -C "X509 - Certificate verification failed"
8573 crt_file=data_files/server5-badsign.crt \
8575 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
8579 -C "x509_verify_cert.*4b00" \
8580 -c "mbedtls_pk_verify.*4b00" \
8581 -c "mbedtls_ecdh_make_public.*4b00" \
8582 -c "mbedtls_pk_sign.*4b00" \
8583 -C "! The certificate is not correctly signed by the trusted CA" \
8584 -C "! mbedtls_ssl_handshake returned" \
8585 -C "X509 - Certificate verification failed"
8594 crt_file=data_files/server5-badsign.crt \
8596 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
8600 -C "x509_verify_cert.*4b00" \
8601 -c "mbedtls_pk_verify.*4b00" \
8602 -C "mbedtls_ecdh_make_public.*4b00" \
8603 -c "mbedtls_pk_sign.*4b00" \
8604 -C "! The certificate is not correctly signed by the trusted CA" \
8605 -C "! mbedtls_ssl_handshake returned" \
8606 -C "X509 - Certificate verification failed"
8614 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
8618 -c "x509_verify_cert.*4b00" \
8619 -c "mbedtls_pk_verify.*4b00" \
8620 -c "mbedtls_ecdh_make_public.*4b00" \
8621 -c "mbedtls_pk_sign.*4b00"
8630 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
8634 -c "x509_verify_cert.*4b00" \
8635 -c "mbedtls_pk_verify.*4b00" \
8636 -C "mbedtls_ecdh_make_public.*4b00" \
8637 -c "mbedtls_pk_sign.*4b00"
8645 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
8648 -c "x509_verify_cert.*4b00" \
8649 -c "mbedtls_pk_verify.*4b00" \
8650 -c "mbedtls_ecdh_make_public.*4b00" \
8651 -C "mbedtls_pk_sign.*4b00"
8661 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
8664 -c "x509_verify_cert.*4b00" \
8665 -c "mbedtls_pk_verify.*4b00" \
8666 -C "mbedtls_ecdh_make_public.*4b00" \
8667 -C "mbedtls_pk_sign.*4b00"
8669 # Restartable is only for ECDHE-ECDSA, with another ciphersuite we expect no
8671 # This is the same as "EC restart: TLS, max_ops=1000" except with ECDHE-RSA,
8675 run_test "EC restart: TLS, max_ops=1000, ECDHE-RSA" \
8677 "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 \
8681 -C "x509_verify_cert.*4b00" \
8682 -C "mbedtls_pk_verify.*4b00" \
8683 -C "mbedtls_ecdh_make_public.*4b00" \
8684 -C "mbedtls_pk_sign.*4b00"
8686 # Tests of asynchronous private key support in SSL
8694 -s "Async sign callback: using key slot " \
8695 -s "Async resume (slot [0-9]): sign done, status=0"
8703 -s "Async sign callback: using key slot " \
8704 -s "Async resume (slot [0-9]): call 0 more times." \
8705 -s "Async resume (slot [0-9]): sign done, status=0"
8713 -s "Async sign callback: using key slot " \
8714 -U "Async sign callback: using key slot " \
8715 -s "Async resume (slot [0-9]): call 1 more times." \
8716 -s "Async resume (slot [0-9]): call 0 more times." \
8717 -s "Async resume (slot [0-9]): sign done, status=0"
8725 …server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_file…
8728 -s "Async sign callback: using key slot " \
8729 -s "Async resume (slot [0-9]): sign done, status=0" \
8730 -s "parse ServerName extension" \
8731 -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \
8732 -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example"
8738 "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
8740 -s "Async decrypt callback: using key slot " \
8741 -s "Async resume (slot [0-9]): decrypt done, status=0"
8747 "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
8749 -s "Async decrypt callback: using key slot " \
8750 -s "Async resume (slot [0-9]): call 0 more times." \
8751 -s "Async resume (slot [0-9]): decrypt done, status=0"
8754 run_test "SSL async private: decrypt RSA-PSK, delay=0" \
8758 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \
8760 -s "Async decrypt callback: using key slot " \
8761 -s "Async resume (slot [0-9]): decrypt done, status=0"
8764 run_test "SSL async private: decrypt RSA-PSK, delay=1" \
8768 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \
8770 -s "Async decrypt callback: using key slot " \
8771 -s "Async resume (slot [0-9]): call 0 more times." \
8772 -s "Async resume (slot [0-9]): decrypt done, status=0"
8778 "$P_CLI force_version=tls12; [ \$? -eq 1 ] &&
8779 $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
8781 -S "Async sign callback" \
8782 -s "! mbedtls_ssl_handshake returned" \
8783 -s "The own private key or pre-shared key is not set, but needed" \
8784 -s "Async resume (slot [0-9]): decrypt done, status=0" \
8785 -s "Successful connection"
8791 "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA;
8792 [ \$? -eq 1 ] && $P_CLI force_version=tls12" \
8794 -S "Async decrypt callback" \
8795 -s "! mbedtls_ssl_handshake returned" \
8796 -s "got no RSA private key" \
8797 -s "Async resume (slot [0-9]): sign done, status=0" \
8798 -s "Successful connection"
8807 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \
8809 -s "Async sign callback: using key slot 0," \
8810 -s "Async resume (slot 0): call 0 more times." \
8811 -s "Async resume (slot 0): sign done, status=0"
8820 "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \
8822 -s "Async sign callback: using key slot 0," \
8823 -s "Async resume (slot 0): call 0 more times." \
8824 -s "Async resume (slot 0): sign done, status=0"
8833 "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \
8835 -s "Async sign callback: using key slot 1," \
8836 -s "Async resume (slot 1): call 0 more times." \
8837 -s "Async resume (slot 1): sign done, status=0"
8846 "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \
8848 -s "Async sign callback: no key matches this certificate."
8857 -s "Async sign callback: injected error" \
8858 -S "Async resume" \
8859 -S "Async cancel" \
8860 -s "! mbedtls_ssl_handshake returned"
8869 -s "Async sign callback: using key slot " \
8870 -S "Async resume" \
8871 -s "Async cancel"
8880 -s "Async sign callback: using key slot " \
8881 -s "Async resume callback: sign done but injected error" \
8882 -S "Async cancel" \
8883 -s "! mbedtls_ssl_handshake returned"
8890 "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
8892 -s "Async decrypt callback: injected error" \
8893 -S "Async resume" \
8894 -S "Async cancel" \
8895 -s "! mbedtls_ssl_handshake returned"
8902 "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
8904 -s "Async decrypt callback: using key slot " \
8905 -S "Async resume" \
8906 -s "Async cancel"
8913 "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
8915 -s "Async decrypt callback: using key slot " \
8916 -s "Async resume callback: decrypt done but injected error" \
8917 -S "Async cancel" \
8918 -s "! mbedtls_ssl_handshake returned"
8924 async_private_error=-2" \
8925 "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \
8927 -s "Async cancel" \
8928 -s "! mbedtls_ssl_handshake returned" \
8929 -s "Async resume" \
8930 -s "Successful connection"
8936 async_private_error=-3" \
8937 "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \
8939 -s "! mbedtls_ssl_handshake returned" \
8940 -s "Async resume" \
8941 -s "Successful connection"
8951 async_operations=s async_private_delay1=1 async_private_error=-2 \
8954 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256;
8955 [ \$? -eq 1 ] &&
8956 $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \
8958 -s "Async sign callback: using key slot 0" \
8959 -S "Async resume" \
8960 -s "Async cancel" \
8961 -s "! mbedtls_ssl_handshake returned" \
8962 -s "Async sign callback: no key matches this certificate." \
8963 -s "Successful connection"
8973 async_operations=s async_private_delay1=1 async_private_error=-3 \
8976 "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256;
8977 [ \$? -eq 1 ] &&
8978 $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \
8980 -s "Async resume" \
8981 -s "! mbedtls_ssl_handshake returned" \
8982 -s "Async sign callback: no key matches this certificate." \
8983 -s "Successful connection"
8987 run_test "SSL async private: renegotiation: client-initiated, sign" \
8993 -s "Async sign callback: using key slot " \
8994 -s "Async resume (slot [0-9]): sign done, status=0"
8998 run_test "SSL async private: renegotiation: server-initiated, sign" \
9004 -s "Async sign callback: using key slot " \
9005 -s "Async resume (slot [0-9]): sign done, status=0"
9009 run_test "SSL async private: renegotiation: client-initiated, decrypt" \
9014 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
9016 -s "Async decrypt callback: using key slot " \
9017 -s "Async resume (slot [0-9]): decrypt done, status=0"
9021 run_test "SSL async private: renegotiation: server-initiated, decrypt" \
9026 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
9028 -s "Async decrypt callback: using key slot " \
9029 -s "Async resume (slot [0-9]): decrypt done, status=0"
9031 # Tests for ECC extensions (rfc 4492)
9039 "$P_CLI debug_level=3 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA256" \
9041 -C "client hello, adding supported_groups extension" \
9042 -C "client hello, adding supported_point_formats extension" \
9043 -S "found supported elliptic curves extension" \
9044 -S "found supported point formats extension"
9051 "$P_SRV debug_level=3 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA256" \
9054 -C "found supported_point_formats extension" \
9055 -S "server hello, supported_point_formats extension"
9062 "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \
9064 -c "client hello, adding supported_groups extension" \
9065 -c "client hello, adding supported_point_formats extension" \
9066 -s "found supported elliptic curves extension" \
9067 -s "found supported point formats extension"
9073 "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \
9076 -c "found supported_point_formats extension" \
9077 -s "server hello, supported_point_formats extension"
9079 # Tests for DTLS HelloVerifyRequest
9086 -s "cookie verification failed" \
9087 -s "cookie verification passed" \
9088 -S "cookie verification skipped" \
9089 -c "received hello verify request" \
9090 -s "hello verification requested" \
9091 -S "SSL - The requested feature is not available"
9098 -S "cookie verification failed" \
9099 -S "cookie verification passed" \
9100 -s "cookie verification skipped" \
9101 -C "received hello verify request" \
9102 -S "hello verification requested" \
9103 -S "SSL - The requested feature is not available"
9107 "$P_SRV dtls=1 debug_level=2 cookies=-1" \
9108 "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \
9110 -s "cookie verification failed" \
9111 -S "cookie verification passed" \
9112 -S "cookie verification skipped" \
9113 -C "received hello verify request" \
9114 -S "hello verification requested" \
9115 -s "SSL - The requested feature is not available"
9123 -s "cookie verification failed" \
9124 -s "cookie verification passed" \
9125 -S "cookie verification skipped" \
9126 -c "received hello verify request" \
9127 -s "hello verification requested" \
9128 -S "SSL - The requested feature is not available"
9135 -s "cookie verification failed" \
9136 -s "cookie verification passed" \
9137 -S "cookie verification skipped" \
9138 -c "received hello verify request" \
9139 -s "hello verification requested" \
9140 -S "SSL - The requested feature is not available"
9142 # Tests for client reconnecting from the same port with DTLS
9147 "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \
9148 "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=10000-20000" \
9150 -C "resend" \
9151 -S "The operation timed out" \
9152 -S "Client initiated reconnection from same port"
9157 "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \
9158 "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=10000-20000 reconnect_hard=1" \
9160 -C "resend" \
9161 -S "The operation timed out" \
9162 -s "Client initiated reconnection from same port"
9168 "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-1000 reconnect_hard=1" \
9170 -S "The operation timed out" \
9171 -s "Client initiated reconnection from same port"
9176 "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \
9177 "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \
9179 -S "The operation timed out" \
9180 -s "Client initiated reconnection from same port"
9185 "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \
9187 -s "The operation timed out" \
9188 -S "Client initiated reconnection from same port"
9191 run_test "DTLS client reconnect from same port: attacker-injected" \
9192 -p "$P_PXY inject_clihlo=1" \
9196 -s "possible client reconnect from the same port" \
9197 -S "Client initiated reconnection from same port"
9199 # Tests for various cases of client authentication with DTLS
9207 -s "Verifying peer X.509 certificate... ok"
9214 -s "! Certificate was missing"
9221 -c "skip write certificate$" \
9222 -s "! Certificate verification was skipped"
9225 "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \
9228 -s "SSL - Verification of the message MAC failed" \
9229 -c "SSL - A fatal alert message was received from our peer"
9231 # Tests for receiving fragmented handshake messages with DTLS
9236 "$G_SRV -u --mtu 2048 -a" \
9239 -C "found fragmented DTLS handshake message" \
9240 -C "error"
9245 "$G_SRV -u --mtu 512" \
9248 -c "found fragmented DTLS handshake message" \
9249 -C "error"
9254 "$G_SRV -u --mtu 128" \
9257 -c "found fragmented DTLS handshake message" \
9258 -C "error"
9263 "$G_SRV -u --mtu 128" \
9266 -c "found fragmented DTLS handshake message" \
9267 -C "error"
9273 "$G_SRV -u --mtu 256" \
9276 -c "found fragmented DTLS handshake message" \
9277 -c "client hello, adding renegotiation extension" \
9278 -c "found renegotiation extension" \
9279 -c "=> renegotiate" \
9280 -C "mbedtls_ssl_handshake returned" \
9281 -C "error" \
9282 -s "Extra-header:"
9288 "$G_SRV -u --mtu 256" \
9291 -c "found fragmented DTLS handshake message" \
9292 -c "client hello, adding renegotiation extension" \
9293 -c "found renegotiation extension" \
9294 -c "=> renegotiate" \
9295 -C "mbedtls_ssl_handshake returned" \
9296 -C "error" \
9297 -s "Extra-header:"
9301 "$O_SRV -dtls -mtu 2048" \
9304 -C "found fragmented DTLS handshake message" \
9305 -C "error"
9309 "$O_SRV -dtls -mtu 256" \
9312 -c "found fragmented DTLS handshake message" \
9313 -C "error"
9317 "$O_SRV -dtls -mtu 256" \
9320 -c "found fragmented DTLS handshake message" \
9321 -C "error"
9325 "$O_SRV -dtls -mtu 256" \
9328 -c "found fragmented DTLS handshake message" \
9329 -C "error"
9331 # Tests for sending fragmented handshake messages with DTLS
9337 # - 2037B for server certificate
9338 # - 1542B for client certificate
9339 # - 1013B for newsessionticket
9340 # - all others below 512B
9341 # All those tests assume MAX_CONTENT_LEN is at least 2048
9350 crt_file=data_files/server7_int-ca.crt \
9352 hs_timeout=2500-60000 \
9355 crt_file=data_files/server8_int-ca2.crt \
9357 hs_timeout=2500-60000 \
9360 -S "found fragmented DTLS handshake message" \
9361 -C "found fragmented DTLS handshake message" \
9362 -C "error"
9371 crt_file=data_files/server7_int-ca.crt \
9373 hs_timeout=2500-60000 \
9376 crt_file=data_files/server8_int-ca2.crt \
9378 hs_timeout=2500-60000 \
9381 -S "found fragmented DTLS handshake message" \
9382 -c "found fragmented DTLS handshake message" \
9383 -C "error"
9388 # `client-initiated, server only (max_frag_len)` below.
9396 crt_file=data_files/server7_int-ca.crt \
9398 hs_timeout=2500-60000 \
9401 crt_file=data_files/server8_int-ca2.crt \
9403 hs_timeout=2500-60000 \
9406 -S "found fragmented DTLS handshake message" \
9407 -c "found fragmented DTLS handshake message" \
9408 -C "error"
9415 run_test "DTLS fragmenting: client-initiated, server only (max_frag_len)" \
9417 crt_file=data_files/server7_int-ca.crt \
9419 hs_timeout=2500-60000 \
9422 crt_file=data_files/server8_int-ca2.crt \
9424 hs_timeout=2500-60000 \
9427 -S "found fragmented DTLS handshake message" \
9428 -c "found fragmented DTLS handshake message" \
9429 -C "error"
9443 run_test "DTLS fragmenting: client-initiated, server only (max_frag_len), proxy MTU" \
9444 -p "$P_PXY mtu=1110" \
9446 crt_file=data_files/server7_int-ca.crt \
9448 hs_timeout=2500-60000 \
9451 crt_file=data_files/server8_int-ca2.crt \
9453 hs_timeout=2500-60000 \
9456 -S "found fragmented DTLS handshake message" \
9457 -c "found fragmented DTLS handshake message" \
9458 -C "error"
9465 run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \
9467 crt_file=data_files/server7_int-ca.crt \
9469 hs_timeout=2500-60000 \
9472 crt_file=data_files/server8_int-ca2.crt \
9474 hs_timeout=2500-60000 \
9477 -s "found fragmented DTLS handshake message" \
9478 -c "found fragmented DTLS handshake message" \
9479 -C "error"
9493 run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \
9494 -p "$P_PXY mtu=1110" \
9496 crt_file=data_files/server7_int-ca.crt \
9498 hs_timeout=2500-60000 \
9501 crt_file=data_files/server8_int-ca2.crt \
9503 hs_timeout=2500-60000 \
9506 -s "found fragmented DTLS handshake message" \
9507 -c "found fragmented DTLS handshake message" \
9508 -C "error"
9516 crt_file=data_files/server7_int-ca.crt \
9518 hs_timeout=2500-60000 \
9521 crt_file=data_files/server8_int-ca2.crt \
9523 hs_timeout=2500-60000 \
9526 -S "found fragmented DTLS handshake message" \
9527 -C "found fragmented DTLS handshake message" \
9528 -C "error"
9536 crt_file=data_files/server7_int-ca.crt \
9538 hs_timeout=3500-60000 \
9541 crt_file=data_files/server8_int-ca2.crt \
9543 hs_timeout=3500-60000 \
9546 -s "found fragmented DTLS handshake message" \
9547 -C "found fragmented DTLS handshake message" \
9548 -C "error"
9556 crt_file=data_files/server7_int-ca.crt \
9558 hs_timeout=2500-60000 \
9561 crt_file=data_files/server8_int-ca2.crt \
9563 hs_timeout=2500-60000 \
9566 -S "found fragmented DTLS handshake message" \
9567 -c "found fragmented DTLS handshake message" \
9568 -C "error"
9575 -p "$P_PXY mtu=1024" \
9577 crt_file=data_files/server7_int-ca.crt \
9579 hs_timeout=2500-60000 \
9582 crt_file=data_files/server8_int-ca2.crt \
9584 hs_timeout=2500-60000 \
9587 -s "found fragmented DTLS handshake message" \
9588 -c "found fragmented DTLS handshake message" \
9589 -C "error"
9599 -p "$P_PXY mtu=512" \
9601 crt_file=data_files/server7_int-ca.crt \
9603 hs_timeout=2500-60000 \
9606 crt_file=data_files/server8_int-ca2.crt \
9608 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
9609 hs_timeout=2500-60000 \
9612 -s "found fragmented DTLS handshake message" \
9613 -c "found fragmented DTLS handshake message" \
9614 -C "error"
9620 # fragmentation and auto-reduction) an extra retransmission might occur,
9628 run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \
9629 -p "$P_PXY mtu=508" \
9631 crt_file=data_files/server7_int-ca.crt \
9633 hs_timeout=400-3200" \
9635 crt_file=data_files/server8_int-ca2.crt \
9637 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
9638 hs_timeout=400-3200" \
9640 -s "found fragmented DTLS handshake message" \
9641 -c "found fragmented DTLS handshake message" \
9642 -C "error"
9651 run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \
9652 -p "$P_PXY mtu=508" \
9654 crt_file=data_files/server7_int-ca.crt \
9656 hs_timeout=250-10000" \
9658 crt_file=data_files/server8_int-ca2.crt \
9660 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
9661 hs_timeout=250-10000" \
9663 -s "found fragmented DTLS handshake message" \
9664 -c "found fragmented DTLS handshake message" \
9665 -C "error"
9669 # a HelloVerifyRequest, so only check for no retransmission server-side
9676 -p "$P_PXY mtu=1024" \
9678 crt_file=data_files/server7_int-ca.crt \
9680 hs_timeout=10000-60000 \
9683 crt_file=data_files/server8_int-ca2.crt \
9685 hs_timeout=10000-60000 \
9688 -S "autoreduction" \
9689 -s "found fragmented DTLS handshake message" \
9690 -c "found fragmented DTLS handshake message" \
9691 -C "error"
9696 # a HelloVerifyRequest, so only check for no retransmission server-side
9704 -p "$P_PXY mtu=512" \
9706 crt_file=data_files/server7_int-ca.crt \
9708 hs_timeout=10000-60000 \
9711 crt_file=data_files/server8_int-ca2.crt \
9713 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
9714 hs_timeout=10000-60000 \
9717 -S "autoreduction" \
9718 -s "found fragmented DTLS handshake message" \
9719 -c "found fragmented DTLS handshake message" \
9720 -C "error"
9728 -p "$P_PXY mtu=1024" \
9730 crt_file=data_files/server7_int-ca.crt \
9732 hs_timeout=10000-60000 \
9735 crt_file=data_files/server8_int-ca2.crt \
9737 hs_timeout=10000-60000 \
9740 -S "autoreduction" \
9741 -s "found fragmented DTLS handshake message" \
9742 -c "found fragmented DTLS handshake message" \
9743 -C "error"
9753 -p "$P_PXY mtu=512" \
9755 crt_file=data_files/server7_int-ca.crt \
9757 hs_timeout=10000-60000 \
9760 crt_file=data_files/server8_int-ca2.crt \
9762 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
9763 hs_timeout=10000-60000 \
9766 -S "autoreduction" \
9767 -s "found fragmented DTLS handshake message" \
9768 -c "found fragmented DTLS handshake message" \
9769 -C "error"
9777 # An autoreduction on the client-side might happen if the server is
9778 # slow to reset, therefore omitting '-C "autoreduction"' below.
9788 -p "$P_PXY mtu=1450" \
9790 crt_file=data_files/server7_int-ca.crt \
9792 hs_timeout=10000-60000 \
9795 crt_file=data_files/server8_int-ca2.crt \
9797 hs_timeout=10000-60000 \
9798 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
9801 -S "autoreduction" \
9802 -s "found fragmented DTLS handshake message" \
9803 -c "found fragmented DTLS handshake message" \
9804 -C "error"
9806 # An autoreduction on the client-side might happen if the server is
9807 # slow to reset, therefore omitting '-C "autoreduction"' below.
9816 -p "$P_PXY mtu=512" \
9818 crt_file=data_files/server7_int-ca.crt \
9821 hs_timeout=10000-60000 \
9824 crt_file=data_files/server8_int-ca2.crt \
9827 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
9828 hs_timeout=10000-60000 \
9831 -S "autoreduction" \
9832 -s "found fragmented DTLS handshake message" \
9833 -c "found fragmented DTLS handshake message" \
9834 -C "error"
9836 # An autoreduction on the client-side might happen if the server is
9837 # slow to reset, therefore omitting '-C "autoreduction"' below.
9846 run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \
9847 -p "$P_PXY mtu=512" \
9849 crt_file=data_files/server7_int-ca.crt \
9852 hs_timeout=10000-60000 \
9855 crt_file=data_files/server8_int-ca2.crt \
9858 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
9859 hs_timeout=10000-60000 \
9862 -S "autoreduction" \
9863 -s "found fragmented DTLS handshake message" \
9864 -c "found fragmented DTLS handshake message" \
9865 -C "error"
9867 # An autoreduction on the client-side might happen if the server is
9868 # slow to reset, therefore omitting '-C "autoreduction"' below.
9877 run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \
9878 -p "$P_PXY mtu=1024" \
9880 crt_file=data_files/server7_int-ca.crt \
9883 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \
9884 hs_timeout=10000-60000 \
9887 crt_file=data_files/server8_int-ca2.crt \
9890 hs_timeout=10000-60000 \
9893 -S "autoreduction" \
9894 -s "found fragmented DTLS handshake message" \
9895 -c "found fragmented DTLS handshake message" \
9896 -C "error"
9898 # An autoreduction on the client-side might happen if the server is
9899 # slow to reset, therefore omitting '-C "autoreduction"' below.
9909 run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \
9910 -p "$P_PXY mtu=1024" \
9912 crt_file=data_files/server7_int-ca.crt \
9915 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \
9916 hs_timeout=10000-60000 \
9919 crt_file=data_files/server8_int-ca2.crt \
9922 hs_timeout=10000-60000 \
9925 -S "autoreduction" \
9926 -s "found fragmented DTLS handshake message" \
9927 -c "found fragmented DTLS handshake message" \
9928 -C "error"
9930 # An autoreduction on the client-side might happen if the server is
9931 # slow to reset, therefore omitting '-C "autoreduction"' below.
9940 run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \
9941 -p "$P_PXY mtu=1024" \
9943 crt_file=data_files/server7_int-ca.crt \
9946 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \
9947 hs_timeout=10000-60000 \
9950 crt_file=data_files/server8_int-ca2.crt \
9953 hs_timeout=10000-60000 \
9956 -S "autoreduction" \
9957 -s "found fragmented DTLS handshake message" \
9958 -c "found fragmented DTLS handshake message" \
9959 -C "error"
9969 -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \
9971 crt_file=data_files/server7_int-ca.crt \
9973 hs_timeout=250-10000 mtu=512" \
9975 crt_file=data_files/server8_int-ca2.crt \
9977 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
9978 hs_timeout=250-10000 mtu=512" \
9980 -s "found fragmented DTLS handshake message" \
9981 -c "found fragmented DTLS handshake message" \
9982 -C "error"
9992 -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \
9994 crt_file=data_files/server7_int-ca.crt \
9996 hs_timeout=250-10000 mtu=512 nbio=2" \
9998 crt_file=data_files/server8_int-ca2.crt \
10000 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \
10001 hs_timeout=250-10000 mtu=512 nbio=2" \
10003 -s "found fragmented DTLS handshake message" \
10004 -c "found fragmented DTLS handshake message" \
10005 -C "error"
10007 # interop tests for DTLS fragmentating with reliable connection
10016 "$G_SRV -u" \
10018 crt_file=data_files/server8_int-ca2.crt \
10022 -c "fragmenting handshake message" \
10023 -C "error"
10025 # We use --insecure for the GnuTLS client because it expects
10030 # certificate validation fail, but passing --insecure makes
10039 crt_file=data_files/server7_int-ca.crt \
10042 "$G_CLI -u --insecure 127.0.0.1" \
10044 -s "fragmenting handshake message"
10050 "$O_SRV -dtls1_2 -verify 10" \
10052 crt_file=data_files/server8_int-ca2.crt \
10056 -c "fragmenting handshake message" \
10057 -C "error"
10064 crt_file=data_files/server7_int-ca.crt \
10067 "$O_CLI -dtls1_2" \
10069 -s "fragmenting handshake message"
10071 # interop tests for DTLS fragmentating with unreliable connection
10081 -p "$P_PXY drop=8 delay=8 duplicate=8" \
10082 "$G_NEXT_SRV -u" \
10084 crt_file=data_files/server8_int-ca2.crt \
10086 hs_timeout=250-60000 mtu=512 force_version=dtls12" \
10088 -c "fragmenting handshake message" \
10089 -C "error"
10097 -p "$P_PXY drop=8 delay=8 duplicate=8" \
10099 crt_file=data_files/server7_int-ca.crt \
10101 hs_timeout=250-60000 mtu=512 force_version=dtls12" \
10102 "$G_NEXT_CLI -u --insecure 127.0.0.1" \
10104 -s "fragmenting handshake message"
10114 -p "$P_PXY drop=8 delay=8 duplicate=8" \
10115 "$O_NEXT_SRV -dtls1_2 -verify 10" \
10117 crt_file=data_files/server8_int-ca2.crt \
10119 hs_timeout=250-60000 mtu=512 force_version=dtls12" \
10121 -c "fragmenting handshake message" \
10122 -C "error"
10132 -p "$P_PXY drop=8 delay=8 duplicate=8" \
10134 crt_file=data_files/server7_int-ca.crt \
10136 hs_timeout=250-60000 mtu=512 force_version=dtls12" \
10137 "$O_CLI -dtls1_2" \
10139 -s "fragmenting handshake message"
10141 # Tests for DTLS-SRTP (RFC 5764)
10144 run_test "DTLS-SRTP all profiles supported" \
10148 -s "found use_srtp extension" \
10149 -s "found srtp profile" \
10150 -s "selected srtp profile" \
10151 -s "server hello, adding use_srtp extension" \
10152 -s "DTLS-SRTP key material is"\
10153 -c "client hello, adding use_srtp extension" \
10154 -c "found use_srtp extension" \
10155 -c "found srtp profile" \
10156 -c "selected srtp profile" \
10157 -c "DTLS-SRTP key material is"\
10158 -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
10159 -C "error"
10164 run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \
10168 -s "found use_srtp extension" \
10169 -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \
10170 -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \
10171 -s "server hello, adding use_srtp extension" \
10172 -s "DTLS-SRTP key material is"\
10173 -c "client hello, adding use_srtp extension" \
10174 -c "found use_srtp extension" \
10175 -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \
10176 -c "selected srtp profile" \
10177 -c "DTLS-SRTP key material is"\
10178 -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
10179 -C "error"
10183 run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \
10187 -s "found use_srtp extension" \
10188 -s "found srtp profile" \
10189 -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \
10190 -s "server hello, adding use_srtp extension" \
10191 -s "DTLS-SRTP key material is"\
10192 -c "client hello, adding use_srtp extension" \
10193 -c "found use_srtp extension" \
10194 -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \
10195 -c "selected srtp profile" \
10196 -c "DTLS-SRTP key material is"\
10197 -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
10198 -C "error"
10202 run_test "DTLS-SRTP server and Client support only one matching profile." \
10206 -s "found use_srtp extension" \
10207 -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
10208 -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
10209 -s "server hello, adding use_srtp extension" \
10210 -s "DTLS-SRTP key material is"\
10211 -c "client hello, adding use_srtp extension" \
10212 -c "found use_srtp extension" \
10213 -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
10214 -c "selected srtp profile" \
10215 -c "DTLS-SRTP key material is"\
10216 -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
10217 -C "error"
10221 run_test "DTLS-SRTP server and Client support only one different profile." \
10225 -s "found use_srtp extension" \
10226 -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \
10227 -S "selected srtp profile" \
10228 -S "server hello, adding use_srtp extension" \
10229 -S "DTLS-SRTP key material is"\
10230 -c "client hello, adding use_srtp extension" \
10231 -C "found use_srtp extension" \
10232 -C "found srtp profile" \
10233 -C "selected srtp profile" \
10234 -C "DTLS-SRTP key material is"\
10235 -C "error"
10239 run_test "DTLS-SRTP server doesn't support use_srtp extension." \
10243 -s "found use_srtp extension" \
10244 -S "server hello, adding use_srtp extension" \
10245 -S "DTLS-SRTP key material is"\
10246 -c "client hello, adding use_srtp extension" \
10247 -C "found use_srtp extension" \
10248 -C "found srtp profile" \
10249 -C "selected srtp profile" \
10250 -C "DTLS-SRTP key material is"\
10251 -C "error"
10255 run_test "DTLS-SRTP all profiles supported. mki used" \
10259 -s "found use_srtp extension" \
10260 -s "found srtp profile" \
10261 -s "selected srtp profile" \
10262 -s "server hello, adding use_srtp extension" \
10263 -s "dumping 'using mki' (8 bytes)" \
10264 -s "DTLS-SRTP key material is"\
10265 -c "client hello, adding use_srtp extension" \
10266 -c "found use_srtp extension" \
10267 -c "found srtp profile" \
10268 -c "selected srtp profile" \
10269 -c "dumping 'sending mki' (8 bytes)" \
10270 -c "dumping 'received mki' (8 bytes)" \
10271 -c "DTLS-SRTP key material is"\
10272 -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
10273 -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\
10274 -C "error"
10278 run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \
10282 -s "found use_srtp extension" \
10283 -s "found srtp profile" \
10284 -s "selected srtp profile" \
10285 -s "server hello, adding use_srtp extension" \
10286 -s "DTLS-SRTP key material is"\
10287 -s "DTLS-SRTP no mki value negotiated"\
10288 -S "dumping 'using mki' (8 bytes)" \
10289 -c "client hello, adding use_srtp extension" \
10290 -c "found use_srtp extension" \
10291 -c "found srtp profile" \
10292 -c "selected srtp profile" \
10293 -c "DTLS-SRTP key material is"\
10294 -c "DTLS-SRTP no mki value negotiated"\
10295 -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
10296 -c "dumping 'sending mki' (8 bytes)" \
10297 -C "dumping 'received mki' (8 bytes)" \
10298 -C "error"
10302 run_test "DTLS-SRTP all profiles supported. openssl client." \
10304 …"$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtl…
10306 -s "found use_srtp extension" \
10307 -s "found srtp profile" \
10308 -s "selected srtp profile" \
10309 -s "server hello, adding use_srtp extension" \
10310 -s "DTLS-SRTP key material is"\
10311 -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
10312 -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80"
10316 run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order…
10318 …"$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtl…
10320 -s "found use_srtp extension" \
10321 -s "found srtp profile" \
10322 -s "selected srtp profile" \
10323 -s "server hello, adding use_srtp extension" \
10324 -s "DTLS-SRTP key material is"\
10325 -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
10326 -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32"
10330 run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \
10332 …"$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportle…
10334 -s "found use_srtp extension" \
10335 -s "found srtp profile" \
10336 -s "selected srtp profile" \
10337 -s "server hello, adding use_srtp extension" \
10338 -s "DTLS-SRTP key material is"\
10339 -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
10340 -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32"
10344 run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \
10346 …"$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtl…
10348 -s "found use_srtp extension" \
10349 -s "found srtp profile" \
10350 -s "selected srtp profile" \
10351 -s "server hello, adding use_srtp extension" \
10352 -s "DTLS-SRTP key material is"\
10353 -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
10354 -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32"
10358 run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \
10360 …"$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportle…
10362 -s "found use_srtp extension" \
10363 -s "found srtp profile" \
10364 -s "selected srtp profile" \
10365 -s "server hello, adding use_srtp extension" \
10366 -s "DTLS-SRTP key material is"\
10367 -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\
10368 -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32"
10372 run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \
10374 …"$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportle…
10376 -s "found use_srtp extension" \
10377 -s "found srtp profile" \
10378 -S "selected srtp profile" \
10379 -S "server hello, adding use_srtp extension" \
10380 -S "DTLS-SRTP key material is"\
10381 -C "SRTP Extension negotiated, profile"
10385 run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \
10387 …"$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtl…
10389 -s "found use_srtp extension" \
10390 -S "server hello, adding use_srtp extension" \
10391 -S "DTLS-SRTP key material is"\
10392 -C "SRTP Extension negotiated, profile"
10396 run_test "DTLS-SRTP all profiles supported. openssl server" \
10397 …"$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXT…
10400 -c "client hello, adding use_srtp extension" \
10401 -c "found use_srtp extension" \
10402 -c "found srtp profile" \
10403 -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \
10404 -c "DTLS-SRTP key material is"\
10405 -C "error"
10409 run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order…
10410 …"$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXT…
10413 -c "client hello, adding use_srtp extension" \
10414 -c "found use_srtp extension" \
10415 -c "found srtp profile" \
10416 -c "selected srtp profile" \
10417 -c "DTLS-SRTP key material is"\
10418 -C "error"
10422 run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \
10423 …"$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXT…
10426 -c "client hello, adding use_srtp extension" \
10427 -c "found use_srtp extension" \
10428 -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
10429 -c "selected srtp profile" \
10430 -c "DTLS-SRTP key material is"\
10431 -C "error"
10435 run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \
10436 …"$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keym…
10439 -c "client hello, adding use_srtp extension" \
10440 -c "found use_srtp extension" \
10441 -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
10442 -c "selected srtp profile" \
10443 -c "DTLS-SRTP key material is"\
10444 -C "error"
10448 run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \
10449 …"$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keym…
10452 -c "client hello, adding use_srtp extension" \
10453 -c "found use_srtp extension" \
10454 -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
10455 -c "selected srtp profile" \
10456 -c "DTLS-SRTP key material is"\
10457 -C "error"
10461 run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \
10462 …"$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keym…
10465 -c "client hello, adding use_srtp extension" \
10466 -C "found use_srtp extension" \
10467 -C "found srtp profile" \
10468 -C "selected srtp profile" \
10469 -C "DTLS-SRTP key material is"\
10470 -C "error"
10474 run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \
10475 "$O_SRV -dtls" \
10478 -c "client hello, adding use_srtp extension" \
10479 -C "found use_srtp extension" \
10480 -C "found srtp profile" \
10481 -C "selected srtp profile" \
10482 -C "DTLS-SRTP key material is"\
10483 -C "error"
10487 run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \
10488 …"$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXT…
10491 -c "client hello, adding use_srtp extension" \
10492 -c "found use_srtp extension" \
10493 -c "found srtp profile" \
10494 -c "selected srtp profile" \
10495 -c "DTLS-SRTP key material is"\
10496 -c "DTLS-SRTP no mki value negotiated"\
10497 -c "dumping 'sending mki' (8 bytes)" \
10498 -C "dumping 'received mki' (8 bytes)" \
10499 -C "error"
10504 run_test "DTLS-SRTP all profiles supported. gnutls client." \
10506 …"$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_…
10508 -s "found use_srtp extension" \
10509 -s "found srtp profile" \
10510 -s "selected srtp profile" \
10511 -s "server hello, adding use_srtp extension" \
10512 -s "DTLS-SRTP key material is"\
10513 -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80"
10518 run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order…
10520 …"$G_CLI -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_80:SRTP_NULL_SHA1_32:SR…
10522 -s "found use_srtp extension" \
10523 -s "found srtp profile" \
10524 -s "selected srtp profile" \
10525 -s "server hello, adding use_srtp extension" \
10526 -s "DTLS-SRTP key material is"\
10527 -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80"
10532 run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls client." \
10534 "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \
10536 -s "found use_srtp extension" \
10537 -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
10538 -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
10539 -s "server hello, adding use_srtp extension" \
10540 -s "DTLS-SRTP key material is"\
10541 -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32"
10546 run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls client." \
10548 …"$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_…
10550 -s "found use_srtp extension" \
10551 -s "found srtp profile" \
10552 -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \
10553 -s "server hello, adding use_srtp extension" \
10554 -s "DTLS-SRTP key material is"\
10555 -c "SRTP profile: SRTP_NULL_SHA1_32"
10560 run_test "DTLS-SRTP server and Client support only one matching profile. gnutls client." \
10562 "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \
10564 -s "found use_srtp extension" \
10565 -s "found srtp profile" \
10566 -s "selected srtp profile" \
10567 -s "server hello, adding use_srtp extension" \
10568 -s "DTLS-SRTP key material is"\
10569 -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32"
10574 run_test "DTLS-SRTP server and Client support only one different profile. gnutls client." \
10576 "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \
10578 -s "found use_srtp extension" \
10579 -s "found srtp profile" \
10580 -S "selected srtp profile" \
10581 -S "server hello, adding use_srtp extension" \
10582 -S "DTLS-SRTP key material is"\
10583 -C "SRTP profile:"
10588 run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls client" \
10590 …"$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_…
10592 -s "found use_srtp extension" \
10593 -S "server hello, adding use_srtp extension" \
10594 -S "DTLS-SRTP key material is"\
10595 -C "SRTP profile:"
10600 run_test "DTLS-SRTP all profiles supported. gnutls server" \
10601 …"$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_…
10604 -c "client hello, adding use_srtp extension" \
10605 -c "found use_srtp extension" \
10606 -c "found srtp profile" \
10607 -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \
10608 -c "DTLS-SRTP key material is"\
10609 -C "error"
10614 run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order…
10615 …"$G_SRV -u --srtp-profiles=SRTP_NULL_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_…
10618 -c "client hello, adding use_srtp extension" \
10619 -c "found use_srtp extension" \
10620 -c "found srtp profile" \
10621 -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \
10622 -c "DTLS-SRTP key material is"\
10623 -C "error"
10628 run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \
10629 …"$G_SRV -u --srtp-profiles=SRTP_NULL_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_…
10632 -c "client hello, adding use_srtp extension" \
10633 -c "found use_srtp extension" \
10634 -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
10635 -c "selected srtp profile" \
10636 -c "DTLS-SRTP key material is"\
10637 -C "error"
10642 run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \
10643 "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \
10646 -c "client hello, adding use_srtp extension" \
10647 -c "found use_srtp extension" \
10648 -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \
10649 -c "selected srtp profile" \
10650 -c "DTLS-SRTP key material is"\
10651 -C "error"
10656 run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \
10657 "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \
10660 -c "client hello, adding use_srtp extension" \
10661 -c "found use_srtp extension" \
10662 -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \
10663 -c "selected srtp profile" \
10664 -c "DTLS-SRTP key material is"\
10665 -C "error"
10670 run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \
10671 "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \
10674 -c "client hello, adding use_srtp extension" \
10675 -C "found use_srtp extension" \
10676 -C "found srtp profile" \
10677 -C "selected srtp profile" \
10678 -C "DTLS-SRTP key material is"\
10679 -C "error"
10684 run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \
10685 "$G_SRV -u" \
10688 -c "client hello, adding use_srtp extension" \
10689 -C "found use_srtp extension" \
10690 -C "found srtp profile" \
10691 -C "selected srtp profile" \
10692 -C "DTLS-SRTP key material is"\
10693 -C "error"
10698 run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \
10699 …"$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_…
10702 -c "client hello, adding use_srtp extension" \
10703 -c "found use_srtp extension" \
10704 -c "found srtp profile" \
10705 -c "selected srtp profile" \
10706 -c "DTLS-SRTP key material is"\
10707 -c "DTLS-SRTP mki value:"\
10708 -c "dumping 'sending mki' (8 bytes)" \
10709 -c "dumping 'received mki' (8 bytes)" \
10710 -C "error"
10712 # Tests for specific things with "unreliable" UDP connection
10717 -p "$P_PXY" \
10718 "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \
10719 "$P_CLI dtls=1 debug_level=2 hs_timeout=10000-20000" \
10721 -C "replayed record" \
10722 -S "replayed record" \
10723 -C "Buffer record from epoch" \
10724 -S "Buffer record from epoch" \
10725 -C "ssl_buffer_message" \
10726 -S "ssl_buffer_message" \
10727 -C "discarding invalid record" \
10728 -S "discarding invalid record" \
10729 -S "resend" \
10730 -s "Extra-header:" \
10731 -c "HTTP/1.0 200 OK"
10736 -p "$P_PXY duplicate=1" \
10737 "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \
10738 "$P_CLI dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \
10740 -c "replayed record" \
10741 -s "replayed record" \
10742 -c "record from another epoch" \
10743 -s "record from another epoch" \
10744 -S "resend" \
10745 -s "Extra-header:" \
10746 -c "HTTP/1.0 200 OK"
10749 run_test "DTLS proxy: duplicate every packet, server anti-replay off" \
10750 -p "$P_PXY duplicate=1" \
10754 -c "replayed record" \
10755 -S "replayed record" \
10756 -c "record from another epoch" \
10757 -s "record from another epoch" \
10758 -c "resend" \
10759 -s "resend" \
10760 -s "Extra-header:" \
10761 -c "HTTP/1.0 200 OK"
10765 -p "$P_PXY pack=50" \
10769 -c "next record in same datagram" \
10770 -s "next record in same datagram"
10774 -p "$P_PXY pack=50 duplicate=1" \
10778 -c "next record in same datagram" \
10779 -s "next record in same datagram"
10783 -p "$P_PXY bad_ad=1" \
10787 -c "discarding invalid record (mac)" \
10788 -s "discarding invalid record (mac)" \
10789 -s "Extra-header:" \
10790 -c "HTTP/1.0 200 OK" \
10791 -S "too many records with bad MAC" \
10792 -S "Verification of the message MAC failed"
10796 -p "$P_PXY bad_ad=1" \
10800 -C "discarding invalid record (mac)" \
10801 -S "discarding invalid record (mac)" \
10802 -S "Extra-header:" \
10803 -C "HTTP/1.0 200 OK" \
10804 -s "too many records with bad MAC" \
10805 -s "Verification of the message MAC failed"
10809 -p "$P_PXY bad_ad=1" \
10813 -c "discarding invalid record (mac)" \
10814 -s "discarding invalid record (mac)" \
10815 -s "Extra-header:" \
10816 -c "HTTP/1.0 200 OK" \
10817 -S "too many records with bad MAC" \
10818 -S "Verification of the message MAC failed"
10822 -p "$P_PXY bad_ad=1" \
10826 -c "discarding invalid record (mac)" \
10827 -s "discarding invalid record (mac)" \
10828 -s "Extra-header:" \
10829 -c "HTTP/1.0 200 OK" \
10830 -s "too many records with bad MAC" \
10831 -s "Verification of the message MAC failed"
10835 -p "$P_PXY delay_ccs=1" \
10839 -c "record from another epoch" \
10840 -s "record from another epoch" \
10841 -s "Extra-header:" \
10842 -c "HTTP/1.0 200 OK"
10844 # Tests for reordering support with DTLS
10848 run_test "DTLS reordering: Buffer out-of-order handshake message on client" \
10849 -p "$P_PXY delay_srv=ServerHello" \
10851 hs_timeout=2500-60000" \
10853 hs_timeout=2500-60000" \
10855 -c "Buffering HS message" \
10856 -c "Next handshake message has been buffered - load"\
10857 -S "Buffering HS message" \
10858 -S "Next handshake message has been buffered - load"\
10859 -C "Injecting buffered CCS message" \
10860 -C "Remember CCS message" \
10861 -S "Injecting buffered CCS message" \
10862 -S "Remember CCS message"
10866 run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \
10867 -p "$P_PXY delay_srv=ServerHello" \
10869 hs_timeout=2500-60000" \
10871 hs_timeout=2500-60000" \
10873 -c "Buffering HS message" \
10874 -c "found fragmented DTLS handshake message"\
10875 -c "Next handshake message 1 not or only partially bufffered" \
10876 -c "Next handshake message has been buffered - load"\
10877 -S "Buffering HS message" \
10878 -S "Next handshake message has been buffered - load"\
10879 -C "Injecting buffered CCS message" \
10880 -C "Remember CCS message" \
10881 -S "Injecting buffered CCS message" \
10882 -S "Remember CCS message"
10891 run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next" \
10892 -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \
10894 hs_timeout=2500-60000" \
10896 hs_timeout=2500-60000" \
10898 -c "Buffering HS message" \
10899 -c "Next handshake message has been buffered - load"\
10900 -C "attempt to make space by freeing buffered messages" \
10901 -S "Buffering HS message" \
10902 -S "Next handshake message has been buffered - load"\
10903 -C "Injecting buffered CCS message" \
10904 -C "Remember CCS message" \
10905 -S "Injecting buffered CCS message" \
10906 -S "Remember CCS message"
10915 run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered ms…
10916 -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \
10918 hs_timeout=2500-60000" \
10920 hs_timeout=2500-60000" \
10922 -c "Buffering HS message" \
10923 -c "attempt to make space by freeing buffered future messages" \
10924 -c "Enough space available after freeing buffered HS messages" \
10925 -S "Buffering HS message" \
10926 -S "Next handshake message has been buffered - load"\
10927 -C "Injecting buffered CCS message" \
10928 -C "Remember CCS message" \
10929 -S "Injecting buffered CCS message" \
10930 -S "Remember CCS message"
10934 run_test "DTLS reordering: Buffer out-of-order handshake message on server" \
10935 -p "$P_PXY delay_cli=Certificate" \
10937 hs_timeout=2500-60000" \
10939 hs_timeout=2500-60000" \
10941 -C "Buffering HS message" \
10942 -C "Next handshake message has been buffered - load"\
10943 -s "Buffering HS message" \
10944 -s "Next handshake message has been buffered - load" \
10945 -C "Injecting buffered CCS message" \
10946 -C "Remember CCS message" \
10947 -S "Injecting buffered CCS message" \
10948 -S "Remember CCS message"
10952 run_test "DTLS reordering: Buffer out-of-order CCS message on client"\
10953 -p "$P_PXY delay_srv=NewSessionTicket" \
10955 hs_timeout=2500-60000" \
10957 hs_timeout=2500-60000" \
10959 -C "Buffering HS message" \
10960 -C "Next handshake message has been buffered - load"\
10961 -S "Buffering HS message" \
10962 -S "Next handshake message has been buffered - load" \
10963 -c "Injecting buffered CCS message" \
10964 -c "Remember CCS message" \
10965 -S "Injecting buffered CCS message" \
10966 -S "Remember CCS message"
10970 run_test "DTLS reordering: Buffer out-of-order CCS message on server"\
10971 -p "$P_PXY delay_cli=ClientKeyExchange" \
10973 hs_timeout=2500-60000" \
10975 hs_timeout=2500-60000" \
10977 -C "Buffering HS message" \
10978 -C "Next handshake message has been buffered - load"\
10979 -S "Buffering HS message" \
10980 -S "Next handshake message has been buffered - load" \
10981 -C "Injecting buffered CCS message" \
10982 -C "Remember CCS message" \
10983 -s "Injecting buffered CCS message" \
10984 -s "Remember CCS message"
10988 -p "$P_PXY delay_ccs=1" \
10990 hs_timeout=2500-60000" \
10992 hs_timeout=2500-60000" \
10994 -s "Buffer record from epoch 1" \
10995 -s "Found buffered record from current epoch - load" \
10996 -c "Buffer record from epoch 1" \
10997 -c "Found buffered record from current epoch - load"
11005 # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering
11008 # - The MTU setting on the server must be so small that the NewSessionTicket
11010 # - All messages sent by the server must be small enough to be either sent
11012 # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based
11017 -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \
11019 …$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc12…
11021 -s "Buffer record from epoch 1" \
11022 -s "Found buffered record from current epoch - load" \
11023 -c "Buffer record from epoch 1" \
11024 -C "Found buffered record from current epoch - load" \
11025 -c "Enough space available after freeing future epoch record"
11027 # Tests for "randomly unreliable connection": try a variety of flows and peers
11031 -p "$P_PXY drop=5 delay=5 duplicate=5" \
11032 "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \
11034 "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \
11035 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \
11037 -s "Extra-header:" \
11038 -c "HTTP/1.0 200 OK"
11042 -p "$P_PXY drop=5 delay=5 duplicate=5" \
11043 "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \
11044 "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 \
11045 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \
11047 -s "Extra-header:" \
11048 -c "HTTP/1.0 200 OK"
11053 -p "$P_PXY drop=5 delay=5 duplicate=5" \
11054 "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \
11055 "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0" \
11057 -s "Extra-header:" \
11058 -c "HTTP/1.0 200 OK"
11063 -p "$P_PXY drop=5 delay=5 duplicate=5" \
11064 "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \
11065 "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0" \
11067 -s "Extra-header:" \
11068 -c "HTTP/1.0 200 OK"
11073 -p "$P_PXY drop=5 delay=5 duplicate=5" \
11074 "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \
11075 "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1" \
11077 -s "Extra-header:" \
11078 -c "HTTP/1.0 200 OK"
11083 -p "$P_PXY drop=5 delay=5 duplicate=5" \
11084 "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \
11085 "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1" \
11087 -s "Extra-header:" \
11088 -c "HTTP/1.0 200 OK"
11093 -p "$P_PXY drop=5 delay=5 duplicate=5" \
11094 "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 nbio=2 tickets=1 \
11096 "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 nbio=2 tickets=1" \
11098 -s "Extra-header:" \
11099 -c "HTTP/1.0 200 OK"
11104 -p "$P_PXY drop=5 delay=5 duplicate=5" \
11105 "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \
11107 "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \
11109 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \
11111 -s "a session has been resumed" \
11112 -c "a session has been resumed" \
11113 -s "Extra-header:" \
11114 -c "HTTP/1.0 200 OK"
11119 -p "$P_PXY drop=5 delay=5 duplicate=5" \
11120 "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \
11122 "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \
11124 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \
11126 -s "a session has been resumed" \
11127 -c "a session has been resumed" \
11128 -s "Extra-header:" \
11129 -c "HTTP/1.0 200 OK"
11133 run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \
11134 -p "$P_PXY drop=5 delay=5 duplicate=5" \
11135 "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \
11137 "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \
11139 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \
11141 -c "=> renegotiate" \
11142 -s "=> renegotiate" \
11143 -s "Extra-header:" \
11144 -c "HTTP/1.0 200 OK"
11148 run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \
11149 -p "$P_PXY drop=5 delay=5 duplicate=5" \
11150 "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \
11152 "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \
11154 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \
11156 -c "=> renegotiate" \
11157 -s "=> renegotiate" \
11158 -s "Extra-header:" \
11159 -c "HTTP/1.0 200 OK"
11163 run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \
11164 -p "$P_PXY drop=5 delay=5 duplicate=5" \
11165 "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \
11168 "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \
11170 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \
11172 -c "=> renegotiate" \
11173 -s "=> renegotiate" \
11174 -s "Extra-header:" \
11175 -c "HTTP/1.0 200 OK"
11179 run_test "DTLS proxy: 3d, min handshake, server-initiated renego, nbio" \
11180 -p "$P_PXY drop=5 delay=5 duplicate=5" \
11181 "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \
11184 "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \
11186 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \
11188 -c "=> renegotiate" \
11189 -s "=> renegotiate" \
11190 -s "Extra-header:" \
11191 -c "HTTP/1.0 200 OK"
11193 ## The three tests below require 1.1.1a or higher version of openssl, otherwise
11198 not_with_valgrind # risk of non-mbedtls peer timing out
11201 -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \
11202 "$O_NEXT_SRV -dtls1_2 -mtu 2048" \
11203 "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 tickets=0" \
11205 -c "HTTP/1.0 200 OK"
11209 not_with_valgrind # risk of non-mbedtls peer timing out
11212 -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \
11213 "$O_NEXT_SRV -dtls1_2 -mtu 768" \
11214 "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 tickets=0" \
11216 -c "HTTP/1.0 200 OK"
11220 not_with_valgrind # risk of non-mbedtls peer timing out
11223 -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \
11224 "$O_NEXT_SRV -dtls1_2 -mtu 768" \
11225 "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 nbio=2 tickets=0" \
11227 -c "HTTP/1.0 200 OK"
11231 not_with_valgrind # risk of non-mbedtls peer timing out
11234 -p "$P_PXY drop=5 delay=5 duplicate=5" \
11235 "$G_SRV -u --mtu 2048 -a" \
11236 "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000" \
11238 -s "Extra-header:" \
11239 -c "Extra-header:"
11243 not_with_valgrind # risk of non-mbedtls peer timing out
11246 -p "$P_PXY drop=5 delay=5 duplicate=5" \
11247 "$G_NEXT_SRV -u --mtu 512" \
11248 "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000" \
11250 -s "Extra-header:" \
11251 -c "Extra-header:"
11255 not_with_valgrind # risk of non-mbedtls peer timing out
11258 -p "$P_PXY drop=5 delay=5 duplicate=5" \
11259 "$G_NEXT_SRV -u --mtu 512" \
11260 "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 nbio=2" \
11262 -s "Extra-header:" \
11263 -c "Extra-header:"
11270 -c "EAP-TLS key material is:"\
11271 -s "EAP-TLS key material is:"\
11272 -c "EAP-TLS IV is:" \
11273 -s "EAP-TLS IV is:"
11275 # openssl feature tests: check if tls1.3 exists.
11278 "$O_NEXT_SRV -tls1_3 -msg" \
11279 "$O_NEXT_CLI -tls1_3 -msg" \
11281 -c "TLS 1.3" \
11282 -s "TLS 1.3"
11284 # gnutls feature tests: check if TLS 1.3 is supported as well as the NO_TICKETS and DISABLE_TLS13_C…
11289 …"$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPA…
11290 …"$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_…
11292 -s "Version: TLS1.3" \
11293 -c "Version: TLS1.3"
11298 requires_ciphersuite_enabled TLS1-3-CHACHA20-POLY1305-SHA256
11305 -s "Protocol is TLSv1.3" \
11306 -s "Ciphersuite is TLS1-3-CHACHA20-POLY1305-SHA256" \
11307 -s "ECDH/FFDH group: " \
11308 -s "selected signature algorithm ecdsa_secp256r1_sha256"
11315 run_test "TLS 1.3: minimal feature sets - openssl" \
11316 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \
11319 -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \
11320 -c "client state: MBEDTLS_SSL_SERVER_HELLO" \
11321 -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
11322 -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \
11323 -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \
11324 -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \
11325 -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \
11326 -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \
11327 -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \
11328 -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \
11329 -c "<= ssl_tls13_process_server_hello" \
11330 -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \
11331 -c "DHE group name: " \
11332 -c "=> ssl_tls13_process_server_hello" \
11333 -c "<= parse encrypted extensions" \
11334 -c "Certificate verification flags clear" \
11335 -c "=> parse certificate verify" \
11336 -c "<= parse certificate verify" \
11337 -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \
11338 -c "<= parse finished message" \
11339 -c "Protocol is TLSv1.3" \
11340 -c "HTTP/1.0 200 ok"
11348 run_test "TLS 1.3: minimal feature sets - gnutls" \
11349 …"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-…
11352 -s "SERVER HELLO was queued" \
11353 -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \
11354 -c "client state: MBEDTLS_SSL_SERVER_HELLO" \
11355 -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
11356 -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \
11357 -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \
11358 -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \
11359 -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \
11360 -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \
11361 -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \
11362 -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \
11363 -c "<= ssl_tls13_process_server_hello" \
11364 -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \
11365 -c "DHE group name: " \
11366 -c "=> ssl_tls13_process_server_hello" \
11367 -c "<= parse encrypted extensions" \
11368 -c "Certificate verification flags clear" \
11369 -c "=> parse certificate verify" \
11370 -c "<= parse certificate verify" \
11371 -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \
11372 -c "<= parse finished message" \
11373 -c "Protocol is TLSv1.3" \
11374 -c "HTTP/1.0 200 OK"
11382 run_test "TLS 1.3: alpn - openssl" \
11383 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -alpn h2" \
11386 -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \
11387 -c "client state: MBEDTLS_SSL_SERVER_HELLO" \
11388 -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
11389 -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \
11390 -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \
11391 -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \
11392 -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \
11393 -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \
11394 -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \
11395 -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \
11396 -c "<= ssl_tls13_process_server_hello" \
11397 -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \
11398 -c "DHE group name: " \
11399 -c "=> ssl_tls13_process_server_hello" \
11400 -c "<= parse encrypted extensions" \
11401 -c "Certificate verification flags clear" \
11402 -c "=> parse certificate verify" \
11403 -c "<= parse certificate verify" \
11404 -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \
11405 -c "<= parse finished message" \
11406 -c "Protocol is TLSv1.3" \
11407 -c "HTTP/1.0 200 ok" \
11408 -c "Application Layer Protocol is h2"
11417 run_test "TLS 1.3: alpn - gnutls" \
11418 …"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-…
11421 -s "SERVER HELLO was queued" \
11422 -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \
11423 -c "client state: MBEDTLS_SSL_SERVER_HELLO" \
11424 -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
11425 -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \
11426 -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \
11427 -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \
11428 -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \
11429 -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \
11430 -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \
11431 -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \
11432 -c "<= ssl_tls13_process_server_hello" \
11433 -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \
11434 -c "DHE group name: " \
11435 -c "=> ssl_tls13_process_server_hello" \
11436 -c "<= parse encrypted extensions" \
11437 -c "Certificate verification flags clear" \
11438 -c "=> parse certificate verify" \
11439 -c "<= parse certificate verify" \
11440 -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \
11441 -c "<= parse finished message" \
11442 -c "Protocol is TLSv1.3" \
11443 -c "HTTP/1.0 200 OK" \
11444 -c "Application Layer Protocol is h2"
11451 run_test "TLS 1.3: server alpn - openssl" \
11453 "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \
11455 -s "found alpn extension" \
11456 -s "server side, adding alpn extension" \
11457 -s "Protocol is TLSv1.3" \
11458 -s "HTTP/1.0 200 OK" \
11459 -s "Application Layer Protocol is h2"
11466 run_test "TLS 1.3: server alpn - gnutls" \
11468 …"$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_CO…
11470 -s "found alpn extension" \
11471 -s "server side, adding alpn extension" \
11472 -s "Protocol is TLSv1.3" \
11473 -s "HTTP/1.0 200 OK" \
11474 -s "Application Layer Protocol is h2"
11482 "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \
11485 -s "Client's version: 3.3" \
11486 -S "Version: TLS1.0" \
11487 -C "Protocol is TLSv1.0"
11495 "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \
11498 -s "Client's version: 3.3" \
11499 -S "Version: TLS1.1" \
11500 -C "Protocol is TLSv1.1"
11508 "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \
11511 -s "Client's version: 3.3" \
11512 -c "is a fatal alert message (msg 40)" \
11513 -S "Version: TLS1.2" \
11514 -C "Protocol is TLSv1.2"
11522 "$O_NEXT_SRV -msg -tls1" \
11525 -s "fatal protocol_version" \
11526 -c "is a fatal alert message (msg 70)" \
11527 -S "Version: TLS1.0" \
11528 -C "Protocol : TLSv1.0"
11536 "$O_NEXT_SRV -msg -tls1_1" \
11539 -s "fatal protocol_version" \
11540 -c "is a fatal alert message (msg 70)" \
11541 -S "Version: TLS1.1" \
11542 -C "Protocol : TLSv1.1"
11550 "$O_NEXT_SRV -msg -tls1_2" \
11553 -s "fatal protocol_version" \
11554 -c "is a fatal alert message (msg 70)" \
11555 -S "Version: TLS1.2" \
11556 -C "Protocol : TLSv1.2"
11563 run_test "TLS 1.3: Client authentication, no client certificate - openssl" \
11564 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -verify 10" \
11567 -c "got a certificate request" \
11568 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11569 -s "TLS 1.3" \
11570 -c "HTTP/1.0 200 ok" \
11571 -c "Protocol is TLSv1.3"
11579 run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \
11580 …"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --verify-c…
11583 -c "got a certificate request" \
11584 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\
11585 -s "Version: TLS1.3" \
11586 -c "HTTP/1.0 200 OK" \
11587 -c "Protocol is TLSv1.3"
11594 run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \
11595 …"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \
11598 -c "got a certificate request" \
11599 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11600 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11601 -c "Protocol is TLSv1.3"
11608 run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \
11609 …"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_T…
11613 -c "got a certificate request" \
11614 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11615 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11616 -c "Protocol is TLSv1.3"
11623 run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \
11624 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
11628 -c "got a certificate request" \
11629 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11630 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11631 -c "Protocol is TLSv1.3"
11639 run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \
11640 … "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
11644 -c "got a certificate request" \
11645 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11646 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11647 -c "Protocol is TLSv1.3"
11654 run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \
11655 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
11659 -c "got a certificate request" \
11660 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11661 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11662 -c "Protocol is TLSv1.3"
11670 run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \
11671 … "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
11675 -c "got a certificate request" \
11676 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11677 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11678 -c "Protocol is TLSv1.3"
11685 run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \
11686 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
11690 -c "got a certificate request" \
11691 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11692 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11693 -c "Protocol is TLSv1.3"
11701 run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \
11702 … "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
11706 -c "got a certificate request" \
11707 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11708 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11709 -c "Protocol is TLSv1.3"
11717 run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \
11718 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
11722 -c "got a certificate request" \
11723 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11724 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11725 -c "Protocol is TLSv1.3"
11734 run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \
11735 … "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
11736 "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \
11739 -c "got a certificate request" \
11740 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11741 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11742 -c "Protocol is TLSv1.3"
11750 run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \
11751 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
11755 -c "got a certificate request" \
11756 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11757 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11758 -c "Protocol is TLSv1.3"
11767 run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \
11768 … "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
11769 "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \
11772 -c "got a certificate request" \
11773 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11774 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11775 -c "Protocol is TLSv1.3"
11783 run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \
11784 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
11788 -c "got a certificate request" \
11789 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11790 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11791 -c "Protocol is TLSv1.3"
11800 run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \
11801 … "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
11802 "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \
11805 -c "got a certificate request" \
11806 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11807 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11808 -c "Protocol is TLSv1.3"
11816 run_test "TLS 1.3: Client authentication, client alg not in server list - openssl" \
11817 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10
11818 -sigalgs ecdsa_secp256r1_sha256" \
11822 -c "got a certificate request" \
11823 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11824 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11825 -c "no suitable signature algorithm"
11834 run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \
11835 …"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-…
11839 -c "got a certificate request" \
11840 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11841 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11842 -c "no suitable signature algorithm"
11850 run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \
11851 …"$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \
11854 -c "got a certificate request" \
11855 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11856 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11857 -c "Protocol is TLSv1.3"
11865 run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \
11866 …"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_T…
11870 -c "got a certificate request" \
11871 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11872 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11873 -c "Protocol is TLSv1.3"
11881 run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \
11882 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
11886 -c "got a certificate request" \
11887 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11888 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11889 -c "Protocol is TLSv1.3"
11898 run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \
11899 … "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
11903 -c "got a certificate request" \
11904 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11905 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11906 -c "Protocol is TLSv1.3"
11914 run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \
11915 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
11919 -c "got a certificate request" \
11920 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11921 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11922 -c "Protocol is TLSv1.3"
11931 run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \
11932 … "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
11936 -c "got a certificate request" \
11937 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11938 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11939 -c "Protocol is TLSv1.3"
11947 run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \
11948 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
11952 -c "got a certificate request" \
11953 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11954 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11955 -c "Protocol is TLSv1.3"
11964 run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \
11965 … "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
11969 -c "got a certificate request" \
11970 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11971 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11972 -c "Protocol is TLSv1.3"
11981 run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \
11982 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
11986 -c "got a certificate request" \
11987 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
11988 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
11989 -c "Protocol is TLSv1.3"
11999 run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \
12000 … "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
12001 "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \
12004 -c "got a certificate request" \
12005 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
12006 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
12007 -c "Protocol is TLSv1.3"
12016 run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \
12017 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
12021 -c "got a certificate request" \
12022 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
12023 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
12024 -c "Protocol is TLSv1.3"
12034 run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \
12035 … "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
12036 "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \
12039 -c "got a certificate request" \
12040 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
12041 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
12042 -c "Protocol is TLSv1.3"
12051 run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \
12052 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \
12056 -c "got a certificate request" \
12057 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
12058 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
12059 -c "Protocol is TLSv1.3"
12069 run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \
12070 … "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \
12071 "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \
12074 -c "got a certificate request" \
12075 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
12076 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
12077 -c "Protocol is TLSv1.3"
12086 run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \
12087 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10
12088 -sigalgs ecdsa_secp256r1_sha256" \
12092 -c "got a certificate request" \
12093 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
12094 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
12095 -c "no suitable signature algorithm"
12105 run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \
12106 …"$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-…
12110 -c "got a certificate request" \
12111 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \
12112 -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \
12113 -c "no suitable signature algorithm"
12120 run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_128_GCM_SHA256 - openssl" \
12121 …NEXT_SRV -ciphersuites TLS_AES_128_GCM_SHA256 -sigalgs ecdsa_secp256r1_sha256 -groups P-256 -msg …
12124 -c "received HelloRetryRequest message" \
12125 -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \
12126 -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \
12127 -c "Protocol is TLSv1.3" \
12128 -c "HTTP/1.0 200 ok"
12135 run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_256_GCM_SHA384 - openssl" \
12136 …NEXT_SRV -ciphersuites TLS_AES_256_GCM_SHA384 -sigalgs ecdsa_secp256r1_sha256 -groups P-256 -msg …
12139 -c "received HelloRetryRequest message" \
12140 -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \
12141 -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \
12142 -c "Protocol is TLSv1.3" \
12143 -c "HTTP/1.0 200 ok"
12152 run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_128_GCM_SHA256 - gnutls" \
12153 …EXT_SRV -d 4 --priority=NONE:+GROUP-SECP256R1:+AES-128-GCM:+SHA256:+AEAD:+SIGN-ECDSA-SECP256R1-SHA…
12156 -c "received HelloRetryRequest message" \
12157 -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \
12158 -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \
12159 -c "Protocol is TLSv1.3" \
12160 -c "HTTP/1.0 200 OK"
12169 run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_256_GCM_SHA384 - gnutls" \
12170 …EXT_SRV -d 4 --priority=NONE:+GROUP-SECP256R1:+AES-256-GCM:+SHA384:+AEAD:+SIGN-ECDSA-SECP256R1-SHA…
12173 -c "received HelloRetryRequest message" \
12174 -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \
12175 -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \
12176 -c "Protocol is TLSv1.3" \
12177 -c "HTTP/1.0 200 OK"
12183 run_test "TLS 1.3: Server side check - openssl" \
12185 "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \
12187 -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \
12188 -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \
12189 -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
12190 -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \
12191 -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \
12192 -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \
12193 -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \
12194 -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP"
12200 run_test "TLS 1.3: Server side check - openssl with client authentication" \
12202 …"$O_NEXT_CLI -msg -debug -cert data_files/server5.crt -key data_files/server5.key -tls1_3 -no_midd…
12204 -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \
12205 -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \
12206 -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
12207 -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \
12208 -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \
12209 -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \
12210 -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \
12211 -s "=> write certificate request" \
12212 -s "=> parse client hello" \
12213 -s "<= parse client hello"
12220 run_test "TLS 1.3: Server side check - gnutls" \
12222 …"$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_CO…
12224 -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \
12225 -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \
12226 -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
12227 -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \
12228 -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \
12229 -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \
12230 -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \
12231 -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \
12232 -c "HTTP/1.0 200 OK"
12239 run_test "TLS 1.3: Server side check - gnutls with client authentication" \
12241 …-d 4 --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key --priority=NORMAL:…
12243 -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \
12244 -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \
12245 -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
12246 -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \
12247 -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \
12248 -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \
12249 -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \
12250 -s "=> write certificate request" \
12251 -s "=> parse client hello" \
12252 -s "<= parse client hello"
12258 run_test "TLS 1.3: Server side check - mbedtls" \
12262 -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \
12263 -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \
12264 -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
12265 -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \
12266 -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \
12267 -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \
12268 -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \
12269 -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \
12270 -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \
12271 -c "HTTP/1.0 200 OK"
12277 run_test "TLS 1.3: Server side check - mbedtls with client authentication" \
12281 -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \
12282 -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \
12283 -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
12284 -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \
12285 -s "=> write certificate request" \
12286 -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \
12287 -s "=> parse client hello" \
12288 -s "<= parse client hello"
12294 run_test "TLS 1.3: Server side check - mbedtls with client empty certificate" \
12298 -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \
12299 -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \
12300 -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
12301 -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \
12302 -s "=> write certificate request" \
12303 …-s "SSL - No client certification received from the client, but required by the authentication mod…
12304 -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \
12305 -s "=> parse client hello" \
12306 -s "<= parse client hello"
12312 run_test "TLS 1.3: Server side check - mbedtls with optional client authentication" \
12316 -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \
12317 -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \
12318 -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
12319 -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \
12320 -s "=> write certificate request" \
12321 -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \
12322 -s "=> parse client hello" \
12323 -s "<= parse client hello"
12330 run_test "TLS 1.3: server: HRR check - mbedtls" \
12334 -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \
12335 -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \
12336 -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
12337 -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \
12338 -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \
12339 -s "selected_group: secp384r1" \
12340 -s "=> write hello retry request" \
12341 -s "<= write hello retry request"
12351 -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \
12352 -s "No certificate available."
12359 run_test "TLS 1.3: Server side check - openssl with sni" \
12361 …s/server5.key,data_files/test-ca_cat12.crt,-,-,polarssl.example,data_files/server1-nospace.crt,dat…
12362 …$O_NEXT_CLI -msg -debug -servername localhost -CAfile data_files/test-ca_cat12.crt -cert data_file…
12364 -s "parse ServerName extension" \
12365 -s "HTTP/1.0 200 OK"
12372 run_test "TLS 1.3: Server side check - gnutls with sni" \
12374 …s/server5.key,data_files/test-ca_cat12.crt,-,-,polarssl.example,data_files/server1-nospace.crt,dat…
12375 …-d 4 --sni-hostname=localhost --x509certfile data_files/server5.crt --x509keyfile data_files/serve…
12377 -s "parse ServerName extension" \
12378 -s "HTTP/1.0 200 OK"
12385 run_test "TLS 1.3: Server side check - mbedtls with sni" \
12387 …server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_file…
12390 -s "parse ServerName extension" \
12391 -s "HTTP/1.0 200 OK"
12393 for i in opt-testcases/*.sh
12407 run_test "TLS 1.3 m->m both peers do not support middlebox compatibility" \
12411 -s "Protocol is TLSv1.3" \
12412 -c "Protocol is TLSv1.3" \
12413 -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \
12414 -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode"
12421 run_test "TLS 1.3 m->m both with middlebox compat support" \
12425 -s "Protocol is TLSv1.3" \
12426 -c "Protocol is TLSv1.3" \
12427 -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \
12428 -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode"
12435 run_test "TLS 1.3 m->O both peers do not support middlebox compatibility" \
12436 "$O_NEXT_SRV -msg -tls1_3 -no_middlebox -num_tickets 0 -no_resume_ephemeral -no_cache" \
12439 -c "Protocol is TLSv1.3" \
12440 -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \
12441 -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode"
12448 run_test "TLS 1.3 m->O server with middlebox compat support, not client" \
12449 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \
12452 -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode"
12459 run_test "TLS 1.3 m->O both with middlebox compat support" \
12460 "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \
12463 -c "Protocol is TLSv1.3" \
12464 -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode"
12473 run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \
12474 …"$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPA…
12477 -c "Protocol is TLSv1.3" \
12478 -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \
12479 -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode"
12487 run_test "TLS 1.3 m->G server with middlebox compat support, not client" \
12488 …"$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cer…
12491 -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode"
12499 run_test "TLS 1.3 m->G both with middlebox compat support" \
12500 …"$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cer…
12503 -c "Protocol is TLSv1.3" \
12504 -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode"
12511 run_test "TLS 1.3 O->m both peers do not support middlebox compatibility" \
12513 "$O_NEXT_CLI -msg -debug -no_middlebox" \
12515 -s "Protocol is TLSv1.3" \
12516 -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \
12517 -C "14 03 03 00 01"
12524 run_test "TLS 1.3 O->m server with middlebox compat support, not client" \
12526 "$O_NEXT_CLI -msg -debug -no_middlebox" \
12528 -s "Protocol is TLSv1.3" \
12529 -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO"
12536 run_test "TLS 1.3 O->m both with middlebox compat support" \
12538 "$O_NEXT_CLI -msg -debug" \
12540 -s "Protocol is TLSv1.3" \
12541 -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \
12542 -c "14 03 03 00 01"
12551 run_test "TLS 1.3 G->m both peers do not support middlebox compatibility" \
12553 "$G_NEXT_CLI localhost --priority=NORMAL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \
12555 -s "Protocol is TLSv1.3" \
12556 -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \
12557 -C "SSL 3.3 ChangeCipherSpec packet received"
12566 run_test "TLS 1.3 G->m server with middlebox compat support, not client" \
12568 … "$G_NEXT_CLI localhost --debug=10 --priority=NORMAL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \
12570 -s "Protocol is TLSv1.3" \
12571 -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \
12572 -c "SSL 3.3 ChangeCipherSpec packet received" \
12573 -c "discarding change cipher spec in TLS1.3"
12582 run_test "TLS 1.3 G->m both with middlebox compat support" \
12584 … "$G_NEXT_CLI localhost --debug=10 --priority=NORMAL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \
12586 -s "Protocol is TLSv1.3" \
12587 -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \
12588 -c "SSL 3.3 ChangeCipherSpec packet received"
12595 run_test "TLS 1.3 m->m HRR both peers do not support middlebox compatibility" \
12599 -s "Protocol is TLSv1.3" \
12600 -c "Protocol is TLSv1.3" \
12601 -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \
12602 -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \
12603 -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode"
12611 run_test "TLS 1.3 m->m HRR both with middlebox compat support" \
12615 -s "Protocol is TLSv1.3" \
12616 -c "Protocol is TLSv1.3" \
12617 -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \
12618 -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \
12619 -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode"
12626 run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \
12627 "$O_NEXT_SRV -msg -tls1_3 -groups P-384 -no_middlebox -num_tickets 0 -no_cache" \
12630 -c "Protocol is TLSv1.3" \
12631 -c "received HelloRetryRequest message" \
12632 -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \
12633 -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode"
12640 run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \
12641 "$O_NEXT_SRV -msg -tls1_3 -groups P-384 -num_tickets 0 -no_cache" \
12644 -c "received HelloRetryRequest message" \
12645 -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode"
12652 run_test "TLS 1.3 m->O HRR both with middlebox compat support" \
12653 "$O_NEXT_SRV -msg -tls1_3 -groups P-384 -num_tickets 0 -no_resume_ephemeral -no_cache" \
12656 -c "Protocol is TLSv1.3" \
12657 -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode"
12666 run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \
12667 …"$G_NEXT_SRV --priority=NORMAL:-GROUP-ALL:+GROUP-SECP384R1:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DIS…
12670 -c "Protocol is TLSv1.3" \
12671 -c "received HelloRetryRequest message" \
12672 -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \
12673 -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode"
12681 run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \
12682 …"$G_NEXT_SRV --priority=NORMAL:-GROUP-ALL:+GROUP-SECP384R1:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS --di…
12685 -c "received HelloRetryRequest message" \
12686 -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode"
12695 run_test "TLS 1.3 m->G HRR both with middlebox compat support" \
12696 …"$G_NEXT_SRV --priority=NORMAL:-GROUP-ALL:+GROUP-SECP384R1:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_…
12699 -c "Protocol is TLSv1.3" \
12700 -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode"
12707 run_test "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \
12709 "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \
12711 -s "Protocol is TLSv1.3" \
12712 -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \
12713 -C "14 03 03 00 01"
12720 run_test "TLS 1.3 O->m HRR server with middlebox compat support, not client" \
12722 "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \
12724 -s "Protocol is TLSv1.3" \
12725 -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \
12732 run_test "TLS 1.3 O->m HRR both with middlebox compat support" \
12734 "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \
12736 -s "Protocol is TLSv1.3" \
12737 -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \
12738 -c "14 03 03 00 01"
12747 run_test "TLS 1.3 G->m HRR both peers do not support middlebox compatibility" \
12749 …"$G_NEXT_CLI localhost --priority=NORMAL:-GROUP-ALL:+GROUP-SECP256R1:+GROUP-SECP384R1:%NO_TICKETS:…
12751 -s "Protocol is TLSv1.3" \
12752 -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \
12753 -C "SSL 3.3 ChangeCipherSpec packet received"
12763 run_test "TLS 1.3 G->m HRR server with middlebox compat support, not client" \
12765 …NEXT_CLI localhost --debug=10 --priority=NORMAL:-GROUP-ALL:+GROUP-SECP256R1:+GROUP-SECP384R1:%NO_T…
12767 -s "Protocol is TLSv1.3" \
12768 -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \
12769 -c "SSL 3.3 ChangeCipherSpec packet received" \
12770 -c "discarding change cipher spec in TLS1.3"
12780 run_test "TLS 1.3 G->m HRR both with middlebox compat support" \
12782 …NEXT_CLI localhost --debug=10 --priority=NORMAL:-GROUP-ALL:+GROUP-SECP256R1:+GROUP-SECP384R1:%NO_T…
12784 -s "Protocol is TLSv1.3" \
12785 -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \
12786 -c "SSL 3.3 ChangeCipherSpec packet received"
12793 run_test "TLS 1.3: Check signature algorithm order, m->O" \
12794 "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key
12795 -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache
12796 …-Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha25…
12797 … "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \
12800 -c "Protocol is TLSv1.3" \
12801 -c "CertificateVerify signature with rsa_pss_rsae_sha512" \
12802 -c "HTTP/1.0 200 [Oo][Kk]"
12809 run_test "TLS 1.3: Check signature algorithm order, m->G" \
12810 …"$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2…
12811 -d 4
12812 …--priority=NORMAL:-VERS-ALL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSA…
12813 … "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \
12816 -c "Protocol is TLSv1.3" \
12817 -c "CertificateVerify signature with rsa_pss_rsae_sha512" \
12818 -c "HTTP/1.0 200 [Oo][Kk]"
12825 run_test "TLS 1.3: Check signature algorithm order, m->m" \
12827 crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key
12830 … "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \
12833 -c "Protocol is TLSv1.3" \
12834 -c "CertificateVerify signature with rsa_pss_rsae_sha512" \
12835 -s "CertificateVerify signature with rsa_pss_rsae_sha512" \
12836 -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \
12837 -c "HTTP/1.0 200 [Oo][Kk]"
12844 run_test "TLS 1.3: Check signature algorithm order, O->m" \
12846 crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key
12849 "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \
12850 -cert data_files/server2-sha256.crt -key data_files/server2.key \
12851 … -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \
12853 -c "TLSv1.3" \
12854 -s "CertificateVerify signature with rsa_pss_rsae_sha512" \
12855 -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512"
12862 run_test "TLS 1.3: Check signature algorithm order, G->m" \
12864 crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key
12867 "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \
12868 … --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \
12869 …--priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" …
12871 -c "Negotiated version: 3.4" \
12872 -c "HTTP/1.0 200 [Oo][Kk]" \
12873 -s "CertificateVerify signature with rsa_pss_rsae_sha512" \
12874 -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512"
12881 run_test "TLS 1.3: Check server no suitable signature algorithm, G->m" \
12883 crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key
12886 "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \
12887 … --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \
12888 …--priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA51…
12890 -S "ssl_tls13_pick_key_cert:check signature algorithm"
12897 run_test "TLS 1.3: Check server no suitable signature algorithm, O->m" \
12899 crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key
12902 "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \
12903 -cert data_files/server2-sha256.crt -key data_files/server2.key \
12904 … -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \
12906 -S "ssl_tls13_pick_key_cert:check signature algorithm"
12913 run_test "TLS 1.3: Check server no suitable signature algorithm, m->m" \
12915 crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key
12918 …"$P_CLI allow_sha1=0 debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/serv…
12921 -S "ssl_tls13_pick_key_cert:check signature algorithm"
12928 run_test "TLS 1.3: Check server no suitable certificate, G->m" \
12930 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key
12932 "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \
12933 … --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \
12935 -s "ssl_tls13_pick_key_cert:no suitable certificate found"
12942 run_test "TLS 1.3: Check server no suitable certificate, O->m" \
12944 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key
12946 "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \
12947 -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \
12949 -s "ssl_tls13_pick_key_cert:no suitable certificate found"
12956 run_test "TLS 1.3: Check server no suitable certificate, m->m" \
12958 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key
12963 -s "ssl_tls13_pick_key_cert:no suitable certificate found"
12970 run_test "TLS 1.3: Check client no signature algorithm, m->O" \
12971 "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key
12972 -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache
12973 …-Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp521r1_sha51…
12977 -c "no suitable signature algorithm"
12984 run_test "TLS 1.3: Check client no signature algorithm, m->G" \
12985 …"$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2…
12986 -d 4
12987 …--priority=NORMAL:-VERS-ALL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSA…
12991 -c "no suitable signature algorithm"
12998 run_test "TLS 1.3: Check client no signature algorithm, m->m" \
13000 crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key
13006 -c "no suitable signature algorithm"
13014 run_test "TLS 1.3: NewSessionTicket: Basic check, m->O" \
13015 "$O_NEXT_SRV -msg -tls1_3 -no_resume_ephemeral -no_cache --num_tickets 4" \
13018 -c "Protocol is TLSv1.3" \
13019 -c "got new session ticket." \
13020 -c "Saving session for reuse... ok" \
13021 -c "Reconnecting with saved session" \
13022 -c "HTTP/1.0 200 ok"
13030 run_test "TLS 1.3: NewSessionTicket: Basic check, m->G" \
13031 "$G_NEXT_SRV -d 10 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 --disable-client-cert" \
13034 -c "Protocol is TLSv1.3" \
13035 -c "got new session ticket." \
13036 -c "Saving session for reuse... ok" \
13037 -c "Reconnecting with saved session" \
13038 -c "HTTP/1.0 200 OK" \
13039 -s "This is a resumed session"
13051 run_test "TLS 1.3: NewSessionTicket: Basic check, O->m" \
13053 "$O_NEXT_CLI -msg -debug -tls1_3 -reconnect" \
13055 -s "=> write NewSessionTicket msg" \
13056 -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \
13057 -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH"
13066 run_test "TLS 1.3: NewSessionTicket: Basic check, G->m" \
13068 "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -r" \
13070 -c "Connecting again- trying to resume previous session" \
13071 -c "NEW SESSION TICKET (4) was received" \
13072 -s "=> write NewSessionTicket msg" \
13073 -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \
13074 -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \
13075 -s "key exchange mode: ephemeral" \
13076 -s "key exchange mode: psk_ephemeral" \
13077 -s "found pre_shared_key extension"
13087 # TLS1-3-AES-256-GCM-SHA384. In that case, the PSK is 384 bits long and not
13089 requires_ciphersuite_enabled TLS1-3-AES-256-GCM-SHA384
13090 run_test "TLS 1.3: NewSessionTicket: Basic check with AES-256-GCM only, G->m" \
13092 …"$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:-CIPHER-ALL:+AES-256-GCM -V -…
13094 -c "Connecting again- trying to resume previous session" \
13095 -c "NEW SESSION TICKET (4) was received" \
13096 -s "Ciphersuite is TLS1-3-AES-256-GCM-SHA384" \
13097 -s "=> write NewSessionTicket msg" \
13098 -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \
13099 -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \
13100 -s "key exchange mode: ephemeral" \
13101 -s "key exchange mode: psk_ephemeral" \
13102 -s "found pre_shared_key extension"
13111 run_test "TLS 1.3: NewSessionTicket: Basic check, m->m" \
13115 -c "Protocol is TLSv1.3" \
13116 -c "got new session ticket ( 3 )" \
13117 -c "Saving session for reuse... ok" \
13118 -c "Reconnecting with saved session" \
13119 -c "HTTP/1.0 200 OK" \
13120 -s "=> write NewSessionTicket msg" \
13121 -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \
13122 -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \
13123 -s "key exchange mode: ephemeral" \
13124 -s "key exchange mode: psk_ephemeral" \
13125 -s "found pre_shared_key extension"
13131 run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->O" \
13132 "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key
13133 -msg -tls1_2
13134 -Verify 10 " \
13135 … "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key
13139 -c "Protocol is TLSv1.2" \
13140 -c "HTTP/1.0 200 [Oo][Kk]"
13147 run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->G" \
13148 …"$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2…
13149 -d 4
13150 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \
13151 … "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key
13155 -c "Protocol is TLSv1.2" \
13156 -c "HTTP/1.0 200 [Oo][Kk]"
13165 run_test "TLS 1.3: NewSessionTicket: servername check, m->m" \
13167 …server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_file…
13170 -c "Protocol is TLSv1.3" \
13171 -c "got new session ticket." \
13172 -c "Saving session for reuse... ok" \
13173 -c "Reconnecting with saved session" \
13174 -c "HTTP/1.0 200 OK" \
13175 -s "=> write NewSessionTicket msg" \
13176 -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \
13177 -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \
13178 -s "key exchange mode: ephemeral" \
13179 -s "key exchange mode: psk_ephemeral" \
13180 -s "found pre_shared_key extension"
13189 run_test "TLS 1.3: NewSessionTicket: servername negative check, m->m" \
13191 …server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_file…
13194 -c "Protocol is TLSv1.3" \
13195 -c "got new session ticket." \
13196 -c "Saving session for reuse... ok" \
13197 -c "Reconnecting with saved session" \
13198 -c "Hostname mismatch the session ticket, disable session resumption." \
13199 -s "=> write NewSessionTicket msg" \
13200 -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \
13201 -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH"
13212 run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe3072,rsa_pss_rsae_sha256" \
13213 …V crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key debug_level=4 force_ciphe…
13214 …--debug=4 --single-key-share --x509cafile data_files/test-ca_cat12.crt --priority=NONE:+AES-128-GC…
13216 -s "Protocol is TLSv1.3" \
13217 -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \
13218 -s "received signature algorithm: 0x804" \
13219 -s "got named group: ffdhe3072(0101)" \
13220 -s "Certificate verification was skipped" \
13221 -C "received HelloRetryRequest message"
13233 run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe3072,rsa_pss_rsae_sha256" \
13234 …--http --disable-client-cert --debug=4 --x509certfile data_files/server2-sha256.crt --x509keyfile …
13235 …"$P_CLI ca_file=data_files/test-ca_cat12.crt debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SH…
13237 -c "HTTP/1.0 200 OK" \
13238 -c "Protocol is TLSv1.3" \
13239 -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \
13240 -c "Certificate Verify: Signature algorithm ( 0804 )" \
13241 -c "NamedGroup: ffdhe3072 ( 101 )" \
13242 -c "Verifying peer X.509 certificate... ok" \
13243 -C "received HelloRetryRequest message"
13254 run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe4096,rsa_pss_rsae_sha256" \
13255 …V crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key debug_level=4 force_ciphe…
13256 …--debug=4 --single-key-share --x509cafile data_files/test-ca_cat12.crt --priority=NONE:+AES-128-GC…
13258 -s "Protocol is TLSv1.3" \
13259 -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \
13260 -s "received signature algorithm: 0x804" \
13261 -s "got named group: ffdhe4096(0102)" \
13262 -s "Certificate verification was skipped" \
13263 -C "received HelloRetryRequest message"
13275 run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe4096,rsa_pss_rsae_sha256" \
13276 …--http --disable-client-cert --debug=4 --x509certfile data_files/server2-sha256.crt --x509keyfile …
13277 …"$P_CLI ca_file=data_files/test-ca_cat12.crt debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SH…
13279 -c "HTTP/1.0 200 OK" \
13280 -c "Protocol is TLSv1.3" \
13281 -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \
13282 -c "Certificate Verify: Signature algorithm ( 0804 )" \
13283 -c "NamedGroup: ffdhe4096 ( 102 )" \
13284 -c "Verifying peer X.509 certificate... ok" \
13285 -C "received HelloRetryRequest message"
13296 run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe6144,rsa_pss_rsae_sha256" \
13297 …V crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key debug_level=4 force_ciphe…
13298 …--debug=4 --single-key-share --x509cafile data_files/test-ca_cat12.crt --priority=NONE:+AES-128-GC…
13300 -s "Protocol is TLSv1.3" \
13301 -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \
13302 -s "received signature algorithm: 0x804" \
13303 -s "got named group: ffdhe6144(0103)" \
13304 -s "Certificate verification was skipped" \
13305 -C "received HelloRetryRequest message"
13316 run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe6144,rsa_pss_rsae_sha256" \
13317 …--http --disable-client-cert --debug=4 --x509certfile data_files/server2-sha256.crt --x509keyfile …
13318 …"$P_CLI ca_file=data_files/test-ca_cat12.crt debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SH…
13320 -c "HTTP/1.0 200 OK" \
13321 -c "Protocol is TLSv1.3" \
13322 -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \
13323 -c "Certificate Verify: Signature algorithm ( 0804 )" \
13324 -c "NamedGroup: ffdhe6144 ( 103 )" \
13325 -c "Verifying peer X.509 certificate... ok" \
13326 -C "received HelloRetryRequest message"
13338 run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe8192,rsa_pss_rsae_sha256" \
13339 …V crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key debug_level=4 force_ciphe…
13340 …--debug=4 --single-key-share --x509cafile data_files/test-ca_cat12.crt --priority=NONE:+AES-128-GC…
13342 -s "Protocol is TLSv1.3" \
13343 -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \
13344 -s "received signature algorithm: 0x804" \
13345 -s "got named group: ffdhe8192(0104)" \
13346 -s "Certificate verification was skipped" \
13347 -C "received HelloRetryRequest message"
13359 run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe8192,rsa_pss_rsae_sha256" \
13360 …--http --disable-client-cert --debug=4 --x509certfile data_files/server2-sha256.crt --x509keyfile …
13361 …"$P_CLI ca_file=data_files/test-ca_cat12.crt debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SH…
13363 -c "HTTP/1.0 200 OK" \
13364 -c "Protocol is TLSv1.3" \
13365 -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \
13366 -c "Certificate Verify: Signature algorithm ( 0804 )" \
13367 -c "NamedGroup: ffdhe8192 ( 104 )" \
13368 -c "Verifying peer X.509 certificate... ok" \
13369 -C "received HelloRetryRequest message"
13380 -C "received HelloRetryRequest message" \
13381 -c "Selected key exchange mode: psk$" \
13382 -c "HTTP/1.0 200 OK"
13394 echo "------------------------------------------------------------------------"
13401 PASSES=$(( $TESTS - $FAILS ))
13402 echo " ($PASSES / $TESTS tests ($SKIPS skipped))"
13404 if [ $FAILS -gt 255 ]; then