Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 5 | # Copyright The Mbed TLS Contributors |
Dave Rodgman | 16799db | 2023-11-02 19:47:20 +0000 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Bence Szépkúti | c7da1fe | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 7 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 8 | # Purpose |
| 9 | # |
| 10 | # Executes tests to prove various TLS/SSL options and extensions. |
| 11 | # |
| 12 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 13 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 14 | # (session resumption from cache or ticket, renego, etc). |
| 15 | # |
| 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 |
| 18 | # performance. |
| 19 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 20 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 21 | set -u |
| 22 | |
Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 23 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 24 | # where it may output seemingly unlimited length error logs. |
| 25 | ulimit -f 20971520 |
| 26 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 27 | ORIGINAL_PWD=$PWD |
| 28 | if ! cd "$(dirname "$0")"; then |
| 29 | exit 125 |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 30 | fi |
| 31 | |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 32 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 33 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 34 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 35 | : ${P_PXY:=../programs/test/udp_proxy} |
Jerry Yu | d04fd35 | 2021-12-06 16:52:57 +0800 | [diff] [blame] | 36 | : ${P_QUERY:=../programs/test/query_compile_time_config} |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 37 | : ${OPENSSL:=openssl} |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 38 | : ${GNUTLS_CLI:=gnutls-cli} |
| 39 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 40 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 41 | |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 42 | # The OPENSSL variable used to be OPENSSL_CMD for historical reasons. |
| 43 | # To help the migration, error out if the old variable is set, |
| 44 | # but only if it has a different value than the new one. |
| 45 | if [ "${OPENSSL_CMD+set}" = set ]; then |
| 46 | # the variable is set, we can now check its value |
| 47 | if [ "$OPENSSL_CMD" != "$OPENSSL" ]; then |
| 48 | echo "Please use OPENSSL instead of OPENSSL_CMD." >&2 |
| 49 | exit 125 |
| 50 | fi |
| 51 | fi |
| 52 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 53 | guess_config_name() { |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 54 | if git diff --quiet ../include/mbedtls/mbedtls_config.h 2>/dev/null; then |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 55 | echo "default" |
| 56 | else |
| 57 | echo "unknown" |
| 58 | fi |
| 59 | } |
| 60 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 61 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 62 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
Jerry Yu | 53a332d | 2023-10-23 13:52:49 +0800 | [diff] [blame] | 63 | : ${EARLY_DATA_INPUT:=data_files/tls13_early_data.txt} |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 64 | |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 65 | O_SRV="$OPENSSL s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 66 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL s_client" |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 67 | G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 68 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 69 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 70 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 71 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 72 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 73 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
XiaokangQian | 30f5560 | 2021-11-24 01:54:50 +0000 | [diff] [blame] | 74 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 75 | O_NEXT_SRV_EARLY_DATA="$OPENSSL_NEXT s_server -early_data -cert data_files/server5.crt -key data_files/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 76 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 77 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client -CAfile data_files/test-ca_cat12.crt" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 78 | O_NEXT_CLI_NO_CERT="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 79 | else |
| 80 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 81 | O_NEXT_SRV_NO_CERT=false |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 82 | O_NEXT_SRV_EARLY_DATA=false |
XiaokangQian | b1847a2 | 2022-06-08 07:49:31 +0000 | [diff] [blame] | 83 | O_NEXT_CLI_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 84 | O_NEXT_CLI=false |
| 85 | fi |
| 86 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 87 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 88 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 89 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 90 | else |
| 91 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 92 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 93 | fi |
| 94 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 95 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 96 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 97 | G_NEXT_CLI_NO_CERT="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 98 | else |
| 99 | G_NEXT_CLI=false |
XiaokangQian | fb1a3fe | 2022-06-09 06:37:33 +0000 | [diff] [blame] | 100 | G_NEXT_CLI_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 101 | fi |
| 102 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 103 | TESTS=0 |
| 104 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 105 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 106 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 107 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 108 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 109 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 110 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 111 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 112 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 113 | SHOW_TEST_NUMBER=0 |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 114 | LIST_TESTS=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 115 | RUN_TEST_NUMBER='' |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 116 | RUN_TEST_SUITE='' |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 117 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 118 | PRESERVE_LOGS=0 |
| 119 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 120 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 121 | # port which is this plus 10000. Each port number may be independently |
| 122 | # overridden by a command line option. |
| 123 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 124 | PXY_PORT=$((SRV_PORT + 10000)) |
| 125 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 126 | print_usage() { |
| 127 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 128 | printf " -h|--help\tPrint this help.\n" |
| 129 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 130 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 131 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 132 | printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 133 | printf " -s|--show-numbers\tShow test numbers in front of test names\n" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 134 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Tomás González | 12787c9 | 2023-09-04 10:26:00 +0100 | [diff] [blame] | 135 | printf " --list-test-cases\tList all potential test cases (No Execution)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 136 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 137 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 138 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 139 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 140 | printf " --seed \tInteger seed value to use for this test run\n" |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 141 | printf " --test-suite\tOnly matching test suites are executed\n" |
| 142 | printf " \t(comma-separated, e.g. 'ssl-opt,tls13-compat')\n\n" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 143 | } |
| 144 | |
| 145 | get_options() { |
| 146 | while [ $# -gt 0 ]; do |
| 147 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 148 | -f|--filter) |
| 149 | shift; FILTER=$1 |
| 150 | ;; |
| 151 | -e|--exclude) |
| 152 | shift; EXCLUDE=$1 |
| 153 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 154 | -m|--memcheck) |
| 155 | MEMCHECK=1 |
| 156 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 157 | -n|--number) |
| 158 | shift; RUN_TEST_NUMBER=$1 |
| 159 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 160 | -s|--show-numbers) |
| 161 | SHOW_TEST_NUMBER=1 |
| 162 | ;; |
Tomás González | 4a86da2 | 2023-09-01 17:41:16 +0100 | [diff] [blame] | 163 | -l|--list-test-cases) |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 164 | LIST_TESTS=1 |
| 165 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 166 | -p|--preserve-logs) |
| 167 | PRESERVE_LOGS=1 |
| 168 | ;; |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 169 | --outcome-file) |
| 170 | shift; MBEDTLS_TEST_OUTCOME_FILE=$1 |
| 171 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 172 | --port) |
| 173 | shift; SRV_PORT=$1 |
| 174 | ;; |
| 175 | --proxy-port) |
| 176 | shift; PXY_PORT=$1 |
| 177 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 178 | --seed) |
| 179 | shift; SEED="$1" |
| 180 | ;; |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 181 | --test-suite) |
| 182 | shift; RUN_TEST_SUITE="$1" |
| 183 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 184 | -h|--help) |
| 185 | print_usage |
| 186 | exit 0 |
| 187 | ;; |
| 188 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 189 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 190 | print_usage |
| 191 | exit 1 |
| 192 | ;; |
| 193 | esac |
| 194 | shift |
| 195 | done |
| 196 | } |
| 197 | |
Tomás González | 0e8a08a | 2023-08-23 15:29:57 +0100 | [diff] [blame] | 198 | get_options "$@" |
| 199 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 200 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 201 | # testing. Skip non-boolean options (with something other than spaces |
| 202 | # and a comment after "#define SYMBOL"). The variable contains a |
| 203 | # space-separated list of symbols. |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 204 | if [ "$LIST_TESTS" -eq 0 ];then |
| 205 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
| 206 | else |
Tomás González | be2c66e | 2023-09-01 10:34:49 +0100 | [diff] [blame] | 207 | P_QUERY=":" |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 208 | CONFIGS_ENABLED="" |
| 209 | fi |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 210 | # Skip next test; use this macro to skip tests which are legitimate |
| 211 | # in theory and expected to be re-introduced at some point, but |
| 212 | # aren't expected to succeed at the moment due to problems outside |
| 213 | # our control (such as bugs in other TLS implementations). |
| 214 | skip_next_test() { |
| 215 | SKIP_NEXT="YES" |
| 216 | } |
| 217 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 218 | # Check if the required configuration ($1) is enabled |
| 219 | is_config_enabled() |
| 220 | { |
| 221 | case $CONFIGS_ENABLED in |
| 222 | *" $1"[\ =]*) return 0;; |
| 223 | *) return 1;; |
| 224 | esac |
| 225 | } |
| 226 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 227 | # skip next test if the flag is not enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 228 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 229 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 230 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 231 | *) SKIP_NEXT="YES";; |
| 232 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 233 | } |
| 234 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 235 | # skip next test if the flag is enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 236 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 237 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 238 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 239 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 240 | } |
| 241 | |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 242 | requires_all_configs_enabled() { |
| 243 | if ! $P_QUERY -all $* |
| 244 | then |
| 245 | SKIP_NEXT="YES" |
| 246 | fi |
| 247 | } |
| 248 | |
| 249 | requires_all_configs_disabled() { |
| 250 | if $P_QUERY -any $* |
| 251 | then |
| 252 | SKIP_NEXT="YES" |
| 253 | fi |
| 254 | } |
| 255 | |
| 256 | requires_any_configs_enabled() { |
| 257 | if ! $P_QUERY -any $* |
| 258 | then |
| 259 | SKIP_NEXT="YES" |
| 260 | fi |
| 261 | } |
| 262 | |
| 263 | requires_any_configs_disabled() { |
| 264 | if $P_QUERY -all $* |
| 265 | then |
| 266 | SKIP_NEXT="YES" |
| 267 | fi |
| 268 | } |
| 269 | |
Ronald Cron | 454eb91 | 2022-10-21 08:56:04 +0200 | [diff] [blame] | 270 | TLS1_2_KEY_EXCHANGES_WITH_CERT="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 271 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 272 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 273 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 274 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED \ |
| 275 | MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED \ |
| 276 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 277 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 278 | TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT="MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 279 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 280 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 281 | TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
| 282 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 283 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 284 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 285 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED" |
| 286 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 287 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled() { |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 288 | if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_2 |
| 289 | then |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 290 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 291 | elif ! $P_QUERY -all MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 292 | then |
| 293 | SKIP_NEXT="YES" |
| 294 | fi |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 295 | } |
| 296 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 297 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 298 | # This function uses the query_config command line option to query the |
| 299 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 300 | # program. The command will always return a success value if the |
| 301 | # configuration is defined and the value will be printed to stdout. |
| 302 | # |
| 303 | # Note that if the configuration is not defined or is defined to nothing, |
| 304 | # the output of this function will be an empty string. |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 305 | if [ "$LIST_TESTS" -eq 0 ];then |
| 306 | ${P_SRV} "query_config=${1}" |
| 307 | else |
| 308 | echo "1" |
| 309 | fi |
| 310 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 311 | } |
| 312 | |
| 313 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 314 | VAL="$( get_config_value_or_default "$1" )" |
| 315 | if [ -z "$VAL" ]; then |
| 316 | # Should never happen |
| 317 | echo "Mbed TLS configuration $1 is not defined" |
| 318 | exit 1 |
| 319 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 320 | SKIP_NEXT="YES" |
| 321 | fi |
| 322 | } |
| 323 | |
| 324 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 325 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 326 | if [ -z "$VAL" ]; then |
| 327 | # Should never happen |
| 328 | echo "Mbed TLS configuration $1 is not defined" |
| 329 | exit 1 |
| 330 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 331 | SKIP_NEXT="YES" |
| 332 | fi |
| 333 | } |
| 334 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 335 | requires_config_value_equals() { |
| 336 | VAL=$( get_config_value_or_default "$1" ) |
| 337 | if [ -z "$VAL" ]; then |
| 338 | # Should never happen |
| 339 | echo "Mbed TLS configuration $1 is not defined" |
| 340 | exit 1 |
| 341 | elif [ "$VAL" -ne "$2" ]; then |
| 342 | SKIP_NEXT="YES" |
| 343 | fi |
| 344 | } |
| 345 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 346 | # Require Mbed TLS to support the given protocol version. |
| 347 | # |
| 348 | # Inputs: |
| 349 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 350 | requires_protocol_version() { |
| 351 | # Support for DTLS is detected separately in detect_dtls(). |
| 352 | case "$1" in |
| 353 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 354 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 355 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 356 | esac |
| 357 | } |
| 358 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 359 | # Space-separated list of ciphersuites supported by this build of |
| 360 | # Mbed TLS. |
| 361 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
XiaokangQian | 4b82ca1 | 2021-11-18 08:27:17 +0000 | [diff] [blame] | 362 | grep 'TLS-\|TLS1-3' | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 363 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 364 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 365 | case $P_CIPHERSUITES in |
| 366 | *" $1 "*) :;; |
| 367 | *) SKIP_NEXT="YES";; |
| 368 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 369 | } |
| 370 | |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 371 | # Automatically detect required features based on command line parameters. |
| 372 | # Parameters are: |
| 373 | # - $1 = command line (call to a TLS client or server program) |
| 374 | # - $2 = client/server |
| 375 | # - $3 = TLS version (TLS12 or TLS13) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 376 | # - $4 = Use an external tool without ECDH support |
| 377 | # - $5 = run test options |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 378 | detect_required_features() { |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 379 | CMD_LINE=$1 |
| 380 | ROLE=$2 |
| 381 | TLS_VERSION=$3 |
| 382 | EXT_WO_ECDH=$4 |
| 383 | TEST_OPTIONS=${5:-} |
| 384 | |
| 385 | case "$CMD_LINE" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 386 | *\ force_version=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 387 | tmp="${CMD_LINE##*\ force_version=}" |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 388 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 389 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 390 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 391 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 392 | case "$CMD_LINE" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 393 | *\ force_ciphersuite=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 394 | tmp="${CMD_LINE##*\ force_ciphersuite=}" |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 395 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 396 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 397 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 398 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 399 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 400 | *[-_\ =]tickets=[^0]*) |
| 401 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 402 | esac |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 403 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 404 | *[-_\ =]alpn=*) |
| 405 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 406 | esac |
| 407 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 408 | case "$CMD_LINE" in |
Valerio Setti | ccfad9a | 2023-03-08 10:25:05 +0100 | [diff] [blame] | 409 | *server5*|\ |
Valerio Setti | 80318d2 | 2023-03-13 12:26:42 +0100 | [diff] [blame] | 410 | *server7*|\ |
| 411 | *dir-maxpath*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 412 | if [ "$TLS_VERSION" = "TLS13" ]; then |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 413 | # In case of TLS13 the support for ECDSA is enough |
| 414 | requires_pk_alg "ECDSA" |
| 415 | else |
| 416 | # For TLS12 requirements are different between server and client |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 417 | if [ "$ROLE" = "server" ]; then |
Valerio Setti | 194e2bd | 2023-03-02 17:18:10 +0100 | [diff] [blame] | 418 | # If the server uses "server5*" certificates, then an ECDSA based |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 419 | # key exchange is required. However gnutls also does not |
| 420 | # support ECDH, so this limit the choice to ECDHE-ECDSA |
| 421 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 422 | requires_any_configs_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 423 | else |
| 424 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT |
| 425 | fi |
| 426 | elif [ "$ROLE" = "client" ]; then |
| 427 | # On the client side it is enough to have any certificate |
| 428 | # based authentication together with support for ECDSA. |
| 429 | # Of course the GnuTLS limitation mentioned above applies |
| 430 | # also here. |
| 431 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 432 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH |
| 433 | else |
| 434 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 435 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 436 | requires_pk_alg "ECDSA" |
| 437 | fi |
| 438 | fi |
| 439 | ;; |
| 440 | esac |
| 441 | |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 442 | case "$CMD_LINE" in |
| 443 | *server2*|\ |
| 444 | *server7*) |
| 445 | # server2 and server7 certificates use RSA encryption |
| 446 | requires_config_enabled "MBEDTLS_RSA_C" |
| 447 | esac |
| 448 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 449 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 450 | } |
| 451 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 452 | requires_certificate_authentication () { |
| 453 | if [ "$PSK_ONLY" = "YES" ]; then |
| 454 | SKIP_NEXT="YES" |
| 455 | fi |
| 456 | } |
| 457 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 458 | adapt_cmd_for_psk () { |
| 459 | case "$2" in |
| 460 | *openssl*) s='-psk abc123 -nocert';; |
| 461 | *gnutls-*) s='--pskkey=abc123';; |
| 462 | *) s='psk=abc123';; |
| 463 | esac |
| 464 | eval $1='"$2 $s"' |
| 465 | unset s |
| 466 | } |
| 467 | |
| 468 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 469 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 470 | # |
| 471 | # If not running in a PSK-only build, do nothing. |
| 472 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 473 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 474 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 475 | # a pre-shared key, do nothing. |
| 476 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 477 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 478 | # |
| 479 | # Inputs: |
| 480 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 481 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 482 | # * "$@": options passed to run_test. |
| 483 | # |
| 484 | # Outputs: |
| 485 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 486 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 487 | maybe_adapt_for_psk() { |
| 488 | if [ "$PSK_ONLY" != "YES" ]; then |
| 489 | return |
| 490 | fi |
| 491 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 492 | return |
| 493 | fi |
| 494 | case "$CLI_CMD $SRV_CMD" in |
| 495 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 496 | return;; |
| 497 | *force_ciphersuite*) |
| 498 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 499 | # PSK cipher suite could be substituted, but we're not ready for |
| 500 | # that yet. |
| 501 | SKIP_NEXT="YES" |
| 502 | return;; |
| 503 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 504 | # The test case involves certificates. PSK won't do. |
| 505 | SKIP_NEXT="YES" |
| 506 | return;; |
| 507 | esac |
| 508 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 509 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 510 | } |
| 511 | |
| 512 | case " $CONFIGS_ENABLED " in |
| 513 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 514 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 515 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 516 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 517 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 518 | *) PSK_ONLY="NO";; |
| 519 | esac |
| 520 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 521 | HAS_ALG_SHA_1="NO" |
| 522 | HAS_ALG_SHA_224="NO" |
| 523 | HAS_ALG_SHA_256="NO" |
| 524 | HAS_ALG_SHA_384="NO" |
| 525 | HAS_ALG_SHA_512="NO" |
| 526 | |
| 527 | check_for_hash_alg() |
| 528 | { |
| 529 | CURR_ALG="INVALID"; |
| 530 | USE_PSA="NO" |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 531 | if is_config_enabled "MBEDTLS_USE_PSA_CRYPTO"; then |
| 532 | USE_PSA="YES"; |
| 533 | fi |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 534 | if [ $USE_PSA = "YES" ]; then |
| 535 | CURR_ALG=PSA_WANT_ALG_${1} |
| 536 | else |
| 537 | CURR_ALG=MBEDTLS_${1}_C |
| 538 | # Remove the second underscore to match MBEDTLS_* naming convention |
| 539 | CURR_ALG=$(echo "$CURR_ALG" | sed 's/_//2') |
| 540 | fi |
| 541 | |
| 542 | case $CONFIGS_ENABLED in |
| 543 | *" $CURR_ALG"[\ =]*) |
| 544 | return 0 |
| 545 | ;; |
| 546 | *) :;; |
| 547 | esac |
| 548 | return 1 |
| 549 | } |
| 550 | |
| 551 | populate_enabled_hash_algs() |
| 552 | { |
| 553 | for hash_alg in SHA_1 SHA_224 SHA_256 SHA_384 SHA_512; do |
| 554 | if check_for_hash_alg "$hash_alg"; then |
| 555 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 556 | eval ${hash_alg_variable}=YES |
| 557 | fi |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 558 | done |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 559 | } |
| 560 | |
| 561 | # skip next test if the given hash alg is not supported |
| 562 | requires_hash_alg() { |
| 563 | HASH_DEFINE="Invalid" |
| 564 | HAS_HASH_ALG="NO" |
| 565 | case $1 in |
| 566 | SHA_1):;; |
| 567 | SHA_224):;; |
| 568 | SHA_256):;; |
| 569 | SHA_384):;; |
| 570 | SHA_512):;; |
| 571 | *) |
| 572 | echo "Unsupported hash alg - $1" |
| 573 | exit 1 |
| 574 | ;; |
| 575 | esac |
| 576 | |
| 577 | HASH_DEFINE=HAS_ALG_${1} |
| 578 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 579 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 580 | then |
| 581 | SKIP_NEXT="YES" |
| 582 | fi |
| 583 | } |
| 584 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 585 | # Skip next test if the given pk alg is not enabled |
| 586 | requires_pk_alg() { |
| 587 | case $1 in |
| 588 | ECDSA) |
| 589 | if is_config_enabled MBEDTLS_USE_PSA_CRYPTO; then |
| 590 | requires_config_enabled PSA_WANT_ALG_ECDSA |
| 591 | else |
| 592 | requires_config_enabled MBEDTLS_ECDSA_C |
| 593 | fi |
| 594 | ;; |
| 595 | *) |
| 596 | echo "Unknown/unimplemented case $1 in requires_pk_alg" |
| 597 | exit 1 |
| 598 | ;; |
| 599 | esac |
| 600 | } |
| 601 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 602 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 603 | requires_openssl_with_fallback_scsv() { |
| 604 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 605 | if $OPENSSL s_client -help 2>&1 | grep fallback_scsv >/dev/null |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 606 | then |
| 607 | OPENSSL_HAS_FBSCSV="YES" |
| 608 | else |
| 609 | OPENSSL_HAS_FBSCSV="NO" |
| 610 | fi |
| 611 | fi |
| 612 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 613 | SKIP_NEXT="YES" |
| 614 | fi |
| 615 | } |
| 616 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 617 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 618 | requires_max_content_len() { |
| 619 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 620 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 621 | } |
| 622 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 623 | # skip next test if GnuTLS isn't available |
| 624 | requires_gnutls() { |
| 625 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 626 | if ( which "$GNUTLS_CLI" && which "$GNUTLS_SERV" ) >/dev/null 2>&1; then |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 627 | GNUTLS_AVAILABLE="YES" |
| 628 | else |
| 629 | GNUTLS_AVAILABLE="NO" |
| 630 | fi |
| 631 | fi |
| 632 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 633 | SKIP_NEXT="YES" |
| 634 | fi |
| 635 | } |
| 636 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 637 | # skip next test if GnuTLS-next isn't available |
| 638 | requires_gnutls_next() { |
| 639 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 640 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 641 | GNUTLS_NEXT_AVAILABLE="YES" |
| 642 | else |
| 643 | GNUTLS_NEXT_AVAILABLE="NO" |
| 644 | fi |
| 645 | fi |
| 646 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 647 | SKIP_NEXT="YES" |
| 648 | fi |
| 649 | } |
| 650 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 651 | requires_openssl_next() { |
| 652 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 653 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 654 | OPENSSL_NEXT_AVAILABLE="YES" |
| 655 | else |
| 656 | OPENSSL_NEXT_AVAILABLE="NO" |
| 657 | fi |
| 658 | fi |
| 659 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 660 | SKIP_NEXT="YES" |
| 661 | fi |
| 662 | } |
| 663 | |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 664 | # skip next test if openssl version is lower than 3.0 |
| 665 | requires_openssl_3_x() { |
| 666 | requires_openssl_next |
| 667 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 668 | OPENSSL_3_X_AVAILABLE="NO" |
| 669 | fi |
| 670 | if [ -z "${OPENSSL_3_X_AVAILABLE:-}" ]; then |
Przemek Stekiel | a53dca1 | 2023-06-14 20:53:09 +0200 | [diff] [blame] | 671 | if $OPENSSL_NEXT version 2>&1 | grep "OpenSSL 3." >/dev/null |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 672 | then |
| 673 | OPENSSL_3_X_AVAILABLE="YES" |
| 674 | else |
| 675 | OPENSSL_3_X_AVAILABLE="NO" |
| 676 | fi |
| 677 | fi |
| 678 | if [ "$OPENSSL_3_X_AVAILABLE" = "NO" ]; then |
| 679 | SKIP_NEXT="YES" |
| 680 | fi |
| 681 | } |
| 682 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 683 | # skip next test if openssl does not support ffdh keys |
| 684 | requires_openssl_tls1_3_with_ffdh() { |
| 685 | requires_openssl_3_x |
| 686 | } |
| 687 | |
Przemek Stekiel | 7dda271 | 2023-06-27 14:43:33 +0200 | [diff] [blame] | 688 | # skip next test if openssl cannot handle ephemeral key exchange |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 689 | requires_openssl_tls1_3_with_compatible_ephemeral() { |
| 690 | requires_openssl_next |
| 691 | |
| 692 | if !(is_config_enabled "PSA_WANT_ALG_ECDH"); then |
| 693 | requires_openssl_tls1_3_with_ffdh |
| 694 | fi |
| 695 | } |
| 696 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 697 | # skip next test if tls1_3 is not available |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 698 | requires_openssl_tls1_3() { |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 699 | requires_openssl_next |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 700 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 701 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 702 | fi |
| 703 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 704 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 705 | then |
| 706 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 707 | else |
| 708 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 709 | fi |
| 710 | fi |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 711 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 712 | SKIP_NEXT="YES" |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 713 | fi |
| 714 | } |
| 715 | |
| 716 | # skip next test if tls1_3 is not available |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 717 | requires_gnutls_tls1_3() { |
| 718 | requires_gnutls_next |
| 719 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 720 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 721 | fi |
| 722 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 723 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 724 | then |
| 725 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 726 | else |
| 727 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 728 | fi |
| 729 | fi |
| 730 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 731 | SKIP_NEXT="YES" |
| 732 | fi |
| 733 | } |
| 734 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 735 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 736 | requires_gnutls_next_no_ticket() { |
| 737 | requires_gnutls_next |
| 738 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 739 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 740 | fi |
| 741 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 742 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 743 | then |
| 744 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 745 | else |
| 746 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 747 | fi |
| 748 | fi |
| 749 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 750 | SKIP_NEXT="YES" |
| 751 | fi |
| 752 | } |
| 753 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 754 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 755 | requires_gnutls_next_disable_tls13_compat() { |
| 756 | requires_gnutls_next |
| 757 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 758 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 759 | fi |
| 760 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 761 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 762 | then |
| 763 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 764 | else |
| 765 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 766 | fi |
| 767 | fi |
| 768 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 769 | SKIP_NEXT="YES" |
| 770 | fi |
| 771 | } |
| 772 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 773 | # skip next test if GnuTLS does not support the record size limit extension |
| 774 | requires_gnutls_record_size_limit() { |
| 775 | requires_gnutls_next |
| 776 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 777 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="NO" |
| 778 | else |
| 779 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="YES" |
| 780 | fi |
| 781 | if [ "$GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE" = "NO" ]; then |
| 782 | SKIP_NEXT="YES" |
| 783 | fi |
| 784 | } |
| 785 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 786 | # skip next test if IPv6 isn't available on this host |
| 787 | requires_ipv6() { |
| 788 | if [ -z "${HAS_IPV6:-}" ]; then |
| 789 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 790 | SRV_PID=$! |
| 791 | sleep 1 |
| 792 | kill $SRV_PID >/dev/null 2>&1 |
| 793 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 794 | HAS_IPV6="NO" |
| 795 | else |
| 796 | HAS_IPV6="YES" |
| 797 | fi |
| 798 | rm -r $SRV_OUT |
| 799 | fi |
| 800 | |
| 801 | if [ "$HAS_IPV6" = "NO" ]; then |
| 802 | SKIP_NEXT="YES" |
| 803 | fi |
| 804 | } |
| 805 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 806 | # skip next test if it's i686 or uname is not available |
| 807 | requires_not_i686() { |
| 808 | if [ -z "${IS_I686:-}" ]; then |
| 809 | IS_I686="YES" |
| 810 | if which "uname" >/dev/null 2>&1; then |
| 811 | if [ -z "$(uname -a | grep i686)" ]; then |
| 812 | IS_I686="NO" |
| 813 | fi |
| 814 | fi |
| 815 | fi |
| 816 | if [ "$IS_I686" = "YES" ]; then |
| 817 | SKIP_NEXT="YES" |
| 818 | fi |
| 819 | } |
| 820 | |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 821 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 822 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 823 | MAX_OUT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_OUT_CONTENT_LEN" ) |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 824 | if [ "$LIST_TESTS" -eq 0 ];then |
| 825 | # Calculate the input & output maximum content lengths set in the config |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 826 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 827 | # Calculate the maximum content length that fits both |
| 828 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 829 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 830 | fi |
| 831 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 832 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 833 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 834 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 835 | # skip the next test if the SSL output buffer is less than 16KB |
| 836 | requires_full_size_output_buffer() { |
| 837 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 838 | SKIP_NEXT="YES" |
| 839 | fi |
| 840 | } |
| 841 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 842 | # skip the next test if valgrind is in use |
| 843 | not_with_valgrind() { |
| 844 | if [ "$MEMCHECK" -gt 0 ]; then |
| 845 | SKIP_NEXT="YES" |
| 846 | fi |
| 847 | } |
| 848 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 849 | # skip the next test if valgrind is NOT in use |
| 850 | only_with_valgrind() { |
| 851 | if [ "$MEMCHECK" -eq 0 ]; then |
| 852 | SKIP_NEXT="YES" |
| 853 | fi |
| 854 | } |
| 855 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 856 | # multiply the client timeout delay by the given factor for the next test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 857 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 858 | CLI_DELAY_FACTOR=$1 |
| 859 | } |
| 860 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 861 | # wait for the given seconds after the client finished in the next test |
| 862 | server_needs_more_time() { |
| 863 | SRV_DELAY_SECONDS=$1 |
| 864 | } |
| 865 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 866 | # print_name <name> |
| 867 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 868 | TESTS=$(( $TESTS + 1 )) |
| 869 | LINE="" |
| 870 | |
| 871 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 872 | LINE="$TESTS " |
| 873 | fi |
| 874 | |
| 875 | LINE="$LINE$1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 876 | |
Tomás González | 378e364 | 2023-09-04 10:41:37 +0100 | [diff] [blame] | 877 | printf "%s " "$LINE" |
| 878 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
| 879 | for i in `seq 1 $LEN`; do printf '.'; done |
| 880 | printf ' ' |
| 881 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 882 | } |
| 883 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 884 | # record_outcome <outcome> [<failure-reason>] |
| 885 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 886 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 887 | record_outcome() { |
| 888 | echo "$1" |
| 889 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 890 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 891 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Jerry Yu | 9e47b26 | 2023-11-06 10:52:01 +0800 | [diff] [blame^] | 892 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 893 | "$1" "${2-}" \ |
| 894 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 895 | fi |
| 896 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 897 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 898 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 899 | # True if the presence of the given pattern in a log definitely indicates |
| 900 | # that the test has failed. False if the presence is inconclusive. |
| 901 | # |
| 902 | # Inputs: |
| 903 | # * $1: pattern found in the logs |
| 904 | # * $TIMES_LEFT: >0 if retrying is an option |
| 905 | # |
| 906 | # Outputs: |
| 907 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 908 | # unchanged otherwise. |
| 909 | # * Return value: 1 if the pattern is inconclusive, |
| 910 | # 0 if the failure is definitive. |
| 911 | log_pattern_presence_is_conclusive() { |
| 912 | # If we've run out of attempts, then don't retry no matter what. |
| 913 | if [ $TIMES_LEFT -eq 0 ]; then |
| 914 | return 0 |
| 915 | fi |
| 916 | case $1 in |
| 917 | "resend") |
| 918 | # An undesired resend may have been caused by the OS dropping or |
| 919 | # delaying a packet at an inopportune time. |
| 920 | outcome="RETRY(resend)" |
| 921 | return 1;; |
| 922 | esac |
| 923 | } |
| 924 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 925 | # fail <message> |
| 926 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 927 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 928 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 929 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 930 | mv $SRV_OUT o-srv-${TESTS}.log |
| 931 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 932 | if [ -n "$PXY_CMD" ]; then |
| 933 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 934 | fi |
| 935 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 936 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 937 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 938 | echo " ! server output:" |
| 939 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 940 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 941 | echo " ! client output:" |
| 942 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 943 | if [ -n "$PXY_CMD" ]; then |
| 944 | echo " ! ========================================================" |
| 945 | echo " ! proxy output:" |
| 946 | cat o-pxy-${TESTS}.log |
| 947 | fi |
| 948 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 949 | fi |
| 950 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 951 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 952 | } |
| 953 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 954 | # is_polar <cmd_line> |
| 955 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 956 | case "$1" in |
| 957 | *ssl_client2*) true;; |
| 958 | *ssl_server2*) true;; |
| 959 | *) false;; |
| 960 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 961 | } |
| 962 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 963 | # openssl s_server doesn't have -www with DTLS |
| 964 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 965 | case "$SRV_CMD" in |
| 966 | *s_server*-dtls*) |
| 967 | NEEDS_INPUT=1 |
| 968 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 969 | *) NEEDS_INPUT=0;; |
| 970 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 971 | } |
| 972 | |
| 973 | # provide input to commands that need it |
| 974 | provide_input() { |
| 975 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 976 | return |
| 977 | fi |
| 978 | |
| 979 | while true; do |
| 980 | echo "HTTP/1.0 200 OK" |
| 981 | sleep 1 |
| 982 | done |
| 983 | } |
| 984 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 985 | # has_mem_err <log_file_name> |
| 986 | has_mem_err() { |
| 987 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 988 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 989 | then |
| 990 | return 1 # false: does not have errors |
| 991 | else |
| 992 | return 0 # true: has errors |
| 993 | fi |
| 994 | } |
| 995 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 996 | # Wait for process $2 named $3 to be listening on port $1. Print error to $4. |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 997 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 998 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 999 | newline=' |
| 1000 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1001 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1002 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1003 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1004 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1005 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1006 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1007 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 1008 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1009 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1010 | # When we use a proxy, it will be listening on the same port we |
| 1011 | # are checking for as well as the server and lsof will list both. |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1012 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1013 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1014 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1015 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1016 | echo "$3 START TIMEOUT" |
| 1017 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1018 | break |
| 1019 | fi |
| 1020 | # Linux and *BSD support decimal arguments to sleep. On other |
| 1021 | # OSes this may be a tight loop. |
| 1022 | sleep 0.1 2>/dev/null || true |
| 1023 | done |
| 1024 | } |
| 1025 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1026 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 1027 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1028 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1029 | } |
| 1030 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1031 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1032 | # Wait for server process $2 to be listening on port $1. |
| 1033 | wait_server_start() { |
| 1034 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 1035 | } |
| 1036 | |
| 1037 | # Wait for proxy process $2 to be listening on port $1. |
| 1038 | wait_proxy_start() { |
| 1039 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 1040 | } |
| 1041 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1042 | # Given the client or server debug output, parse the unix timestamp that is |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 1043 | # included in the first 4 bytes of the random bytes and check that it's within |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1044 | # acceptable bounds |
| 1045 | check_server_hello_time() { |
| 1046 | # Extract the time from the debug (lvl 3) output of the client |
Andres Amaya Garcia | 67d8da5 | 2017-09-15 15:49:24 +0100 | [diff] [blame] | 1047 | SERVER_HELLO_TIME="$(sed -n 's/.*server hello, current time: //p' < "$1")" |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1048 | # Get the Unix timestamp for now |
| 1049 | CUR_TIME=$(date +'%s') |
| 1050 | THRESHOLD_IN_SECS=300 |
| 1051 | |
| 1052 | # Check if the ServerHello time was printed |
| 1053 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 1054 | return 1 |
| 1055 | fi |
| 1056 | |
| 1057 | # Check the time in ServerHello is within acceptable bounds |
| 1058 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 1059 | # The time in ServerHello is at least 5 minutes before now |
| 1060 | return 1 |
| 1061 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 1062 | # The time in ServerHello is at least 5 minutes later than now |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1063 | return 1 |
| 1064 | else |
| 1065 | return 0 |
| 1066 | fi |
| 1067 | } |
| 1068 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1069 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 1070 | handshake_memory_get() { |
| 1071 | OUTPUT_VARIABLE="$1" |
| 1072 | OUTPUT_FILE="$2" |
| 1073 | |
| 1074 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 1075 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 1076 | |
| 1077 | # Check if memory usage was read |
| 1078 | if [ -z "$MEM_USAGE" ]; then |
| 1079 | echo "Error: Can not read the value of handshake memory usage" |
| 1080 | return 1 |
| 1081 | else |
| 1082 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 1083 | return 0 |
| 1084 | fi |
| 1085 | } |
| 1086 | |
| 1087 | # Get handshake memory usage from server or client output and check if this value |
| 1088 | # is not higher than the maximum given by the first argument |
| 1089 | handshake_memory_check() { |
| 1090 | MAX_MEMORY="$1" |
| 1091 | OUTPUT_FILE="$2" |
| 1092 | |
| 1093 | # Get memory usage |
| 1094 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 1095 | return 1 |
| 1096 | fi |
| 1097 | |
| 1098 | # Check if memory usage is below max value |
| 1099 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 1100 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 1101 | "but should be below $MAX_MEMORY bytes" |
| 1102 | return 1 |
| 1103 | else |
| 1104 | return 0 |
| 1105 | fi |
| 1106 | } |
| 1107 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1108 | # wait for client to terminate and set CLI_EXIT |
| 1109 | # must be called right after starting the client |
| 1110 | wait_client_done() { |
| 1111 | CLI_PID=$! |
| 1112 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1113 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 1114 | CLI_DELAY_FACTOR=1 |
| 1115 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1116 | ( sleep $CLI_DELAY; echo "===CLIENT_TIMEOUT===" >> $CLI_OUT; kill $CLI_PID ) & |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1117 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1118 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1119 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 1120 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 1121 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1122 | CLI_EXIT=$? |
| 1123 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1124 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 1125 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1126 | |
| 1127 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1128 | |
| 1129 | sleep $SRV_DELAY_SECONDS |
| 1130 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1131 | } |
| 1132 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1133 | # check if the given command uses dtls and sets global variable DTLS |
| 1134 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1135 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 1136 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1137 | *) DTLS=0;; |
| 1138 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1139 | } |
| 1140 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1141 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 1142 | is_gnutls() { |
| 1143 | case "$1" in |
| 1144 | *gnutls-cli*) |
| 1145 | CMD_IS_GNUTLS=1 |
| 1146 | ;; |
| 1147 | *gnutls-serv*) |
| 1148 | CMD_IS_GNUTLS=1 |
| 1149 | ;; |
| 1150 | *) |
| 1151 | CMD_IS_GNUTLS=0 |
| 1152 | ;; |
| 1153 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1154 | } |
| 1155 | |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 1156 | # Some external tools (gnutls or openssl) might not have support for static ECDH |
| 1157 | # and this limit the tests that can be run with them. This function checks server |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1158 | # and client command lines, given as input, to verify if the current test |
| 1159 | # is using one of these tools. |
| 1160 | use_ext_tool_without_ecdh_support() { |
| 1161 | case "$1" in |
| 1162 | *$GNUTLS_SERV*|\ |
| 1163 | *${GNUTLS_NEXT_SERV:-"gnutls-serv-dummy"}*|\ |
| 1164 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1165 | echo "yes" |
| 1166 | return;; |
| 1167 | esac |
| 1168 | case "$2" in |
| 1169 | *$GNUTLS_CLI*|\ |
| 1170 | *${GNUTLS_NEXT_CLI:-"gnutls-cli-dummy"}*|\ |
| 1171 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1172 | echo "yes" |
| 1173 | return;; |
| 1174 | esac |
| 1175 | echo "no" |
| 1176 | } |
| 1177 | |
Jerry Yu | f467d46 | 2022-11-07 13:12:44 +0800 | [diff] [blame] | 1178 | # Generate random psk_list argument for ssl_server2 |
| 1179 | get_srv_psk_list () |
| 1180 | { |
| 1181 | case $(( TESTS % 3 )) in |
| 1182 | 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; |
| 1183 | 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; |
| 1184 | 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; |
| 1185 | esac |
| 1186 | } |
| 1187 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1188 | # Determine what calc_verify trace is to be expected, if any. |
| 1189 | # |
| 1190 | # calc_verify is only called for two things: to calculate the |
| 1191 | # extended master secret, and to process client authentication. |
| 1192 | # |
| 1193 | # Warning: the current implementation assumes that extended_ms is not |
| 1194 | # disabled on the client or on the server. |
| 1195 | # |
| 1196 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1197 | # * $1: the value of the server auth_mode parameter. |
| 1198 | # 'required' if client authentication is expected, |
| 1199 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1200 | # * $CONFIGS_ENABLED |
| 1201 | # |
| 1202 | # Outputs: |
| 1203 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1204 | set_maybe_calc_verify() { |
| 1205 | maybe_calc_verify= |
| 1206 | case $CONFIGS_ENABLED in |
| 1207 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1208 | *) |
| 1209 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1210 | ''|none) return;; |
| 1211 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1212 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1213 | esac |
| 1214 | esac |
| 1215 | case $CONFIGS_ENABLED in |
| 1216 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 1217 | *) maybe_calc_verify="<= calc verify";; |
| 1218 | esac |
| 1219 | } |
| 1220 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1221 | # Compare file content |
| 1222 | # Usage: find_in_both pattern file1 file2 |
| 1223 | # extract from file1 the first line matching the pattern |
| 1224 | # check in file2 that the same line can be found |
| 1225 | find_in_both() { |
| 1226 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1227 | if [ -z "$srv_pattern" ]; then |
| 1228 | return 1; |
| 1229 | fi |
| 1230 | |
| 1231 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1232 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1233 | else |
| 1234 | return 1; |
| 1235 | fi |
| 1236 | } |
| 1237 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1238 | SKIP_HANDSHAKE_CHECK="NO" |
| 1239 | skip_handshake_stage_check() { |
| 1240 | SKIP_HANDSHAKE_CHECK="YES" |
| 1241 | } |
| 1242 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1243 | # Analyze the commands that will be used in a test. |
| 1244 | # |
| 1245 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1246 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1247 | # |
| 1248 | # Inputs: |
| 1249 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1250 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1251 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1252 | # |
| 1253 | # Outputs: |
| 1254 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1255 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1256 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 1257 | # as it provides timing info that's useful to debug failures |
Manuel Pégourié-Gonnard | 70fce98 | 2020-06-25 09:54:46 +0200 | [diff] [blame] | 1258 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1259 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1260 | case " $SRV_CMD " in |
| 1261 | *' server_addr=::1 '*) |
| 1262 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1263 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1264 | fi |
| 1265 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1266 | # update CMD_IS_GNUTLS variable |
| 1267 | is_gnutls "$SRV_CMD" |
| 1268 | |
| 1269 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1270 | # set the default priority |
| 1271 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1272 | case "$SRV_CMD" in |
| 1273 | *--priority*) :;; |
| 1274 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1275 | esac |
| 1276 | fi |
| 1277 | |
| 1278 | # update CMD_IS_GNUTLS variable |
| 1279 | is_gnutls "$CLI_CMD" |
| 1280 | |
| 1281 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1282 | # set the default priority |
| 1283 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1284 | case "$CLI_CMD" in |
| 1285 | *--priority*) :;; |
| 1286 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1287 | esac |
| 1288 | fi |
| 1289 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1290 | # fix client port |
| 1291 | if [ -n "$PXY_CMD" ]; then |
| 1292 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1293 | else |
| 1294 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 1295 | fi |
| 1296 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1297 | # prepend valgrind to our commands if active |
| 1298 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1299 | if is_polar "$SRV_CMD"; then |
| 1300 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1301 | fi |
| 1302 | if is_polar "$CLI_CMD"; then |
| 1303 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1304 | fi |
| 1305 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1306 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1307 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1308 | # Check for failure conditions after a test case. |
| 1309 | # |
| 1310 | # Inputs from run_test: |
| 1311 | # * positional parameters: test options (see run_test documentation) |
| 1312 | # * $CLI_EXIT: client return code |
| 1313 | # * $CLI_EXPECT: expected client return code |
| 1314 | # * $SRV_RET: server return code |
| 1315 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1316 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1317 | # |
| 1318 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1319 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1320 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1321 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1322 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1323 | if [ $TIMES_LEFT -gt 0 ] && |
| 1324 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1325 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1326 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1327 | return |
| 1328 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1329 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1330 | # check if the client and server went at least to the handshake stage |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1331 | # (useful to avoid tests with only negative assertions and non-zero |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1332 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1333 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1334 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1335 | then |
| 1336 | if is_polar "$SRV_CMD"; then |
| 1337 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1338 | else |
| 1339 | fail "server or client failed to reach handshake stage" |
| 1340 | return |
| 1341 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1342 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1343 | if is_polar "$CLI_CMD"; then |
| 1344 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1345 | else |
| 1346 | fail "server or client failed to reach handshake stage" |
| 1347 | return |
| 1348 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1349 | fi |
| 1350 | fi |
| 1351 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1352 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1353 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1354 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1355 | # care anyway), in case e.g. the server reports a memory leak. |
| 1356 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1357 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1358 | return |
| 1359 | fi |
| 1360 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1361 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1362 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1363 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1364 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1365 | fail "bad client exit code (expected $CLI_EXPECT, got $CLI_EXIT)" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1366 | return |
| 1367 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1368 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1369 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1370 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1371 | # lines with 'Serious error when reading debug info', are valgrind issues as well |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1372 | while [ $# -gt 0 ] |
| 1373 | do |
| 1374 | case $1 in |
| 1375 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1376 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1377 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1378 | return |
| 1379 | fi |
| 1380 | ;; |
| 1381 | |
| 1382 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1383 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1384 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1385 | return |
| 1386 | fi |
| 1387 | ;; |
| 1388 | |
| 1389 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1390 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 1391 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1392 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1393 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1394 | return |
| 1395 | fi |
| 1396 | ;; |
| 1397 | |
| 1398 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1399 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 1400 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1401 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1402 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1403 | return |
| 1404 | fi |
| 1405 | ;; |
| 1406 | |
| 1407 | # The filtering in the following two options (-u and -U) do the following |
| 1408 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1409 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1410 | # - keep one of each non-unique line |
| 1411 | # - count how many lines remain |
| 1412 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1413 | # if there were no duplicates. |
| 1414 | "-U") |
| 1415 | if [ $(grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | grep -v "$2" | sort | uniq -d | wc -l) -gt 1 ]; then |
| 1416 | fail "lines following pattern '$2' must be unique in Server output" |
| 1417 | return |
| 1418 | fi |
| 1419 | ;; |
| 1420 | |
| 1421 | "-u") |
| 1422 | if [ $(grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep -A1 "$2" | grep -v "$2" | sort | uniq -d | wc -l) -gt 1 ]; then |
| 1423 | fail "lines following pattern '$2' must be unique in Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1424 | return |
| 1425 | fi |
| 1426 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1427 | "-F") |
| 1428 | if ! $2 "$SRV_OUT"; then |
| 1429 | fail "function call to '$2' failed on Server output" |
| 1430 | return |
| 1431 | fi |
| 1432 | ;; |
| 1433 | "-f") |
| 1434 | if ! $2 "$CLI_OUT"; then |
| 1435 | fail "function call to '$2' failed on Client output" |
| 1436 | return |
| 1437 | fi |
| 1438 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1439 | "-g") |
| 1440 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1441 | fail "function call to '$2' failed on Server and Client output" |
| 1442 | return |
| 1443 | fi |
| 1444 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1445 | |
| 1446 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1447 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1448 | exit 1 |
| 1449 | esac |
| 1450 | shift 2 |
| 1451 | done |
| 1452 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1453 | # check valgrind's results |
| 1454 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1455 | if is_polar "$SRV_CMD" && has_mem_err $SRV_OUT; then |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1456 | fail "Server has memory errors" |
| 1457 | return |
| 1458 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1459 | if is_polar "$CLI_CMD" && has_mem_err $CLI_OUT; then |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1460 | fail "Client has memory errors" |
| 1461 | return |
| 1462 | fi |
| 1463 | fi |
| 1464 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1465 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1466 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1467 | } |
| 1468 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1469 | # Run the current test case: start the server and if applicable the proxy, run |
| 1470 | # the client, wait for all processes to finish or time out. |
| 1471 | # |
| 1472 | # Inputs: |
| 1473 | # * $NAME: test case name |
| 1474 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1475 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1476 | # |
| 1477 | # Outputs: |
| 1478 | # * $CLI_EXIT: client return code |
| 1479 | # * $SRV_RET: server return code |
| 1480 | do_run_test_once() { |
| 1481 | # run the commands |
| 1482 | if [ -n "$PXY_CMD" ]; then |
| 1483 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1484 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1485 | PXY_PID=$! |
| 1486 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1487 | fi |
| 1488 | |
| 1489 | check_osrv_dtls |
| 1490 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1491 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1492 | SRV_PID=$! |
| 1493 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1494 | |
| 1495 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1496 | # The client must be a subprocess of the script in order for killing it to |
| 1497 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1498 | # not at the end of the line: the latter approach will spawn eval as a |
| 1499 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1500 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1501 | wait_client_done |
| 1502 | |
| 1503 | sleep 0.05 |
| 1504 | |
| 1505 | # terminate the server (and the proxy) |
| 1506 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1507 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1508 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1509 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1510 | SRV_RET=$? |
| 1511 | |
| 1512 | if [ -n "$PXY_CMD" ]; then |
| 1513 | kill $PXY_PID >/dev/null 2>&1 |
Jerry Yu | 6969eee | 2022-10-10 10:25:26 +0800 | [diff] [blame] | 1514 | wait $PXY_PID >> $PXY_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1515 | fi |
| 1516 | } |
| 1517 | |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1518 | # Detect if the current test is going to use TLS 1.3 or TLS 1.2. |
Valerio Setti | 194e2bd | 2023-03-02 17:18:10 +0100 | [diff] [blame] | 1519 | # $1 and $2 contain the server and client command lines, respectively. |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1520 | # |
| 1521 | # Note: this function only provides some guess about TLS version by simply |
| 1522 | # looking at the server/client command lines. Even thought this works |
| 1523 | # for the sake of tests' filtering (especially in conjunction with the |
| 1524 | # detect_required_features() function), it does NOT guarantee that the |
| 1525 | # result is accurate. It does not check other conditions, such as: |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1526 | # - we can force a ciphersuite which contains "WITH" in its name, meaning |
| 1527 | # that we are going to use TLS 1.2 |
| 1528 | # - etc etc |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1529 | get_tls_version() { |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1530 | # First check if the version is forced on an Mbed TLS peer |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1531 | case $1 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1532 | *tls12*) |
| 1533 | echo "TLS12" |
| 1534 | return;; |
| 1535 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1536 | echo "TLS13" |
| 1537 | return;; |
| 1538 | esac |
| 1539 | case $2 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1540 | *tls12*) |
| 1541 | echo "TLS12" |
| 1542 | return;; |
| 1543 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1544 | echo "TLS13" |
| 1545 | return;; |
| 1546 | esac |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1547 | # Second check if the version is forced on an OpenSSL or GnuTLS peer |
| 1548 | case $1 in |
| 1549 | tls1_2*) |
| 1550 | echo "TLS12" |
| 1551 | return;; |
| 1552 | *tls1_3) |
| 1553 | echo "TLS13" |
| 1554 | return;; |
| 1555 | esac |
| 1556 | case $2 in |
| 1557 | *tls1_2) |
| 1558 | echo "TLS12" |
| 1559 | return;; |
| 1560 | *tls1_3) |
| 1561 | echo "TLS13" |
| 1562 | return;; |
| 1563 | esac |
| 1564 | # Third if the version is not forced, if TLS 1.3 is enabled then the test |
| 1565 | # is aimed to run a TLS 1.3 handshake. |
| 1566 | if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_3 |
| 1567 | then |
| 1568 | echo "TLS13" |
| 1569 | else |
| 1570 | echo "TLS12" |
| 1571 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1572 | } |
| 1573 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1574 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1575 | # Options: -s pattern pattern that must be present in server output |
| 1576 | # -c pattern pattern that must be present in client output |
| 1577 | # -u pattern lines after pattern must be unique in client output |
| 1578 | # -f call shell function on client output |
| 1579 | # -S pattern pattern that must be absent in server output |
| 1580 | # -C pattern pattern that must be absent in client output |
| 1581 | # -U pattern lines after pattern must be unique in server output |
| 1582 | # -F call shell function on server output |
| 1583 | # -g call shell function on server and client output |
| 1584 | run_test() { |
| 1585 | NAME="$1" |
| 1586 | shift 1 |
| 1587 | |
Tomás González | 787428a | 2023-08-23 15:27:19 +0100 | [diff] [blame] | 1588 | if is_excluded "$NAME"; then |
| 1589 | SKIP_NEXT="NO" |
| 1590 | # There was no request to run the test, so don't record its outcome. |
| 1591 | return |
| 1592 | fi |
| 1593 | |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1594 | if [ "$LIST_TESTS" -gt 0 ]; then |
Tomás González | 51cb704 | 2023-09-07 10:21:19 +0100 | [diff] [blame] | 1595 | printf "%s\n" "$NAME" |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1596 | return |
| 1597 | fi |
| 1598 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 1599 | # Use ssl-opt as default test suite name. Also see record_outcome function |
| 1600 | if is_excluded_test_suite "${TEST_SUITE_NAME:-ssl-opt}"; then |
| 1601 | # Do not skip next test and skip current test. |
| 1602 | SKIP_NEXT="NO" |
| 1603 | return |
| 1604 | fi |
| 1605 | |
Tomás González | 51cb704 | 2023-09-07 10:21:19 +0100 | [diff] [blame] | 1606 | print_name "$NAME" |
| 1607 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1608 | # Do we only run numbered tests? |
| 1609 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1610 | case ",$RUN_TEST_NUMBER," in |
| 1611 | *",$TESTS,"*) :;; |
| 1612 | *) SKIP_NEXT="YES";; |
| 1613 | esac |
| 1614 | fi |
| 1615 | |
| 1616 | # does this test use a proxy? |
| 1617 | if [ "X$1" = "X-p" ]; then |
| 1618 | PXY_CMD="$2" |
| 1619 | shift 2 |
| 1620 | else |
| 1621 | PXY_CMD="" |
| 1622 | fi |
| 1623 | |
| 1624 | # get commands and client output |
| 1625 | SRV_CMD="$1" |
| 1626 | CLI_CMD="$2" |
| 1627 | CLI_EXPECT="$3" |
| 1628 | shift 3 |
| 1629 | |
| 1630 | # Check if test uses files |
| 1631 | case "$SRV_CMD $CLI_CMD" in |
| 1632 | *data_files/*) |
| 1633 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1634 | esac |
| 1635 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1636 | # Check if the test uses DTLS. |
| 1637 | detect_dtls "$SRV_CMD" |
| 1638 | if [ "$DTLS" -eq 1 ]; then |
| 1639 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1640 | fi |
| 1641 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1642 | # Check if we are trying to use an external tool wich does not support ECDH |
| 1643 | EXT_WO_ECDH=$(use_ext_tool_without_ecdh_support "$SRV_CMD" "$CLI_CMD") |
| 1644 | |
Valerio Setti | 726ffbf | 2023-08-02 20:02:44 +0200 | [diff] [blame] | 1645 | # Guess the TLS version which is going to be used |
| 1646 | if [ "$EXT_WO_ECDH" = "no" ]; then |
| 1647 | TLS_VERSION=$(get_tls_version "$SRV_CMD" "$CLI_CMD") |
| 1648 | else |
| 1649 | TLS_VERSION="TLS12" |
| 1650 | fi |
| 1651 | |
| 1652 | # If the client or server requires certain features that can be detected |
Manuel Pégourié-Gonnard | f299efd | 2023-09-18 11:19:04 +0200 | [diff] [blame] | 1653 | # from their command-line arguments, check whether they're enabled. |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1654 | detect_required_features "$SRV_CMD" "server" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
| 1655 | detect_required_features "$CLI_CMD" "client" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1656 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1657 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1658 | maybe_adapt_for_psk "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1659 | |
| 1660 | # should we skip? |
| 1661 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1662 | SKIP_NEXT="NO" |
| 1663 | record_outcome "SKIP" |
| 1664 | SKIPS=$(( $SKIPS + 1 )) |
| 1665 | return |
| 1666 | fi |
| 1667 | |
| 1668 | analyze_test_commands "$@" |
| 1669 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1670 | # One regular run and two retries |
| 1671 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1672 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1673 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1674 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1675 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1676 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1677 | check_test_failure "$@" |
| 1678 | case $outcome in |
| 1679 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1680 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1681 | FAIL) return;; |
| 1682 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1683 | done |
| 1684 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1685 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1686 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1687 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1688 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1689 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1690 | if [ -n "$PXY_CMD" ]; then |
| 1691 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1692 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1693 | fi |
| 1694 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1695 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1696 | } |
| 1697 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1698 | run_test_psa() { |
| 1699 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1700 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1701 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1702 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1703 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1704 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1705 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1706 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1707 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1708 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1709 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1710 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1711 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1712 | -S "error" \ |
| 1713 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1714 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1715 | } |
| 1716 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1717 | run_test_psa_force_curve() { |
| 1718 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1719 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1720 | run_test "PSA - ECDH with $1" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 1721 | "$P_SRV debug_level=4 force_version=tls12 groups=$1" \ |
| 1722 | "$P_CLI debug_level=4 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 groups=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1723 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1724 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1725 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1726 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1727 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1728 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1729 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1730 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1731 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1732 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1733 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1734 | } |
| 1735 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1736 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1737 | # a maximum fragment length. |
| 1738 | # first argument ($1) is MFL for SSL client |
| 1739 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1740 | run_test_memory_after_hanshake_with_mfl() |
| 1741 | { |
| 1742 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1743 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1744 | |
| 1745 | # Leave some margin for robustness |
| 1746 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1747 | |
| 1748 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1749 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1750 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1751 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1752 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1753 | 0 \ |
| 1754 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1755 | } |
| 1756 | |
| 1757 | |
| 1758 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1759 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1760 | run_tests_memory_after_hanshake() |
| 1761 | { |
| 1762 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1763 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1764 | |
| 1765 | # first test with default MFU is to get reference memory usage |
| 1766 | MEMORY_USAGE_MFL_16K=0 |
| 1767 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1768 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1769 | "$P_CLI debug_level=3 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1770 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1771 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1772 | 0 \ |
| 1773 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1774 | |
| 1775 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1776 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1777 | |
| 1778 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1779 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1780 | |
| 1781 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1782 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1783 | |
| 1784 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1785 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1786 | } |
| 1787 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1788 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1789 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1790 | rm -f context_srv.txt |
| 1791 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1792 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1793 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1794 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1795 | test -n "${DOG_PID:-}" && kill $DOG_PID >/dev/null 2>&1 |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1796 | exit 1 |
| 1797 | } |
| 1798 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1799 | # |
| 1800 | # MAIN |
| 1801 | # |
| 1802 | |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 1803 | # Make the outcome file path relative to the original directory, not |
| 1804 | # to .../tests |
| 1805 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 1806 | [!/]*) |
| 1807 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 1808 | ;; |
| 1809 | esac |
| 1810 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1811 | populate_enabled_hash_algs |
| 1812 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1813 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1814 | # patterns rather than regular expressions, use a case statement instead |
| 1815 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1816 | # detects simple cases: plain substring, everything, nothing. |
| 1817 | # |
| 1818 | # As an exception, the character '.' is treated as an ordinary character |
| 1819 | # if it is the only special character in the string. This is because it's |
| 1820 | # rare to need "any one character", but needing a literal '.' is common |
| 1821 | # (e.g. '-f "DTLS 1.2"'). |
| 1822 | need_grep= |
| 1823 | case "$FILTER" in |
| 1824 | '^$') simple_filter=;; |
| 1825 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1826 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1827 | need_grep=1;; |
| 1828 | *) # No regexp or shell-pattern special character |
| 1829 | simple_filter="*$FILTER*";; |
| 1830 | esac |
| 1831 | case "$EXCLUDE" in |
| 1832 | '^$') simple_exclude=;; |
| 1833 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1834 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1835 | need_grep=1;; |
| 1836 | *) # No regexp or shell-pattern special character |
| 1837 | simple_exclude="*$EXCLUDE*";; |
| 1838 | esac |
| 1839 | if [ -n "$need_grep" ]; then |
| 1840 | is_excluded () { |
| 1841 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1842 | } |
| 1843 | else |
| 1844 | is_excluded () { |
| 1845 | case "$1" in |
| 1846 | $simple_exclude) true;; |
| 1847 | $simple_filter) false;; |
| 1848 | *) true;; |
| 1849 | esac |
| 1850 | } |
| 1851 | fi |
| 1852 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 1853 | # Filter tests according to TEST_SUITE_NAME |
| 1854 | is_excluded_test_suite () { |
| 1855 | if [ -n "$RUN_TEST_SUITE" ] |
| 1856 | then |
| 1857 | case ",$RUN_TEST_SUITE," in |
| 1858 | *",$1,"*) false;; |
| 1859 | *) true;; |
| 1860 | esac |
| 1861 | else |
| 1862 | false |
| 1863 | fi |
| 1864 | |
| 1865 | } |
| 1866 | |
| 1867 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 1868 | if [ "$LIST_TESTS" -eq 0 ];then |
| 1869 | |
| 1870 | # sanity checks, avoid an avalanche of errors |
| 1871 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1872 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1873 | P_PXY_BIN="${P_PXY%%[ ]*}" |
| 1874 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1875 | echo "Command '$P_SRV_BIN' is not an executable file" |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1876 | exit 1 |
| 1877 | fi |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 1878 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1879 | echo "Command '$P_CLI_BIN' is not an executable file" |
| 1880 | exit 1 |
| 1881 | fi |
| 1882 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1883 | echo "Command '$P_PXY_BIN' is not an executable file" |
| 1884 | exit 1 |
| 1885 | fi |
| 1886 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1887 | if which valgrind >/dev/null 2>&1; then :; else |
| 1888 | echo "Memcheck not possible. Valgrind not found" |
| 1889 | exit 1 |
| 1890 | fi |
| 1891 | fi |
| 1892 | if which $OPENSSL >/dev/null 2>&1; then :; else |
| 1893 | echo "Command '$OPENSSL' not found" |
| 1894 | exit 1 |
| 1895 | fi |
| 1896 | |
| 1897 | # used by watchdog |
| 1898 | MAIN_PID="$$" |
| 1899 | |
| 1900 | # We use somewhat arbitrary delays for tests: |
| 1901 | # - how long do we wait for the server to start (when lsof not available)? |
| 1902 | # - how long do we allow for the client to finish? |
| 1903 | # (not to check performance, just to avoid waiting indefinitely) |
| 1904 | # Things are slower with valgrind, so give extra time here. |
| 1905 | # |
| 1906 | # Note: without lsof, there is a trade-off between the running time of this |
| 1907 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1908 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1909 | # the script, only the case where a client or server gets stuck. |
| 1910 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1911 | START_DELAY=6 |
| 1912 | DOG_DELAY=60 |
| 1913 | else |
| 1914 | START_DELAY=2 |
| 1915 | DOG_DELAY=20 |
| 1916 | fi |
| 1917 | |
| 1918 | # some particular tests need more time: |
| 1919 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1920 | # - for the server, we sleep for a number of seconds after the client exits |
| 1921 | # see client_need_more_time() and server_needs_more_time() |
| 1922 | CLI_DELAY_FACTOR=1 |
| 1923 | SRV_DELAY_SECONDS=0 |
| 1924 | |
| 1925 | # fix commands to use this port, force IPv4 while at it |
| 1926 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
| 1927 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1928 | # machines that will resolve to ::1, and we don't want ipv6 here. |
| 1929 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1930 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
| 1931 | P_PXY="$P_PXY server_addr=127.0.0.1 server_port=$SRV_PORT listen_addr=127.0.0.1 listen_port=$PXY_PORT ${SEED:+"seed=$SEED"}" |
| 1932 | O_SRV="$O_SRV -accept $SRV_PORT" |
| 1933 | O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT" |
| 1934 | G_SRV="$G_SRV -p $SRV_PORT" |
| 1935 | G_CLI="$G_CLI -p +SRV_PORT" |
| 1936 | |
| 1937 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even |
| 1938 | # low-security ones. This covers not just cipher suites but also protocol |
| 1939 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on |
| 1940 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in |
| 1941 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find |
| 1942 | # a way to discover it from -help, so check the openssl version. |
| 1943 | case $($OPENSSL version) in |
| 1944 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; |
| 1945 | *) |
| 1946 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" |
| 1947 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" |
| 1948 | ;; |
| 1949 | esac |
| 1950 | |
| 1951 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1952 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
| 1953 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" |
| 1954 | O_NEXT_SRV_EARLY_DATA="$O_NEXT_SRV_EARLY_DATA -accept $SRV_PORT" |
| 1955 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
| 1956 | O_NEXT_CLI_NO_CERT="$O_NEXT_CLI_NO_CERT -connect 127.0.0.1:+SRV_PORT" |
| 1957 | fi |
| 1958 | |
| 1959 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
| 1960 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1961 | G_NEXT_SRV_NO_CERT="$G_NEXT_SRV_NO_CERT -p $SRV_PORT" |
| 1962 | fi |
| 1963 | |
| 1964 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
| 1965 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
| 1966 | G_NEXT_CLI_NO_CERT="$G_NEXT_CLI_NO_CERT -p +SRV_PORT localhost" |
| 1967 | fi |
| 1968 | |
| 1969 | # Allow SHA-1, because many of our test certificates use it |
| 1970 | P_SRV="$P_SRV allow_sha1=1" |
| 1971 | P_CLI="$P_CLI allow_sha1=1" |
| 1972 | |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1973 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1974 | # Also pick a unique name for intermediate files |
| 1975 | SRV_OUT="srv_out.$$" |
| 1976 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1977 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1978 | SESSION="session.$$" |
| 1979 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1980 | SKIP_NEXT="NO" |
| 1981 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1982 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1983 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1984 | # Basic test |
| 1985 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1986 | # Checks that: |
| 1987 | # - things work with all ciphersuites active (used with config-full in all.sh) |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1988 | # - the expected parameters are selected |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1989 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 1990 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Valerio Setti | 482a0b9 | 2023-08-18 15:55:10 +0200 | [diff] [blame] | 1991 | requires_any_configs_enabled "MBEDTLS_ECP_DP_CURVE25519_ENABLED \ |
| 1992 | PSA_WANT_ECC_MONTGOMERY_255" |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 1993 | run_test "Default, TLS 1.2" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1994 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 1995 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1996 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1997 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1998 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1999 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 2000 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2001 | -S "error" \ |
| 2002 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2003 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2004 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2005 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2006 | run_test "Default, DTLS" \ |
| 2007 | "$P_SRV dtls=1" \ |
| 2008 | "$P_CLI dtls=1" \ |
| 2009 | 0 \ |
| 2010 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2011 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2012 | |
Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 2013 | # GnuTLS can be setup to send a ClientHello containing a supported versions |
| 2014 | # extension proposing TLS 1.2 (preferred) and then TLS 1.3. In that case, |
| 2015 | # a TLS 1.3 and TLS 1.2 capable server is supposed to negotiate TLS 1.2 and |
| 2016 | # to indicate in the ServerHello that it downgrades from TLS 1.3. The GnuTLS |
| 2017 | # client then detects the downgrade indication and aborts the handshake even |
| 2018 | # if TLS 1.2 was its preferred version. Keeping the test even if the |
| 2019 | # handshake fails eventually as it exercices parts of the Mbed TLS |
| 2020 | # implementation that are otherwise not exercised. |
Ronald Cron | d120bd6 | 2023-03-14 15:43:17 +0100 | [diff] [blame] | 2021 | requires_gnutls_tls1_3 |
| 2022 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2023 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2024 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 2025 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | d120bd6 | 2023-03-14 15:43:17 +0100 | [diff] [blame] | 2026 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 2027 | run_test "Server selecting TLS 1.2 over TLS 1.3" \ |
| 2028 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 2029 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" \ |
| 2030 | 1 \ |
| 2031 | -c "Detected downgrade to TLS 1.2 from TLS 1.3" |
| 2032 | |
| 2033 | requires_gnutls_tls1_3 |
| 2034 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2035 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2036 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2037 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2038 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 2039 | run_test "Server selecting TLS 1.2" \ |
Ronald Cron | d120bd6 | 2023-03-14 15:43:17 +0100 | [diff] [blame] | 2040 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 2041 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" \ |
| 2042 | 0 \ |
| 2043 | -s "Protocol is TLSv1.2" \ |
| 2044 | -c "HTTP/1.0 200 OK" |
| 2045 | |
| 2046 | requires_gnutls_tls1_3 |
| 2047 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2048 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2049 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2050 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 1a353ea | 2023-04-04 14:55:57 +0200 | [diff] [blame] | 2051 | run_test "Server selecting TLS 1.3, over TLS 1.2 if supported" \ |
Ronald Cron | d120bd6 | 2023-03-14 15:43:17 +0100 | [diff] [blame] | 2052 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 2053 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+VERS-TLS1.2:%DISABLE_TLS13_COMPAT_MODE" \ |
| 2054 | 0 \ |
| 2055 | -s "Protocol is TLSv1.3" \ |
| 2056 | -c "HTTP/1.0 200 OK" |
| 2057 | |
| 2058 | requires_gnutls_tls1_3 |
| 2059 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2060 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2061 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2062 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 2063 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 1a353ea | 2023-04-04 14:55:57 +0200 | [diff] [blame] | 2064 | run_test "Server selecting TLS 1.3, over TLS 1.2 if supported - compat mode enabled" \ |
Ronald Cron | d120bd6 | 2023-03-14 15:43:17 +0100 | [diff] [blame] | 2065 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 2066 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+VERS-TLS1.2" \ |
| 2067 | 0 \ |
| 2068 | -s "Protocol is TLSv1.3" \ |
| 2069 | -c "HTTP/1.0 200 OK" |
| 2070 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 2071 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 2072 | run_test "TLS client auth: required" \ |
| 2073 | "$P_SRV auth_mode=required" \ |
| 2074 | "$P_CLI" \ |
| 2075 | 0 \ |
| 2076 | -s "Verifying peer X.509 certificate... ok" |
| 2077 | |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 2078 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2079 | "$P_SRV" \ |
| 2080 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2081 | 0 \ |
| 2082 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2083 | -c "Key size is 256" |
| 2084 | |
| 2085 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2086 | "$P_SRV" \ |
| 2087 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2088 | 0 \ |
| 2089 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2090 | -c "Key size is 128" |
| 2091 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2092 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2093 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2094 | run_test "TLS: password protected client key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2095 | "$P_SRV force_version=tls12 auth_mode=required" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2096 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 2097 | 0 |
| 2098 | |
| 2099 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2100 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2101 | run_test "TLS: password protected server key" \ |
| 2102 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2103 | "$P_CLI force_version=tls12" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2104 | 0 |
| 2105 | |
| 2106 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2107 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2108 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2109 | run_test "TLS: password protected server key, two certificates" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2110 | "$P_SRV force_version=tls12\ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2111 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 2112 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 2113 | "$P_CLI" \ |
| 2114 | 0 |
| 2115 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2116 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2117 | run_test "CA callback on client" \ |
| 2118 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2119 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 " \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2120 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2121 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2122 | -S "error" \ |
| 2123 | -C "error" |
| 2124 | |
| 2125 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2126 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2127 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2128 | run_test "CA callback on server" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2129 | "$P_SRV force_version=tls12 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2130 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 2131 | key_file=data_files/server5.key" \ |
| 2132 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2133 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2134 | -s "Verifying peer X.509 certificate... ok" \ |
| 2135 | -S "error" \ |
| 2136 | -C "error" |
| 2137 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2138 | # Test using an EC opaque private key for client authentication |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2139 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2140 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2141 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2142 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2143 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2144 | "$P_SRV force_version=tls12 auth_mode=required crt_file=data_files/server5.crt \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2145 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2146 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2147 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2148 | 0 \ |
| 2149 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2150 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2151 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2152 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2153 | -S "error" \ |
| 2154 | -C "error" |
| 2155 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2156 | # Test using a RSA opaque private key for client authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2157 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2158 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2159 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2160 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2161 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2162 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2163 | "$P_SRV force_version=tls12 auth_mode=required crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2164 | key_file=data_files/server2.key" \ |
| 2165 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2166 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2167 | 0 \ |
| 2168 | -c "key type: Opaque" \ |
| 2169 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2170 | -s "Verifying peer X.509 certificate... ok" \ |
| 2171 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2172 | -S "error" \ |
| 2173 | -C "error" |
| 2174 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2175 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2176 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2177 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2178 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2179 | run_test "Opaque key for client authentication: DHE-RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2180 | "$P_SRV force_version=tls12 auth_mode=required crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2181 | key_file=data_files/server2.key" \ |
| 2182 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2183 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 2184 | key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2185 | 0 \ |
| 2186 | -c "key type: Opaque" \ |
| 2187 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2188 | -s "Verifying peer X.509 certificate... ok" \ |
| 2189 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2190 | -S "error" \ |
| 2191 | -C "error" |
| 2192 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2193 | # Test using an EC opaque private key for server authentication |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2194 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2195 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2196 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2197 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2198 | run_test "Opaque key for server authentication: ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2199 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2200 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2201 | "$P_CLI force_version=tls12" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2202 | 0 \ |
| 2203 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2204 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2205 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2206 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2207 | -S "error" \ |
| 2208 | -C "error" |
| 2209 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2210 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2211 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2212 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2213 | run_test "Opaque key for server authentication: ECDH-" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2214 | "$P_SRV auth_mode=required key_opaque=1\ |
Neil Armstrong | b7b549a | 2022-03-25 15:13:02 +0100 | [diff] [blame] | 2215 | crt_file=data_files/server5.ku-ka.crt\ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2216 | key_file=data_files/server5.key key_opaque_algs=ecdh,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2217 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2218 | 0 \ |
| 2219 | -c "Verifying peer X.509 certificate... ok" \ |
| 2220 | -c "Ciphersuite is TLS-ECDH-" \ |
| 2221 | -s "key types: Opaque, none" \ |
| 2222 | -s "Ciphersuite is TLS-ECDH-" \ |
| 2223 | -S "error" \ |
| 2224 | -C "error" |
| 2225 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2226 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2227 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2228 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2229 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2230 | run_test "Opaque key for server authentication: invalid key: decrypt with ECC key, no async" \ |
| 2231 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
| 2232 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 2233 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2234 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2235 | 1 \ |
| 2236 | -s "key types: Opaque, none" \ |
| 2237 | -s "error" \ |
| 2238 | -c "error" \ |
| 2239 | -c "Public key type mismatch" |
| 2240 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2241 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2242 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2243 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2244 | requires_config_enabled MBEDTLS_RSA_C |
| 2245 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2246 | requires_hash_alg SHA_256 |
| 2247 | run_test "Opaque key for server authentication: invalid key: ecdh with RSA key, no async" \ |
| 2248 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2249 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 2250 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2251 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2252 | 1 \ |
| 2253 | -s "key types: Opaque, none" \ |
| 2254 | -s "error" \ |
| 2255 | -c "error" \ |
| 2256 | -c "Public key type mismatch" |
| 2257 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2258 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2259 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2260 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2261 | requires_hash_alg SHA_256 |
| 2262 | run_test "Opaque key for server authentication: invalid alg: decrypt with ECC key, async" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2263 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2264 | key_file=data_files/server5.key key_opaque_algs=rsa-decrypt,none \ |
| 2265 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2266 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2267 | 1 \ |
| 2268 | -s "key types: Opaque, none" \ |
| 2269 | -s "got ciphersuites in common, but none of them usable" \ |
| 2270 | -s "error" \ |
| 2271 | -c "error" |
| 2272 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2273 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2274 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2275 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2276 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2277 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2278 | run_test "Opaque key for server authentication: invalid alg: ecdh with RSA key, async" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2279 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2280 | key_file=data_files/server2.key key_opaque_algs=ecdh,none \ |
| 2281 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2282 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2283 | 1 \ |
| 2284 | -s "key types: Opaque, none" \ |
| 2285 | -s "got ciphersuites in common, but none of them usable" \ |
| 2286 | -s "error" \ |
| 2287 | -c "error" |
| 2288 | |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2289 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2290 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2291 | requires_hash_alg SHA_256 |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2292 | requires_config_enabled MBEDTLS_CCM_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2293 | run_test "Opaque key for server authentication: invalid alg: ECDHE-ECDSA with ecdh" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2294 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2295 | key_file=data_files/server5.key key_opaque_algs=ecdh,none \ |
| 2296 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2297 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2298 | 1 \ |
| 2299 | -s "key types: Opaque, none" \ |
| 2300 | -s "got ciphersuites in common, but none of them usable" \ |
| 2301 | -s "error" \ |
| 2302 | -c "error" |
| 2303 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2304 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2305 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2306 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2307 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2308 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2309 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDHE-ECDSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2310 | "$P_SRV force_version=tls12 key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2311 | key_file=data_files/server7.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2312 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2313 | key_opaque_algs2=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2314 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2315 | 0 \ |
| 2316 | -c "Verifying peer X.509 certificate... ok" \ |
| 2317 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2318 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2319 | -s "key types: Opaque, Opaque" \ |
| 2320 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2321 | -S "error" \ |
| 2322 | -C "error" |
| 2323 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2324 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2325 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2326 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2327 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2328 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDH-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2329 | "$P_SRV key_opaque=1 crt_file=data_files/server7.crt \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2330 | key_file=data_files/server7.key key_opaque_algs=ecdsa-sign,none \ |
| 2331 | crt_file2=data_files/server5.crt key_file2=data_files/server5.key \ |
| 2332 | key_opaque_algs2=ecdh,none debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2333 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-ECDH-ECDSA-WITH-CAMELLIA-256-CBC-SHA384" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2334 | 0 \ |
| 2335 | -c "Verifying peer X.509 certificate... ok" \ |
| 2336 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2337 | -c "CN=Polarssl Test EC CA" \ |
| 2338 | -s "key types: Opaque, Opaque" \ |
| 2339 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2340 | -S "error" \ |
| 2341 | -C "error" |
| 2342 | |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2343 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2344 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2345 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2346 | requires_config_enabled MBEDTLS_CCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2347 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2348 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2349 | "$P_SRV key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2350 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2351 | crt_file2=data_files/server2-sha256.crt \ |
| 2352 | key_file2=data_files/server2.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2353 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-CCM" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2354 | 0 \ |
| 2355 | -c "Verifying peer X.509 certificate... ok" \ |
| 2356 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2357 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2358 | -s "key types: Opaque, Opaque" \ |
| 2359 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2360 | -S "error" \ |
| 2361 | -C "error" |
| 2362 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2363 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2364 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2365 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2366 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2367 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2368 | run_test "TLS 1.3 opaque key: no suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2369 | "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs=rsa-decrypt,none" \ |
Ronald Cron | e3196d2 | 2022-09-16 16:43:35 +0200 | [diff] [blame] | 2370 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2371 | 1 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2372 | -c "key type: Opaque" \ |
| 2373 | -s "key types: Opaque, Opaque" \ |
| 2374 | -c "error" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2375 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2376 | |
| 2377 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2378 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2379 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2380 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2381 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2382 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2383 | "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Ronald Cron | e3196d2 | 2022-09-16 16:43:35 +0200 | [diff] [blame] | 2384 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2385 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2386 | -c "key type: Opaque" \ |
| 2387 | -s "key types: Opaque, Opaque" \ |
| 2388 | -C "error" \ |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2389 | -S "error" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2390 | |
| 2391 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2392 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2393 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2394 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2395 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2396 | run_test "TLS 1.3 opaque key: first client sig alg not suitable" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2397 | "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs=rsa-sign-pss-sha512,none" \ |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2398 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2399 | 0 \ |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2400 | -s "key types: Opaque, Opaque" \ |
| 2401 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2402 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2403 | -C "error" \ |
| 2404 | -S "error" \ |
| 2405 | |
| 2406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2407 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2408 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2409 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2410 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2411 | run_test "TLS 1.3 opaque key: 2 keys on server, suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2412 | "$P_SRV debug_level=4 auth_mode=required key_opaque=1 key_opaque_algs2=ecdsa-sign,none key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Ronald Cron | e3196d2 | 2022-09-16 16:43:35 +0200 | [diff] [blame] | 2413 | "$P_CLI debug_level=4 key_opaque=1 key_opaque_algs=rsa-decrypt,rsa-sign-pss" \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2414 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2415 | -c "key type: Opaque" \ |
| 2416 | -s "key types: Opaque, Opaque" \ |
| 2417 | -C "error" \ |
| 2418 | -S "error" \ |
| 2419 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2420 | # Test using a RSA opaque private key for server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2421 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2422 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2423 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2424 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2425 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2426 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2427 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2428 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2429 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2430 | 0 \ |
| 2431 | -c "Verifying peer X.509 certificate... ok" \ |
| 2432 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2433 | -s "key types: Opaque, none" \ |
| 2434 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2435 | -S "error" \ |
| 2436 | -C "error" |
| 2437 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2438 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2439 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2440 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2441 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2442 | run_test "Opaque key for server authentication: DHE-RSA" \ |
Neil Armstrong | 7999cb3 | 2022-07-01 09:51:33 +0200 | [diff] [blame] | 2443 | "$P_SRV key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2444 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2445 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2446 | 0 \ |
| 2447 | -c "Verifying peer X.509 certificate... ok" \ |
| 2448 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2449 | -s "key types: Opaque, none" \ |
| 2450 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2451 | -S "error" \ |
| 2452 | -C "error" |
| 2453 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2454 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2455 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2456 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2457 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2458 | run_test "Opaque key for server authentication: RSA-PSK" \ |
| 2459 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \ |
| 2460 | psk=abc123 psk_identity=foo" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2461 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2462 | psk=abc123 psk_identity=foo" \ |
| 2463 | 0 \ |
| 2464 | -c "Verifying peer X.509 certificate... ok" \ |
| 2465 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 2466 | -s "key types: Opaque, Opaque" \ |
| 2467 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 2468 | -S "error" \ |
| 2469 | -C "error" |
| 2470 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2471 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2472 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2473 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2474 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2475 | run_test "Opaque key for server authentication: RSA-" \ |
| 2476 | "$P_SRV debug_level=3 key_opaque=1 key_opaque_algs=rsa-decrypt,none " \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2477 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA256" \ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2478 | 0 \ |
| 2479 | -c "Verifying peer X.509 certificate... ok" \ |
| 2480 | -c "Ciphersuite is TLS-RSA-" \ |
| 2481 | -s "key types: Opaque, Opaque" \ |
| 2482 | -s "Ciphersuite is TLS-RSA-" \ |
| 2483 | -S "error" \ |
| 2484 | -C "error" |
| 2485 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2486 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2487 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2488 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2489 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2490 | run_test "Opaque key for server authentication: DHE-RSA, PSS instead of PKCS1" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2491 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
| 2492 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2493 | "$P_CLI crt_file=data_files/server2-sha256.crt \ |
| 2494 | key_file=data_files/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 2495 | 1 \ |
| 2496 | -s "key types: Opaque, none" \ |
| 2497 | -s "got ciphersuites in common, but none of them usable" \ |
| 2498 | -s "error" \ |
| 2499 | -c "error" |
| 2500 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2501 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2502 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2503 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2504 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2505 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2506 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2507 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2508 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2509 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pss,none \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2510 | crt_file2=data_files/server4.crt \ |
| 2511 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2512 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2513 | 0 \ |
| 2514 | -c "Verifying peer X.509 certificate... ok" \ |
| 2515 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2516 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2517 | -s "key types: Opaque, Opaque" \ |
| 2518 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2519 | -S "error" \ |
| 2520 | -C "error" |
| 2521 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2522 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2523 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2524 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2525 | requires_hash_alg SHA_384 |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2526 | requires_config_enabled MBEDTLS_GCM_C |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2527 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2528 | run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2529 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
| 2530 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2531 | crt_file2=data_files/server4.crt \ |
| 2532 | key_file2=data_files/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
| 2533 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2534 | 0 \ |
| 2535 | -c "Verifying peer X.509 certificate... ok" \ |
| 2536 | -c "Ciphersuite is TLS-DHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2537 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2538 | -s "key types: Opaque, Opaque" \ |
| 2539 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2540 | -S "error" \ |
| 2541 | -C "error" |
| 2542 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2543 | # Test using an EC opaque private key for client/server authentication |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2544 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2545 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2546 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2547 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2548 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2549 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2550 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2551 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2552 | key_file=data_files/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2553 | 0 \ |
| 2554 | -c "key type: Opaque" \ |
| 2555 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2556 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2557 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2558 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2559 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2560 | -S "error" \ |
| 2561 | -C "error" |
| 2562 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2563 | # Test using a RSA opaque private key for client/server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2564 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2565 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2566 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2567 | requires_hash_alg SHA_256 |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2568 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2569 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2570 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2571 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2572 | "$P_CLI force_version=tls12 key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2573 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2574 | 0 \ |
| 2575 | -c "key type: Opaque" \ |
| 2576 | -c "Verifying peer X.509 certificate... ok" \ |
| 2577 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2578 | -s "key types: Opaque, none" \ |
| 2579 | -s "Verifying peer X.509 certificate... ok" \ |
| 2580 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2581 | -S "error" \ |
| 2582 | -C "error" |
| 2583 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2584 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2585 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2586 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2587 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2588 | run_test "Opaque key for client/server authentication: DHE-RSA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2589 | "$P_SRV auth_mode=required key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2590 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2591 | "$P_CLI key_opaque=1 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2592 | key_file=data_files/server2.key key_opaque_algs=rsa-sign-pkcs1,none \ |
| 2593 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2594 | 0 \ |
| 2595 | -c "key type: Opaque" \ |
| 2596 | -c "Verifying peer X.509 certificate... ok" \ |
| 2597 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2598 | -s "key types: Opaque, none" \ |
| 2599 | -s "Verifying peer X.509 certificate... ok" \ |
| 2600 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2601 | -S "error" \ |
| 2602 | -C "error" |
| 2603 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2604 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2605 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2606 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2607 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2608 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2609 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2610 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2611 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2612 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2613 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2614 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2615 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2616 | |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2617 | requires_config_enabled PSA_WANT_ECC_SECP_R1_521 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2618 | run_test_psa_force_curve "secp521r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2619 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_512 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2620 | run_test_psa_force_curve "brainpoolP512r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2621 | requires_config_enabled PSA_WANT_ECC_SECP_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2622 | run_test_psa_force_curve "secp384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2623 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2624 | run_test_psa_force_curve "brainpoolP384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2625 | requires_config_enabled PSA_WANT_ECC_SECP_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2626 | run_test_psa_force_curve "secp256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2627 | requires_config_enabled PSA_WANT_ECC_SECP_K1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2628 | run_test_psa_force_curve "secp256k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2629 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2630 | run_test_psa_force_curve "brainpoolP256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2631 | requires_config_enabled PSA_WANT_ECC_SECP_R1_224 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2632 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2633 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2634 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2635 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 2636 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 2637 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2638 | #requires_config_enabled PSA_WANT_ECC_SECP_K1_224 |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2639 | #run_test_psa_force_curve "secp224k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2640 | requires_config_enabled PSA_WANT_ECC_SECP_R1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2641 | run_test_psa_force_curve "secp192r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2642 | requires_config_enabled PSA_WANT_ECC_SECP_K1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2643 | run_test_psa_force_curve "secp192k1" |
| 2644 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2645 | # Test current time in ServerHello |
| 2646 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2647 | run_test "ServerHello contains gmt_unix_time" \ |
| 2648 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2649 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2650 | 0 \ |
| 2651 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2652 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2653 | |
| 2654 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2655 | run_test "Unique IV in GCM" \ |
| 2656 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 2657 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2658 | 0 \ |
| 2659 | -u "IV used" \ |
| 2660 | -U "IV used" |
| 2661 | |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2662 | # Test for correctness of sent single supported algorithm |
Valerio Setti | 482a0b9 | 2023-08-18 15:55:10 +0200 | [diff] [blame] | 2663 | requires_any_configs_enabled "MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2664 | PSA_WANT_ECC_SECP_R1_256" |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2665 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2666 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Paul Elliott | 3b4ceda | 2022-11-17 12:47:10 +0000 | [diff] [blame] | 2667 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2668 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 2669 | requires_pk_alg "ECDSA" |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2670 | requires_hash_alg SHA_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2671 | run_test "Single supported algorithm sending: mbedtls client" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2672 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2673 | "$P_CLI force_version=tls12 sig_algs=ecdsa_secp256r1_sha256 debug_level=3" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2674 | 0 \ |
| 2675 | -c "Supported Signature Algorithm found: 04 03" |
| 2676 | |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2677 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2678 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Valerio Setti | 482a0b9 | 2023-08-18 15:55:10 +0200 | [diff] [blame] | 2679 | requires_any_configs_enabled "MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2680 | PSA_WANT_ECC_SECP_R1_256" |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2681 | requires_hash_alg SHA_256 |
| 2682 | run_test "Single supported algorithm sending: openssl client" \ |
| 2683 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
| 2684 | "$O_CLI -cert data_files/server6.crt \ |
| 2685 | -key data_files/server6.key" \ |
| 2686 | 0 |
| 2687 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2688 | # Tests for certificate verification callback |
| 2689 | run_test "Configuration-specific CRT verification callback" \ |
| 2690 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2691 | "$P_CLI force_version=tls12 context_crt_cb=0 debug_level=3" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2692 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2693 | -S "error" \ |
| 2694 | -c "Verify requested for " \ |
| 2695 | -c "Use configuration-specific verification callback" \ |
| 2696 | -C "Use context-specific verification callback" \ |
| 2697 | -C "error" |
| 2698 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2699 | run_test "Context-specific CRT verification callback" \ |
| 2700 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2701 | "$P_CLI force_version=tls12 context_crt_cb=1 debug_level=3" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2702 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2703 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2704 | -c "Verify requested for " \ |
| 2705 | -c "Use context-specific verification callback" \ |
| 2706 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2707 | -C "error" |
| 2708 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2709 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2710 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 2711 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2712 | "$P_CLI debug_level=2 force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2713 | 1 \ |
| 2714 | -c "The certificate is signed with an unacceptable hash" |
| 2715 | |
| 2716 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 2717 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2718 | "$P_CLI force_version=tls12 allow_sha1=1" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2719 | 0 |
| 2720 | |
| 2721 | run_test "SHA-256 allowed by default in server certificate" \ |
| 2722 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2723 | "$P_CLI force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2724 | 0 |
| 2725 | |
| 2726 | run_test "SHA-1 forbidden by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2727 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2728 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2729 | 1 \ |
| 2730 | -s "The certificate is signed with an unacceptable hash" |
| 2731 | |
| 2732 | run_test "SHA-1 explicitly allowed in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2733 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=1" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2734 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 2735 | 0 |
| 2736 | |
| 2737 | run_test "SHA-256 allowed by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2738 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2739 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 2740 | 0 |
| 2741 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2742 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2743 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2744 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2745 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2746 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2747 | 0 \ |
| 2748 | -c "next record in same datagram" \ |
| 2749 | -s "next record in same datagram" |
| 2750 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2751 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2752 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2753 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2754 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2755 | 0 \ |
| 2756 | -s "next record in same datagram" \ |
| 2757 | -C "next record in same datagram" |
| 2758 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2759 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2760 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2761 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2762 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2763 | 0 \ |
| 2764 | -S "next record in same datagram" \ |
| 2765 | -c "next record in same datagram" |
| 2766 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2767 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2768 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2769 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2770 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2771 | 0 \ |
| 2772 | -S "next record in same datagram" \ |
| 2773 | -C "next record in same datagram" |
| 2774 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2775 | # Tests for Context serialization |
| 2776 | |
| 2777 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2778 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2779 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2780 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2781 | 0 \ |
| 2782 | -c "Deserializing connection..." \ |
| 2783 | -S "Deserializing connection..." |
| 2784 | |
| 2785 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2786 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2787 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2788 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2789 | 0 \ |
| 2790 | -c "Deserializing connection..." \ |
| 2791 | -S "Deserializing connection..." |
| 2792 | |
| 2793 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2794 | run_test "Context serialization, client serializes, GCM" \ |
| 2795 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2796 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2797 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2798 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2799 | -S "Deserializing connection..." |
| 2800 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2802 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2803 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2804 | run_test "Context serialization, client serializes, with CID" \ |
| 2805 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2806 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2807 | 0 \ |
| 2808 | -c "Deserializing connection..." \ |
| 2809 | -S "Deserializing connection..." |
| 2810 | |
| 2811 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2812 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2813 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2814 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2815 | 0 \ |
| 2816 | -C "Deserializing connection..." \ |
| 2817 | -s "Deserializing connection..." |
| 2818 | |
| 2819 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2820 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2821 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2822 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2823 | 0 \ |
| 2824 | -C "Deserializing connection..." \ |
| 2825 | -s "Deserializing connection..." |
| 2826 | |
| 2827 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2828 | run_test "Context serialization, server serializes, GCM" \ |
| 2829 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2830 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2831 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2832 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2833 | -s "Deserializing connection..." |
| 2834 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2835 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2836 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2837 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2838 | run_test "Context serialization, server serializes, with CID" \ |
| 2839 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2840 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2841 | 0 \ |
| 2842 | -C "Deserializing connection..." \ |
| 2843 | -s "Deserializing connection..." |
| 2844 | |
| 2845 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2846 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2847 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2848 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2849 | 0 \ |
| 2850 | -c "Deserializing connection..." \ |
| 2851 | -s "Deserializing connection..." |
| 2852 | |
| 2853 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2854 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2855 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2856 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2857 | 0 \ |
| 2858 | -c "Deserializing connection..." \ |
| 2859 | -s "Deserializing connection..." |
| 2860 | |
| 2861 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2862 | run_test "Context serialization, both serialize, GCM" \ |
| 2863 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2864 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2865 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2866 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2867 | -s "Deserializing connection..." |
| 2868 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2869 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2870 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2871 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2872 | run_test "Context serialization, both serialize, with CID" \ |
| 2873 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2874 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2875 | 0 \ |
| 2876 | -c "Deserializing connection..." \ |
| 2877 | -s "Deserializing connection..." |
| 2878 | |
| 2879 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2880 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2881 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2882 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2883 | 0 \ |
| 2884 | -c "Deserializing connection..." \ |
| 2885 | -S "Deserializing connection..." |
| 2886 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2887 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2888 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2889 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2890 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2891 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2892 | 0 \ |
| 2893 | -c "Deserializing connection..." \ |
| 2894 | -S "Deserializing connection..." |
| 2895 | |
| 2896 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2897 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2898 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2899 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2900 | 0 \ |
| 2901 | -c "Deserializing connection..." \ |
| 2902 | -S "Deserializing connection..." |
| 2903 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2905 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2906 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2907 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2908 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2909 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2910 | 0 \ |
| 2911 | -c "Deserializing connection..." \ |
| 2912 | -S "Deserializing connection..." |
| 2913 | |
| 2914 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2915 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2916 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2917 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2918 | 0 \ |
| 2919 | -C "Deserializing connection..." \ |
| 2920 | -s "Deserializing connection..." |
| 2921 | |
| 2922 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2923 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2924 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2925 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2926 | 0 \ |
| 2927 | -C "Deserializing connection..." \ |
| 2928 | -s "Deserializing connection..." |
| 2929 | |
| 2930 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2931 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2932 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2933 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2934 | 0 \ |
| 2935 | -C "Deserializing connection..." \ |
| 2936 | -s "Deserializing connection..." |
| 2937 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2938 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2939 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2940 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2941 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2942 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2943 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2944 | 0 \ |
| 2945 | -C "Deserializing connection..." \ |
| 2946 | -s "Deserializing connection..." |
| 2947 | |
| 2948 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2949 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2950 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2951 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2952 | 0 \ |
| 2953 | -c "Deserializing connection..." \ |
| 2954 | -s "Deserializing connection..." |
| 2955 | |
| 2956 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2957 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2958 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2959 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2960 | 0 \ |
| 2961 | -c "Deserializing connection..." \ |
| 2962 | -s "Deserializing connection..." |
| 2963 | |
| 2964 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2965 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2966 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2967 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2968 | 0 \ |
| 2969 | -c "Deserializing connection..." \ |
| 2970 | -s "Deserializing connection..." |
| 2971 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2972 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2973 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2974 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2975 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2976 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2977 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2978 | 0 \ |
| 2979 | -c "Deserializing connection..." \ |
| 2980 | -s "Deserializing connection..." |
| 2981 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2983 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2984 | run_test "Saving the serialized context to a file" \ |
| 2985 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2986 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2987 | 0 \ |
| 2988 | -s "Save serialized context to a file... ok" \ |
| 2989 | -c "Save serialized context to a file... ok" |
| 2990 | rm -f context_srv.txt |
| 2991 | rm -f context_cli.txt |
| 2992 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2993 | # Tests for DTLS Connection ID extension |
| 2994 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2995 | # So far, the CID API isn't implemented, so we can't |
| 2996 | # grep for output witnessing its use. This needs to be |
| 2997 | # changed once the CID extension is implemented. |
| 2998 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2999 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3000 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3001 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3002 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 3003 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3004 | 0 \ |
| 3005 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3006 | -s "found CID extension" \ |
| 3007 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3008 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3009 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3010 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3011 | -C "found CID extension" \ |
| 3012 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3013 | -C "Copy CIDs into SSL transform" \ |
| 3014 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3015 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3017 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3018 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3019 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3020 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 3021 | 0 \ |
| 3022 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3023 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3024 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3025 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3026 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3027 | -C "found CID extension" \ |
| 3028 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3029 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 3030 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3031 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3032 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3033 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3034 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3035 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3036 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 3037 | 0 \ |
| 3038 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3039 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3040 | -c "client hello, adding CID extension" \ |
| 3041 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3042 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3043 | -s "server hello, adding CID extension" \ |
| 3044 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3045 | -c "Use of CID extension negotiated" \ |
| 3046 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3047 | -c "Copy CIDs into SSL transform" \ |
| 3048 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3049 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3050 | -s "Use of Connection ID has been negotiated" \ |
| 3051 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3052 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3053 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3054 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3055 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3056 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3057 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 3058 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 3059 | 0 \ |
| 3060 | -c "Enable use of CID extension." \ |
| 3061 | -s "Enable use of CID extension." \ |
| 3062 | -c "client hello, adding CID extension" \ |
| 3063 | -s "found CID extension" \ |
| 3064 | -s "Use of CID extension negotiated" \ |
| 3065 | -s "server hello, adding CID extension" \ |
| 3066 | -c "found CID extension" \ |
| 3067 | -c "Use of CID extension negotiated" \ |
| 3068 | -s "Copy CIDs into SSL transform" \ |
| 3069 | -c "Copy CIDs into SSL transform" \ |
| 3070 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3071 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3072 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3073 | -c "Use of Connection ID has been negotiated" \ |
| 3074 | -c "ignoring unexpected CID" \ |
| 3075 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3076 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3077 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3078 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3079 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 3080 | -p "$P_PXY mtu=800" \ |
| 3081 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3082 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3083 | 0 \ |
| 3084 | -c "Enable use of CID extension." \ |
| 3085 | -s "Enable use of CID extension." \ |
| 3086 | -c "client hello, adding CID extension" \ |
| 3087 | -s "found CID extension" \ |
| 3088 | -s "Use of CID extension negotiated" \ |
| 3089 | -s "server hello, adding CID extension" \ |
| 3090 | -c "found CID extension" \ |
| 3091 | -c "Use of CID extension negotiated" \ |
| 3092 | -s "Copy CIDs into SSL transform" \ |
| 3093 | -c "Copy CIDs into SSL transform" \ |
| 3094 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3095 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3096 | -s "Use of Connection ID has been negotiated" \ |
| 3097 | -c "Use of Connection ID has been negotiated" |
| 3098 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3099 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3100 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3101 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3102 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3103 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3104 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3105 | 0 \ |
| 3106 | -c "Enable use of CID extension." \ |
| 3107 | -s "Enable use of CID extension." \ |
| 3108 | -c "client hello, adding CID extension" \ |
| 3109 | -s "found CID extension" \ |
| 3110 | -s "Use of CID extension negotiated" \ |
| 3111 | -s "server hello, adding CID extension" \ |
| 3112 | -c "found CID extension" \ |
| 3113 | -c "Use of CID extension negotiated" \ |
| 3114 | -s "Copy CIDs into SSL transform" \ |
| 3115 | -c "Copy CIDs into SSL transform" \ |
| 3116 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3117 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3118 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3119 | -c "Use of Connection ID has been negotiated" \ |
| 3120 | -c "ignoring unexpected CID" \ |
| 3121 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3122 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3123 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3124 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3125 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3126 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3127 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3128 | 0 \ |
| 3129 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3130 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3131 | -c "client hello, adding CID extension" \ |
| 3132 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3133 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3134 | -s "server hello, adding CID extension" \ |
| 3135 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3136 | -c "Use of CID extension negotiated" \ |
| 3137 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3138 | -c "Copy CIDs into SSL transform" \ |
| 3139 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3140 | -s "Peer CID (length 0 Bytes):" \ |
| 3141 | -s "Use of Connection ID has been negotiated" \ |
| 3142 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3143 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3144 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3145 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3146 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3147 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3148 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3149 | 0 \ |
| 3150 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3151 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3152 | -c "client hello, adding CID extension" \ |
| 3153 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3154 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3155 | -s "server hello, adding CID extension" \ |
| 3156 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3157 | -c "Use of CID extension negotiated" \ |
| 3158 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3159 | -c "Copy CIDs into SSL transform" \ |
| 3160 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3161 | -c "Peer CID (length 0 Bytes):" \ |
| 3162 | -s "Use of Connection ID has been negotiated" \ |
| 3163 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3164 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3165 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3166 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3167 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3168 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3169 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3170 | 0 \ |
| 3171 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3172 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3173 | -c "client hello, adding CID extension" \ |
| 3174 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3175 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3176 | -s "server hello, adding CID extension" \ |
| 3177 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3178 | -c "Use of CID extension negotiated" \ |
| 3179 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3180 | -c "Copy CIDs into SSL transform" \ |
| 3181 | -S "Use of Connection ID has been negotiated" \ |
| 3182 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3183 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3184 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3185 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3186 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3187 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3188 | 0 \ |
| 3189 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3190 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3191 | -c "client hello, adding CID extension" \ |
| 3192 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3193 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3194 | -s "server hello, adding CID extension" \ |
| 3195 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3196 | -c "Use of CID extension negotiated" \ |
| 3197 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3198 | -c "Copy CIDs into SSL transform" \ |
| 3199 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3200 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3201 | -s "Use of Connection ID has been negotiated" \ |
| 3202 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3203 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3204 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3205 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3206 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3207 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3208 | 0 \ |
| 3209 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3210 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3211 | -c "client hello, adding CID extension" \ |
| 3212 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3213 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3214 | -s "server hello, adding CID extension" \ |
| 3215 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3216 | -c "Use of CID extension negotiated" \ |
| 3217 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3218 | -c "Copy CIDs into SSL transform" \ |
| 3219 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3220 | -s "Peer CID (length 0 Bytes):" \ |
| 3221 | -s "Use of Connection ID has been negotiated" \ |
| 3222 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3223 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3224 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3225 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3226 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3227 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3228 | 0 \ |
| 3229 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3230 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3231 | -c "client hello, adding CID extension" \ |
| 3232 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3233 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3234 | -s "server hello, adding CID extension" \ |
| 3235 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3236 | -c "Use of CID extension negotiated" \ |
| 3237 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3238 | -c "Copy CIDs into SSL transform" \ |
| 3239 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3240 | -c "Peer CID (length 0 Bytes):" \ |
| 3241 | -s "Use of Connection ID has been negotiated" \ |
| 3242 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3243 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3244 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3245 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CCM-8" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3246 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3247 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3248 | 0 \ |
| 3249 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3250 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3251 | -c "client hello, adding CID extension" \ |
| 3252 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3253 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3254 | -s "server hello, adding CID extension" \ |
| 3255 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3256 | -c "Use of CID extension negotiated" \ |
| 3257 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3258 | -c "Copy CIDs into SSL transform" \ |
| 3259 | -S "Use of Connection ID has been negotiated" \ |
| 3260 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3261 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3262 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3263 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3264 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3265 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3266 | 0 \ |
| 3267 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3268 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3269 | -c "client hello, adding CID extension" \ |
| 3270 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3271 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3272 | -s "server hello, adding CID extension" \ |
| 3273 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3274 | -c "Use of CID extension negotiated" \ |
| 3275 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3276 | -c "Copy CIDs into SSL transform" \ |
| 3277 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3278 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3279 | -s "Use of Connection ID has been negotiated" \ |
| 3280 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3281 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3282 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3283 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3284 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3285 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3286 | 0 \ |
| 3287 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3288 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3289 | -c "client hello, adding CID extension" \ |
| 3290 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3291 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3292 | -s "server hello, adding CID extension" \ |
| 3293 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3294 | -c "Use of CID extension negotiated" \ |
| 3295 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3296 | -c "Copy CIDs into SSL transform" \ |
| 3297 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3298 | -s "Peer CID (length 0 Bytes):" \ |
| 3299 | -s "Use of Connection ID has been negotiated" \ |
| 3300 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3301 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3302 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3303 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3304 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3305 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3306 | 0 \ |
| 3307 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3308 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3309 | -c "client hello, adding CID extension" \ |
| 3310 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3311 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3312 | -s "server hello, adding CID extension" \ |
| 3313 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3314 | -c "Use of CID extension negotiated" \ |
| 3315 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3316 | -c "Copy CIDs into SSL transform" \ |
| 3317 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3318 | -c "Peer CID (length 0 Bytes):" \ |
| 3319 | -s "Use of Connection ID has been negotiated" \ |
| 3320 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3321 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3322 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3323 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3324 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3325 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3326 | 0 \ |
| 3327 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3328 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3329 | -c "client hello, adding CID extension" \ |
| 3330 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3331 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3332 | -s "server hello, adding CID extension" \ |
| 3333 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3334 | -c "Use of CID extension negotiated" \ |
| 3335 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3336 | -c "Copy CIDs into SSL transform" \ |
| 3337 | -S "Use of Connection ID has been negotiated" \ |
| 3338 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3339 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3340 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3341 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3342 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3343 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3344 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3345 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3346 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3347 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3348 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3349 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3350 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3351 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3352 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3353 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3354 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3355 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3356 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3357 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3358 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3359 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3360 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3361 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3362 | 0 \ |
| 3363 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3364 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3365 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3366 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3367 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3368 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3369 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3370 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3371 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3372 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3373 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3374 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3375 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3376 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3377 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3378 | 0 \ |
| 3379 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3380 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3381 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3382 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3383 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3384 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3385 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3386 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3387 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3388 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3389 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3390 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3391 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3392 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3393 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3394 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3395 | 0 \ |
| 3396 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3397 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3398 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3399 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3400 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3401 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3402 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3403 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3404 | -c "ignoring unexpected CID" \ |
| 3405 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3406 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3407 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3408 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3409 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3410 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3411 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3412 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3413 | 0 \ |
| 3414 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3415 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3416 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3417 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3418 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3419 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3420 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3421 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3422 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3423 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3424 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3425 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3426 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3427 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3428 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3429 | 0 \ |
| 3430 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3431 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3432 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3433 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3434 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3435 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3436 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3437 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3438 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3439 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3440 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3441 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3442 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3443 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3444 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3445 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3446 | 0 \ |
| 3447 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3448 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3449 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3450 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3451 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3452 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3453 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3454 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3455 | -c "ignoring unexpected CID" \ |
| 3456 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3457 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3458 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3459 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3460 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3461 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3462 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3463 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3464 | 0 \ |
| 3465 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3466 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3467 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3468 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3469 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3470 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3471 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3472 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3473 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3474 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3475 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3476 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3477 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3478 | 0 \ |
| 3479 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3480 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3481 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3482 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3483 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3484 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3485 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3486 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3487 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3488 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3489 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3490 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3491 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3492 | "$P_CLI debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3493 | 0 \ |
| 3494 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3495 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3496 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3497 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3498 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3499 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3500 | -c "ignoring unexpected CID" \ |
| 3501 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3502 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3503 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3504 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3505 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3506 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3507 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3508 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3509 | 0 \ |
| 3510 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3511 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3512 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3513 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3514 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3515 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3516 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3517 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3518 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3519 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3520 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3521 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3522 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3523 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3524 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3525 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3526 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3527 | 0 \ |
| 3528 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3529 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3530 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3531 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3532 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3533 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3534 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3535 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3536 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3537 | -c "ignoring unexpected CID" \ |
| 3538 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3539 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3540 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3541 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3542 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3543 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3544 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3545 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3546 | 0 \ |
| 3547 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3548 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3549 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3550 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3551 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3552 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3553 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3554 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3555 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3556 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3558 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3559 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3560 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3561 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3562 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3563 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3564 | 0 \ |
| 3565 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3566 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3567 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3568 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3569 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3570 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3571 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3572 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3573 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3574 | -c "ignoring unexpected CID" \ |
| 3575 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3576 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3577 | # This and the test below it require MAX_CONTENT_LEN to be at least MFL+1, because the |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3578 | # tests check that the buffer contents are reallocated when the message is |
| 3579 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3580 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3581 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3582 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3583 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3584 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3585 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3586 | 0 \ |
| 3587 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3588 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3589 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3590 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3591 | -s "Reallocating in_buf" \ |
| 3592 | -s "Reallocating out_buf" |
| 3593 | |
| 3594 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3595 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3596 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3597 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3598 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3599 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3600 | 0 \ |
| 3601 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3602 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3603 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3604 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3605 | -s "Reallocating in_buf" \ |
| 3606 | -s "Reallocating out_buf" |
| 3607 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3608 | # Tests for Encrypt-then-MAC extension |
| 3609 | |
| 3610 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3611 | "$P_SRV debug_level=3 \ |
| 3612 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3613 | "$P_CLI debug_level=3" \ |
| 3614 | 0 \ |
| 3615 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3616 | -s "found encrypt then mac extension" \ |
| 3617 | -s "server hello, adding encrypt then mac extension" \ |
| 3618 | -c "found encrypt_then_mac extension" \ |
| 3619 | -c "using encrypt then mac" \ |
| 3620 | -s "using encrypt then mac" |
| 3621 | |
| 3622 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3623 | "$P_SRV debug_level=3 etm=0 \ |
| 3624 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3625 | "$P_CLI debug_level=3 etm=1" \ |
| 3626 | 0 \ |
| 3627 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3628 | -s "found encrypt then mac extension" \ |
| 3629 | -S "server hello, adding encrypt then mac extension" \ |
| 3630 | -C "found encrypt_then_mac extension" \ |
| 3631 | -C "using encrypt then mac" \ |
| 3632 | -S "using encrypt then mac" |
| 3633 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3634 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3635 | "$P_SRV debug_level=3 etm=1 \ |
| 3636 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3637 | "$P_CLI debug_level=3 etm=1" \ |
| 3638 | 0 \ |
| 3639 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3640 | -s "found encrypt then mac extension" \ |
| 3641 | -S "server hello, adding encrypt then mac extension" \ |
| 3642 | -C "found encrypt_then_mac extension" \ |
| 3643 | -C "using encrypt then mac" \ |
| 3644 | -S "using encrypt then mac" |
| 3645 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3646 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3647 | "$P_SRV debug_level=3 etm=1 \ |
| 3648 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3649 | "$P_CLI debug_level=3 etm=0" \ |
| 3650 | 0 \ |
| 3651 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3652 | -S "found encrypt then mac extension" \ |
| 3653 | -S "server hello, adding encrypt then mac extension" \ |
| 3654 | -C "found encrypt_then_mac extension" \ |
| 3655 | -C "using encrypt then mac" \ |
| 3656 | -S "using encrypt then mac" |
| 3657 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3658 | # Tests for Extended Master Secret extension |
| 3659 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3660 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3661 | run_test "Extended Master Secret: default" \ |
| 3662 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3663 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3664 | 0 \ |
| 3665 | -c "client hello, adding extended_master_secret extension" \ |
| 3666 | -s "found extended master secret extension" \ |
| 3667 | -s "server hello, adding extended master secret extension" \ |
| 3668 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3669 | -c "session hash for extended master secret" \ |
| 3670 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3671 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3672 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3673 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3674 | "$P_SRV debug_level=3 extended_ms=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3675 | "$P_CLI force_version=tls12 debug_level=3 extended_ms=1" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3676 | 0 \ |
| 3677 | -c "client hello, adding extended_master_secret extension" \ |
| 3678 | -s "found extended master secret extension" \ |
| 3679 | -S "server hello, adding extended master secret extension" \ |
| 3680 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3681 | -C "session hash for extended master secret" \ |
| 3682 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3683 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3684 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3685 | run_test "Extended Master Secret: client disabled, server enabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3686 | "$P_SRV force_version=tls12 debug_level=3 extended_ms=1" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3687 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3688 | 0 \ |
| 3689 | -C "client hello, adding extended_master_secret extension" \ |
| 3690 | -S "found extended master secret extension" \ |
| 3691 | -S "server hello, adding extended master secret extension" \ |
| 3692 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3693 | -C "session hash for extended master secret" \ |
| 3694 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3695 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3696 | # Test sending and receiving empty application data records |
| 3697 | |
| 3698 | run_test "Encrypt then MAC: empty application data record" \ |
| 3699 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3700 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3701 | 0 \ |
| 3702 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3703 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3704 | -c "0 bytes written in 1 fragments" |
| 3705 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3707 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3708 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3709 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3710 | 0 \ |
| 3711 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3712 | -c "0 bytes written in 1 fragments" |
| 3713 | |
| 3714 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3715 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3716 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3717 | 0 \ |
| 3718 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3719 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3720 | -c "0 bytes written in 1 fragments" |
| 3721 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3722 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3723 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3724 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3725 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3726 | 0 \ |
| 3727 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3728 | -c "0 bytes written in 1 fragments" |
| 3729 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3730 | # Tests for CBC 1/n-1 record splitting |
| 3731 | |
| 3732 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3733 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3734 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3735 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3736 | 0 \ |
| 3737 | -s "Read from client: 123 bytes read" \ |
| 3738 | -S "Read from client: 1 bytes read" \ |
| 3739 | -S "122 bytes read" |
| 3740 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3741 | # Tests for Session Tickets |
| 3742 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3743 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3744 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3745 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3746 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3747 | -c "client hello, adding session ticket extension" \ |
| 3748 | -s "found session ticket extension" \ |
| 3749 | -s "server hello, adding session ticket extension" \ |
| 3750 | -c "found session_ticket extension" \ |
| 3751 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3752 | -S "session successfully restored from cache" \ |
| 3753 | -s "session successfully restored from ticket" \ |
| 3754 | -s "a session has been resumed" \ |
| 3755 | -c "a session has been resumed" |
| 3756 | |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3757 | run_test "Session resume using tickets: manual rotation" \ |
| 3758 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3759 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3760 | 0 \ |
| 3761 | -c "client hello, adding session ticket extension" \ |
| 3762 | -s "found session ticket extension" \ |
| 3763 | -s "server hello, adding session ticket extension" \ |
| 3764 | -c "found session_ticket extension" \ |
| 3765 | -c "parse new session ticket" \ |
| 3766 | -S "session successfully restored from cache" \ |
| 3767 | -s "session successfully restored from ticket" \ |
| 3768 | -s "a session has been resumed" \ |
| 3769 | -c "a session has been resumed" |
| 3770 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3771 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3772 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3773 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3774 | 0 \ |
| 3775 | -c "client hello, adding session ticket extension" \ |
| 3776 | -s "found session ticket extension" \ |
| 3777 | -s "server hello, adding session ticket extension" \ |
| 3778 | -c "found session_ticket extension" \ |
| 3779 | -c "parse new session ticket" \ |
| 3780 | -S "session successfully restored from cache" \ |
| 3781 | -s "session successfully restored from ticket" \ |
| 3782 | -s "a session has been resumed" \ |
| 3783 | -c "a session has been resumed" |
| 3784 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3785 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3786 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3787 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1 reco_delay=2000" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3788 | 0 \ |
| 3789 | -c "client hello, adding session ticket extension" \ |
| 3790 | -s "found session ticket extension" \ |
| 3791 | -s "server hello, adding session ticket extension" \ |
| 3792 | -c "found session_ticket extension" \ |
| 3793 | -c "parse new session ticket" \ |
| 3794 | -S "session successfully restored from cache" \ |
| 3795 | -S "session successfully restored from ticket" \ |
| 3796 | -S "a session has been resumed" \ |
| 3797 | -C "a session has been resumed" |
| 3798 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3799 | run_test "Session resume using tickets: session copy" \ |
| 3800 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3801 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3802 | 0 \ |
| 3803 | -c "client hello, adding session ticket extension" \ |
| 3804 | -s "found session ticket extension" \ |
| 3805 | -s "server hello, adding session ticket extension" \ |
| 3806 | -c "found session_ticket extension" \ |
| 3807 | -c "parse new session ticket" \ |
| 3808 | -S "session successfully restored from cache" \ |
| 3809 | -s "session successfully restored from ticket" \ |
| 3810 | -s "a session has been resumed" \ |
| 3811 | -c "a session has been resumed" |
| 3812 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3813 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3814 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3815 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3816 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3817 | 0 \ |
| 3818 | -c "client hello, adding session ticket extension" \ |
| 3819 | -c "found session_ticket extension" \ |
| 3820 | -c "parse new session ticket" \ |
| 3821 | -c "a session has been resumed" |
| 3822 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3823 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3824 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3825 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3826 | "( $O_CLI -sess_out $SESSION; \ |
| 3827 | $O_CLI -sess_in $SESSION; \ |
| 3828 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3829 | 0 \ |
| 3830 | -s "found session ticket extension" \ |
| 3831 | -s "server hello, adding session ticket extension" \ |
| 3832 | -S "session successfully restored from cache" \ |
| 3833 | -s "session successfully restored from ticket" \ |
| 3834 | -s "a session has been resumed" |
| 3835 | |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3836 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3837 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3838 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3839 | 0 \ |
| 3840 | -c "client hello, adding session ticket extension" \ |
| 3841 | -s "found session ticket extension" \ |
| 3842 | -s "server hello, adding session ticket extension" \ |
| 3843 | -c "found session_ticket extension" \ |
| 3844 | -c "parse new session ticket" \ |
| 3845 | -S "session successfully restored from cache" \ |
| 3846 | -s "session successfully restored from ticket" \ |
| 3847 | -s "a session has been resumed" \ |
| 3848 | -c "a session has been resumed" |
| 3849 | |
| 3850 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3851 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3852 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3853 | 0 \ |
| 3854 | -c "client hello, adding session ticket extension" \ |
| 3855 | -s "found session ticket extension" \ |
| 3856 | -s "server hello, adding session ticket extension" \ |
| 3857 | -c "found session_ticket extension" \ |
| 3858 | -c "parse new session ticket" \ |
| 3859 | -S "session successfully restored from cache" \ |
| 3860 | -s "session successfully restored from ticket" \ |
| 3861 | -s "a session has been resumed" \ |
| 3862 | -c "a session has been resumed" |
| 3863 | |
| 3864 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3865 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3866 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3867 | 0 \ |
| 3868 | -c "client hello, adding session ticket extension" \ |
| 3869 | -s "found session ticket extension" \ |
| 3870 | -s "server hello, adding session ticket extension" \ |
| 3871 | -c "found session_ticket extension" \ |
| 3872 | -c "parse new session ticket" \ |
| 3873 | -S "session successfully restored from cache" \ |
| 3874 | -s "session successfully restored from ticket" \ |
| 3875 | -s "a session has been resumed" \ |
| 3876 | -c "a session has been resumed" |
| 3877 | |
| 3878 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3879 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3880 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3881 | 0 \ |
| 3882 | -c "client hello, adding session ticket extension" \ |
| 3883 | -s "found session ticket extension" \ |
| 3884 | -s "server hello, adding session ticket extension" \ |
| 3885 | -c "found session_ticket extension" \ |
| 3886 | -c "parse new session ticket" \ |
| 3887 | -S "session successfully restored from cache" \ |
| 3888 | -s "session successfully restored from ticket" \ |
| 3889 | -s "a session has been resumed" \ |
| 3890 | -c "a session has been resumed" |
| 3891 | |
| 3892 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3893 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3894 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3895 | 0 \ |
| 3896 | -c "client hello, adding session ticket extension" \ |
| 3897 | -s "found session ticket extension" \ |
| 3898 | -s "server hello, adding session ticket extension" \ |
| 3899 | -c "found session_ticket extension" \ |
| 3900 | -c "parse new session ticket" \ |
| 3901 | -S "session successfully restored from cache" \ |
| 3902 | -s "session successfully restored from ticket" \ |
| 3903 | -s "a session has been resumed" \ |
| 3904 | -c "a session has been resumed" |
| 3905 | |
| 3906 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3907 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3908 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3909 | 0 \ |
| 3910 | -c "client hello, adding session ticket extension" \ |
| 3911 | -s "found session ticket extension" \ |
| 3912 | -s "server hello, adding session ticket extension" \ |
| 3913 | -c "found session_ticket extension" \ |
| 3914 | -c "parse new session ticket" \ |
| 3915 | -S "session successfully restored from cache" \ |
| 3916 | -s "session successfully restored from ticket" \ |
| 3917 | -s "a session has been resumed" \ |
| 3918 | -c "a session has been resumed" |
| 3919 | |
| 3920 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3921 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3922 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3923 | 0 \ |
| 3924 | -c "client hello, adding session ticket extension" \ |
| 3925 | -s "found session ticket extension" \ |
| 3926 | -s "server hello, adding session ticket extension" \ |
| 3927 | -c "found session_ticket extension" \ |
| 3928 | -c "parse new session ticket" \ |
| 3929 | -S "session successfully restored from cache" \ |
| 3930 | -s "session successfully restored from ticket" \ |
| 3931 | -s "a session has been resumed" \ |
| 3932 | -c "a session has been resumed" |
| 3933 | |
| 3934 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 3935 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3936 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3937 | 0 \ |
| 3938 | -c "client hello, adding session ticket extension" \ |
| 3939 | -s "found session ticket extension" \ |
| 3940 | -s "server hello, adding session ticket extension" \ |
| 3941 | -c "found session_ticket extension" \ |
| 3942 | -c "parse new session ticket" \ |
| 3943 | -S "session successfully restored from cache" \ |
| 3944 | -s "session successfully restored from ticket" \ |
| 3945 | -s "a session has been resumed" \ |
| 3946 | -c "a session has been resumed" |
| 3947 | |
| 3948 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 3949 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3950 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3951 | 0 \ |
| 3952 | -c "client hello, adding session ticket extension" \ |
| 3953 | -s "found session ticket extension" \ |
| 3954 | -s "server hello, adding session ticket extension" \ |
| 3955 | -c "found session_ticket extension" \ |
| 3956 | -c "parse new session ticket" \ |
| 3957 | -S "session successfully restored from cache" \ |
| 3958 | -s "session successfully restored from ticket" \ |
| 3959 | -s "a session has been resumed" \ |
| 3960 | -c "a session has been resumed" |
| 3961 | |
| 3962 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 3963 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3964 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3965 | 0 \ |
| 3966 | -c "client hello, adding session ticket extension" \ |
| 3967 | -s "found session ticket extension" \ |
| 3968 | -s "server hello, adding session ticket extension" \ |
| 3969 | -c "found session_ticket extension" \ |
| 3970 | -c "parse new session ticket" \ |
| 3971 | -S "session successfully restored from cache" \ |
| 3972 | -s "session successfully restored from ticket" \ |
| 3973 | -s "a session has been resumed" \ |
| 3974 | -c "a session has been resumed" |
| 3975 | |
| 3976 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 3977 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3978 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3979 | 0 \ |
| 3980 | -c "client hello, adding session ticket extension" \ |
| 3981 | -s "found session ticket extension" \ |
| 3982 | -s "server hello, adding session ticket extension" \ |
| 3983 | -c "found session_ticket extension" \ |
| 3984 | -c "parse new session ticket" \ |
| 3985 | -S "session successfully restored from cache" \ |
| 3986 | -s "session successfully restored from ticket" \ |
| 3987 | -s "a session has been resumed" \ |
| 3988 | -c "a session has been resumed" |
| 3989 | |
| 3990 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 3991 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3992 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3993 | 0 \ |
| 3994 | -c "client hello, adding session ticket extension" \ |
| 3995 | -s "found session ticket extension" \ |
| 3996 | -s "server hello, adding session ticket extension" \ |
| 3997 | -c "found session_ticket extension" \ |
| 3998 | -c "parse new session ticket" \ |
| 3999 | -S "session successfully restored from cache" \ |
| 4000 | -s "session successfully restored from ticket" \ |
| 4001 | -s "a session has been resumed" \ |
| 4002 | -c "a session has been resumed" |
| 4003 | |
| 4004 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 4005 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4006 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4007 | 0 \ |
| 4008 | -c "client hello, adding session ticket extension" \ |
| 4009 | -s "found session ticket extension" \ |
| 4010 | -s "server hello, adding session ticket extension" \ |
| 4011 | -c "found session_ticket extension" \ |
| 4012 | -c "parse new session ticket" \ |
| 4013 | -S "session successfully restored from cache" \ |
| 4014 | -s "session successfully restored from ticket" \ |
| 4015 | -s "a session has been resumed" \ |
| 4016 | -c "a session has been resumed" |
| 4017 | |
| 4018 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 4019 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4020 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4021 | 0 \ |
| 4022 | -c "client hello, adding session ticket extension" \ |
| 4023 | -s "found session ticket extension" \ |
| 4024 | -s "server hello, adding session ticket extension" \ |
| 4025 | -c "found session_ticket extension" \ |
| 4026 | -c "parse new session ticket" \ |
| 4027 | -S "session successfully restored from cache" \ |
| 4028 | -s "session successfully restored from ticket" \ |
| 4029 | -s "a session has been resumed" \ |
| 4030 | -c "a session has been resumed" |
| 4031 | |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4032 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 4033 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4034 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4035 | 0 \ |
| 4036 | -c "client hello, adding session ticket extension" \ |
| 4037 | -s "found session ticket extension" \ |
| 4038 | -s "server hello, adding session ticket extension" \ |
| 4039 | -c "found session_ticket extension" \ |
| 4040 | -c "parse new session ticket" \ |
| 4041 | -S "session successfully restored from cache" \ |
| 4042 | -s "session successfully restored from ticket" \ |
| 4043 | -s "a session has been resumed" \ |
| 4044 | -c "a session has been resumed" |
| 4045 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4046 | # Tests for Session Tickets with DTLS |
| 4047 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4048 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4049 | run_test "Session resume using tickets, DTLS: basic" \ |
| 4050 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4051 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4052 | 0 \ |
| 4053 | -c "client hello, adding session ticket extension" \ |
| 4054 | -s "found session ticket extension" \ |
| 4055 | -s "server hello, adding session ticket extension" \ |
| 4056 | -c "found session_ticket extension" \ |
| 4057 | -c "parse new session ticket" \ |
| 4058 | -S "session successfully restored from cache" \ |
| 4059 | -s "session successfully restored from ticket" \ |
| 4060 | -s "a session has been resumed" \ |
| 4061 | -c "a session has been resumed" |
| 4062 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4063 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4064 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 4065 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4066 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4067 | 0 \ |
| 4068 | -c "client hello, adding session ticket extension" \ |
| 4069 | -s "found session ticket extension" \ |
| 4070 | -s "server hello, adding session ticket extension" \ |
| 4071 | -c "found session_ticket extension" \ |
| 4072 | -c "parse new session ticket" \ |
| 4073 | -S "session successfully restored from cache" \ |
| 4074 | -s "session successfully restored from ticket" \ |
| 4075 | -s "a session has been resumed" \ |
| 4076 | -c "a session has been resumed" |
| 4077 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4078 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4079 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 4080 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4081 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1 reco_delay=2000" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4082 | 0 \ |
| 4083 | -c "client hello, adding session ticket extension" \ |
| 4084 | -s "found session ticket extension" \ |
| 4085 | -s "server hello, adding session ticket extension" \ |
| 4086 | -c "found session_ticket extension" \ |
| 4087 | -c "parse new session ticket" \ |
| 4088 | -S "session successfully restored from cache" \ |
| 4089 | -S "session successfully restored from ticket" \ |
| 4090 | -S "a session has been resumed" \ |
| 4091 | -C "a session has been resumed" |
| 4092 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4093 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4094 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 4095 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4096 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1 reco_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4097 | 0 \ |
| 4098 | -c "client hello, adding session ticket extension" \ |
| 4099 | -s "found session ticket extension" \ |
| 4100 | -s "server hello, adding session ticket extension" \ |
| 4101 | -c "found session_ticket extension" \ |
| 4102 | -c "parse new session ticket" \ |
| 4103 | -S "session successfully restored from cache" \ |
| 4104 | -s "session successfully restored from ticket" \ |
| 4105 | -s "a session has been resumed" \ |
| 4106 | -c "a session has been resumed" |
| 4107 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4108 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4109 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 4110 | "$O_SRV -dtls" \ |
| 4111 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 4112 | 0 \ |
| 4113 | -c "client hello, adding session ticket extension" \ |
| 4114 | -c "found session_ticket extension" \ |
| 4115 | -c "parse new session ticket" \ |
| 4116 | -c "a session has been resumed" |
| 4117 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4118 | # For reasons that aren't fully understood, this test randomly fails with high |
Paul Elliott | 09cfa18 | 2021-10-13 16:13:44 +0100 | [diff] [blame] | 4119 | # probability with OpenSSL 1.0.2g on the CI, see #5012. |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4120 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4121 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4122 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 4123 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4124 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4125 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4126 | rm -f $SESSION )" \ |
| 4127 | 0 \ |
| 4128 | -s "found session ticket extension" \ |
| 4129 | -s "server hello, adding session ticket extension" \ |
| 4130 | -S "session successfully restored from cache" \ |
| 4131 | -s "session successfully restored from ticket" \ |
| 4132 | -s "a session has been resumed" |
| 4133 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4134 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4135 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4136 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4137 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4138 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4139 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4140 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4141 | -c "client hello, adding session ticket extension" \ |
| 4142 | -s "found session ticket extension" \ |
| 4143 | -S "server hello, adding session ticket extension" \ |
| 4144 | -C "found session_ticket extension" \ |
| 4145 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4146 | -s "session successfully restored from cache" \ |
| 4147 | -S "session successfully restored from ticket" \ |
| 4148 | -s "a session has been resumed" \ |
| 4149 | -c "a session has been resumed" |
| 4150 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4151 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4152 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4153 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4154 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4155 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4156 | -C "client hello, adding session ticket extension" \ |
| 4157 | -S "found session ticket extension" \ |
| 4158 | -S "server hello, adding session ticket extension" \ |
| 4159 | -C "found session_ticket extension" \ |
| 4160 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4161 | -s "session successfully restored from cache" \ |
| 4162 | -S "session successfully restored from ticket" \ |
| 4163 | -s "a session has been resumed" \ |
| 4164 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4165 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4166 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4167 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4168 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4169 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4170 | 0 \ |
| 4171 | -S "session successfully restored from cache" \ |
| 4172 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4173 | -S "a session has been resumed" \ |
| 4174 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4175 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4176 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4177 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4178 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4179 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4180 | 0 \ |
| 4181 | -s "session successfully restored from cache" \ |
| 4182 | -S "session successfully restored from ticket" \ |
| 4183 | -s "a session has been resumed" \ |
| 4184 | -c "a session has been resumed" |
| 4185 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4186 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4187 | run_test "Session resume using cache: cache removed" \ |
| 4188 | "$P_SRV debug_level=3 tickets=0 cache_remove=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4189 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4190 | 0 \ |
| 4191 | -C "client hello, adding session ticket extension" \ |
| 4192 | -S "found session ticket extension" \ |
| 4193 | -S "server hello, adding session ticket extension" \ |
| 4194 | -C "found session_ticket extension" \ |
| 4195 | -C "parse new session ticket" \ |
| 4196 | -S "session successfully restored from cache" \ |
| 4197 | -S "session successfully restored from ticket" \ |
| 4198 | -S "a session has been resumed" \ |
| 4199 | -C "a session has been resumed" |
| 4200 | |
| 4201 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4202 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 4203 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4204 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4205 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_delay=0" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4206 | 0 \ |
| 4207 | -s "session successfully restored from cache" \ |
| 4208 | -S "session successfully restored from ticket" \ |
| 4209 | -s "a session has been resumed" \ |
| 4210 | -c "a session has been resumed" |
| 4211 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4212 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4213 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4214 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4215 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_delay=2000" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4216 | 0 \ |
| 4217 | -S "session successfully restored from cache" \ |
| 4218 | -S "session successfully restored from ticket" \ |
| 4219 | -S "a session has been resumed" \ |
| 4220 | -C "a session has been resumed" |
| 4221 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4222 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4223 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4224 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4225 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_delay=2000" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4226 | 0 \ |
| 4227 | -s "session successfully restored from cache" \ |
| 4228 | -S "session successfully restored from ticket" \ |
| 4229 | -s "a session has been resumed" \ |
| 4230 | -c "a session has been resumed" |
| 4231 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4232 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4233 | run_test "Session resume using cache: session copy" \ |
| 4234 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4235 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4236 | 0 \ |
| 4237 | -s "session successfully restored from cache" \ |
| 4238 | -S "session successfully restored from ticket" \ |
| 4239 | -s "a session has been resumed" \ |
| 4240 | -c "a session has been resumed" |
| 4241 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4242 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4243 | run_test "Session resume using cache: openssl client" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4244 | "$P_SRV force_version=tls12 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4245 | "( $O_CLI -sess_out $SESSION; \ |
| 4246 | $O_CLI -sess_in $SESSION; \ |
| 4247 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4248 | 0 \ |
| 4249 | -s "found session ticket extension" \ |
| 4250 | -S "server hello, adding session ticket extension" \ |
| 4251 | -s "session successfully restored from cache" \ |
| 4252 | -S "session successfully restored from ticket" \ |
| 4253 | -s "a session has been resumed" |
| 4254 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4255 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4256 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4257 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4258 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4259 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4260 | 0 \ |
| 4261 | -C "found session_ticket extension" \ |
| 4262 | -C "parse new session ticket" \ |
| 4263 | -c "a session has been resumed" |
| 4264 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4265 | # Tests for Session resume and extensions |
| 4266 | |
| 4267 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4268 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4269 | run_test "Session resume and connection ID" \ |
| 4270 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4271 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4272 | 0 \ |
| 4273 | -c "Enable use of CID extension." \ |
| 4274 | -s "Enable use of CID extension." \ |
| 4275 | -c "client hello, adding CID extension" \ |
| 4276 | -s "found CID extension" \ |
| 4277 | -s "Use of CID extension negotiated" \ |
| 4278 | -s "server hello, adding CID extension" \ |
| 4279 | -c "found CID extension" \ |
| 4280 | -c "Use of CID extension negotiated" \ |
| 4281 | -s "Copy CIDs into SSL transform" \ |
| 4282 | -c "Copy CIDs into SSL transform" \ |
| 4283 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4284 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4285 | -s "Use of Connection ID has been negotiated" \ |
| 4286 | -c "Use of Connection ID has been negotiated" |
| 4287 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4288 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 4289 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4291 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4292 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4293 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4294 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4295 | 0 \ |
| 4296 | -c "client hello, adding session ticket extension" \ |
| 4297 | -s "found session ticket extension" \ |
| 4298 | -S "server hello, adding session ticket extension" \ |
| 4299 | -C "found session_ticket extension" \ |
| 4300 | -C "parse new session ticket" \ |
| 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" |
| 4305 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4306 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4307 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4308 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4309 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4310 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4311 | 0 \ |
| 4312 | -C "client hello, adding session ticket extension" \ |
| 4313 | -S "found session ticket extension" \ |
| 4314 | -S "server hello, adding session ticket extension" \ |
| 4315 | -C "found session_ticket extension" \ |
| 4316 | -C "parse new session ticket" \ |
| 4317 | -s "session successfully restored from cache" \ |
| 4318 | -S "session successfully restored from ticket" \ |
| 4319 | -s "a session has been resumed" \ |
| 4320 | -c "a session has been resumed" |
| 4321 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4322 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4323 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4324 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4325 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4326 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4327 | 0 \ |
| 4328 | -S "session successfully restored from cache" \ |
| 4329 | -S "session successfully restored from ticket" \ |
| 4330 | -S "a session has been resumed" \ |
| 4331 | -C "a session has been resumed" |
| 4332 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4333 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4334 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4335 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4336 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4337 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4338 | 0 \ |
| 4339 | -s "session successfully restored from cache" \ |
| 4340 | -S "session successfully restored from ticket" \ |
| 4341 | -s "a session has been resumed" \ |
| 4342 | -c "a session has been resumed" |
| 4343 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4344 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4345 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4346 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4347 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4348 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=0" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4349 | 0 \ |
| 4350 | -s "session successfully restored from cache" \ |
| 4351 | -S "session successfully restored from ticket" \ |
| 4352 | -s "a session has been resumed" \ |
| 4353 | -c "a session has been resumed" |
| 4354 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4355 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4356 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4357 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4358 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4359 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=2000" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4360 | 0 \ |
| 4361 | -S "session successfully restored from cache" \ |
| 4362 | -S "session successfully restored from ticket" \ |
| 4363 | -S "a session has been resumed" \ |
| 4364 | -C "a session has been resumed" |
| 4365 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4366 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4367 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4368 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4369 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4370 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=2000" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4371 | 0 \ |
| 4372 | -s "session successfully restored from cache" \ |
| 4373 | -S "session successfully restored from ticket" \ |
| 4374 | -s "a session has been resumed" \ |
| 4375 | -c "a session has been resumed" |
| 4376 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4377 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4378 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4379 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4380 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4381 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_mode=0" \ |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4382 | 0 \ |
| 4383 | -s "session successfully restored from cache" \ |
| 4384 | -S "session successfully restored from ticket" \ |
| 4385 | -s "a session has been resumed" \ |
| 4386 | -c "a session has been resumed" |
| 4387 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4388 | # For reasons that aren't fully understood, this test randomly fails with high |
Paul Elliott | 09cfa18 | 2021-10-13 16:13:44 +0100 | [diff] [blame] | 4389 | # probability with OpenSSL 1.0.2g on the CI, see #5012. |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4390 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4391 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4392 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4393 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4394 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4395 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4396 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4397 | rm -f $SESSION )" \ |
| 4398 | 0 \ |
| 4399 | -s "found session ticket extension" \ |
| 4400 | -S "server hello, adding session ticket extension" \ |
| 4401 | -s "session successfully restored from cache" \ |
| 4402 | -S "session successfully restored from ticket" \ |
| 4403 | -s "a session has been resumed" |
| 4404 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4405 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4406 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4407 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4408 | "$O_SRV -dtls" \ |
| 4409 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4410 | 0 \ |
| 4411 | -C "found session_ticket extension" \ |
| 4412 | -C "parse new session ticket" \ |
| 4413 | -c "a session has been resumed" |
| 4414 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4415 | # Tests for Max Fragment Length extension |
| 4416 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4417 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4418 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4419 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4420 | "$P_SRV debug_level=3" \ |
| 4421 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4422 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4423 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4424 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4425 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4426 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4427 | -C "client hello, adding max_fragment_length extension" \ |
| 4428 | -S "found max fragment length extension" \ |
| 4429 | -S "server hello, max_fragment_length extension" \ |
| 4430 | -C "found max_fragment_length extension" |
| 4431 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4432 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4433 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4434 | run_test "Max fragment length: enabled, default, larger message" \ |
| 4435 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4436 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4437 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4438 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4439 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4440 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4441 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4442 | -C "client hello, adding max_fragment_length extension" \ |
| 4443 | -S "found max fragment length extension" \ |
| 4444 | -S "server hello, max_fragment_length extension" \ |
| 4445 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4446 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4447 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4448 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4449 | |
| 4450 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4452 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 4453 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4454 | "$P_CLI debug_level=3 dtls=1 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4455 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4456 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4457 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4458 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4459 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4460 | -C "client hello, adding max_fragment_length extension" \ |
| 4461 | -S "found max fragment length extension" \ |
| 4462 | -S "server hello, max_fragment_length extension" \ |
| 4463 | -C "found max_fragment_length extension" \ |
| 4464 | -c "fragment larger than.*maximum " |
| 4465 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4466 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4467 | # (session fragment length will be 16384 regardless of mbedtls |
| 4468 | # content length configuration.) |
| 4469 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4470 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4471 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4472 | run_test "Max fragment length: disabled, larger message" \ |
| 4473 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4474 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4475 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4476 | -C "Maximum incoming record payload length is 16384" \ |
| 4477 | -C "Maximum outgoing record payload length is 16384" \ |
| 4478 | -S "Maximum incoming record payload length is 16384" \ |
| 4479 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4480 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4481 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4482 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4483 | |
| 4484 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4485 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4486 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4487 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4488 | "$P_CLI debug_level=3 dtls=1 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4489 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4490 | -C "Maximum incoming record payload length is 16384" \ |
| 4491 | -C "Maximum outgoing record payload length is 16384" \ |
| 4492 | -S "Maximum incoming record payload length is 16384" \ |
| 4493 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4494 | -c "fragment larger than.*maximum " |
| 4495 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4496 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4497 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4498 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4499 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4500 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4501 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4502 | -c "Maximum incoming record payload length is 4096" \ |
| 4503 | -c "Maximum outgoing record payload length is 4096" \ |
| 4504 | -s "Maximum incoming record payload length is 4096" \ |
| 4505 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4506 | -c "client hello, adding max_fragment_length extension" \ |
| 4507 | -s "found max fragment length extension" \ |
| 4508 | -s "server hello, max_fragment_length extension" \ |
| 4509 | -c "found max_fragment_length extension" |
| 4510 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4511 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4512 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4513 | run_test "Max fragment length: client 512, server 1024" \ |
| 4514 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4515 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4516 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4517 | -c "Maximum incoming record payload length is 512" \ |
| 4518 | -c "Maximum outgoing record payload length is 512" \ |
| 4519 | -s "Maximum incoming record payload length is 512" \ |
| 4520 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4521 | -c "client hello, adding max_fragment_length extension" \ |
| 4522 | -s "found max fragment length extension" \ |
| 4523 | -s "server hello, max_fragment_length extension" \ |
| 4524 | -c "found max_fragment_length extension" |
| 4525 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4526 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4527 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4528 | run_test "Max fragment length: client 512, server 2048" \ |
| 4529 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4530 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4531 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4532 | -c "Maximum incoming record payload length is 512" \ |
| 4533 | -c "Maximum outgoing record payload length is 512" \ |
| 4534 | -s "Maximum incoming record payload length is 512" \ |
| 4535 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4536 | -c "client hello, adding max_fragment_length extension" \ |
| 4537 | -s "found max fragment length extension" \ |
| 4538 | -s "server hello, max_fragment_length extension" \ |
| 4539 | -c "found max_fragment_length extension" |
| 4540 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4541 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4542 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4543 | run_test "Max fragment length: client 512, server 4096" \ |
| 4544 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4545 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4546 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4547 | -c "Maximum incoming record payload length is 512" \ |
| 4548 | -c "Maximum outgoing record payload length is 512" \ |
| 4549 | -s "Maximum incoming record payload length is 512" \ |
| 4550 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4551 | -c "client hello, adding max_fragment_length extension" \ |
| 4552 | -s "found max fragment length extension" \ |
| 4553 | -s "server hello, max_fragment_length extension" \ |
| 4554 | -c "found max_fragment_length extension" |
| 4555 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4556 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4557 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4558 | run_test "Max fragment length: client 1024, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4559 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4560 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4561 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4562 | -c "Maximum incoming record payload length is 1024" \ |
| 4563 | -c "Maximum outgoing record payload length is 1024" \ |
| 4564 | -s "Maximum incoming record payload length is 1024" \ |
| 4565 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4566 | -c "client hello, adding max_fragment_length extension" \ |
| 4567 | -s "found max fragment length extension" \ |
| 4568 | -s "server hello, max_fragment_length extension" \ |
| 4569 | -c "found max_fragment_length extension" |
| 4570 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4571 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4572 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4573 | run_test "Max fragment length: client 1024, server 2048" \ |
| 4574 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4575 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4576 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4577 | -c "Maximum incoming record payload length is 1024" \ |
| 4578 | -c "Maximum outgoing record payload length is 1024" \ |
| 4579 | -s "Maximum incoming record payload length is 1024" \ |
| 4580 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4581 | -c "client hello, adding max_fragment_length extension" \ |
| 4582 | -s "found max fragment length extension" \ |
| 4583 | -s "server hello, max_fragment_length extension" \ |
| 4584 | -c "found max_fragment_length extension" |
| 4585 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4586 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4587 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4588 | run_test "Max fragment length: client 1024, server 4096" \ |
| 4589 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4590 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4591 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4592 | -c "Maximum incoming record payload length is 1024" \ |
| 4593 | -c "Maximum outgoing record payload length is 1024" \ |
| 4594 | -s "Maximum incoming record payload length is 1024" \ |
| 4595 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4596 | -c "client hello, adding max_fragment_length extension" \ |
| 4597 | -s "found max fragment length extension" \ |
| 4598 | -s "server hello, max_fragment_length extension" \ |
| 4599 | -c "found max_fragment_length extension" |
| 4600 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4601 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4602 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4603 | run_test "Max fragment length: client 2048, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4604 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4605 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4606 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4607 | -c "Maximum incoming record payload length is 2048" \ |
| 4608 | -c "Maximum outgoing record payload length is 2048" \ |
| 4609 | -s "Maximum incoming record payload length is 2048" \ |
| 4610 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4611 | -c "client hello, adding max_fragment_length extension" \ |
| 4612 | -s "found max fragment length extension" \ |
| 4613 | -s "server hello, max_fragment_length extension" \ |
| 4614 | -c "found max_fragment_length extension" |
| 4615 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4616 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4617 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4618 | run_test "Max fragment length: client 2048, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4619 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4620 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4621 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4622 | -c "Maximum incoming record payload length is 2048" \ |
| 4623 | -c "Maximum outgoing record payload length is 2048" \ |
| 4624 | -s "Maximum incoming record payload length is 2048" \ |
| 4625 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4626 | -c "client hello, adding max_fragment_length extension" \ |
| 4627 | -s "found max fragment length extension" \ |
| 4628 | -s "server hello, max_fragment_length extension" \ |
| 4629 | -c "found max_fragment_length extension" |
| 4630 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4631 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4632 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4633 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4634 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4635 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4636 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4637 | -c "Maximum incoming record payload length is 2048" \ |
| 4638 | -c "Maximum outgoing record payload length is 2048" \ |
| 4639 | -s "Maximum incoming record payload length is 2048" \ |
| 4640 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4641 | -c "client hello, adding max_fragment_length extension" \ |
| 4642 | -s "found max fragment length extension" \ |
| 4643 | -s "server hello, max_fragment_length extension" \ |
| 4644 | -c "found max_fragment_length extension" |
| 4645 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4646 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4647 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4648 | run_test "Max fragment length: client 4096, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4649 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4650 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4651 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4652 | -c "Maximum incoming record payload length is 4096" \ |
| 4653 | -c "Maximum outgoing record payload length is 4096" \ |
| 4654 | -s "Maximum incoming record payload length is 4096" \ |
| 4655 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4656 | -c "client hello, adding max_fragment_length extension" \ |
| 4657 | -s "found max fragment length extension" \ |
| 4658 | -s "server hello, max_fragment_length extension" \ |
| 4659 | -c "found max_fragment_length extension" |
| 4660 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4661 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4662 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4663 | run_test "Max fragment length: client 4096, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4664 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4665 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4666 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4667 | -c "Maximum incoming record payload length is 4096" \ |
| 4668 | -c "Maximum outgoing record payload length is 4096" \ |
| 4669 | -s "Maximum incoming record payload length is 4096" \ |
| 4670 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4671 | -c "client hello, adding max_fragment_length extension" \ |
| 4672 | -s "found max fragment length extension" \ |
| 4673 | -s "server hello, max_fragment_length extension" \ |
| 4674 | -c "found max_fragment_length extension" |
| 4675 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4676 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4677 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4678 | run_test "Max fragment length: client 4096, server 2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4679 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4680 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4681 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4682 | -c "Maximum incoming record payload length is 4096" \ |
| 4683 | -c "Maximum outgoing record payload length is 4096" \ |
| 4684 | -s "Maximum incoming record payload length is 4096" \ |
| 4685 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4686 | -c "client hello, adding max_fragment_length extension" \ |
| 4687 | -s "found max fragment length extension" \ |
| 4688 | -s "server hello, max_fragment_length extension" \ |
| 4689 | -c "found max_fragment_length extension" |
| 4690 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4691 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4692 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4693 | run_test "Max fragment length: used by server" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4694 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4695 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4696 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4697 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4698 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4699 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4700 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4701 | -C "client hello, adding max_fragment_length extension" \ |
| 4702 | -S "found max fragment length extension" \ |
| 4703 | -S "server hello, max_fragment_length extension" \ |
| 4704 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4705 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4706 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4707 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4708 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4709 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4710 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4711 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4712 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4713 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4714 | -c "Maximum incoming record payload length is 4096" \ |
| 4715 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4716 | -c "client hello, adding max_fragment_length extension" \ |
| 4717 | -c "found max_fragment_length extension" |
| 4718 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4719 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4720 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4721 | run_test "Max fragment length: client, message just fits" \ |
| 4722 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4723 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048 request_size=2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4724 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4725 | -c "Maximum incoming record payload length is 2048" \ |
| 4726 | -c "Maximum outgoing record payload length is 2048" \ |
| 4727 | -s "Maximum incoming record payload length is 2048" \ |
| 4728 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4729 | -c "client hello, adding max_fragment_length extension" \ |
| 4730 | -s "found max fragment length extension" \ |
| 4731 | -s "server hello, max_fragment_length extension" \ |
| 4732 | -c "found max_fragment_length extension" \ |
| 4733 | -c "2048 bytes written in 1 fragments" \ |
| 4734 | -s "2048 bytes read" |
| 4735 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4736 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4737 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4738 | run_test "Max fragment length: client, larger message" \ |
| 4739 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4740 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048 request_size=2345" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4741 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4742 | -c "Maximum incoming record payload length is 2048" \ |
| 4743 | -c "Maximum outgoing record payload length is 2048" \ |
| 4744 | -s "Maximum incoming record payload length is 2048" \ |
| 4745 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4746 | -c "client hello, adding max_fragment_length extension" \ |
| 4747 | -s "found max fragment length extension" \ |
| 4748 | -s "server hello, max_fragment_length extension" \ |
| 4749 | -c "found max_fragment_length extension" \ |
| 4750 | -c "2345 bytes written in 2 fragments" \ |
| 4751 | -s "2048 bytes read" \ |
| 4752 | -s "297 bytes read" |
| 4753 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4754 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4755 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4756 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4757 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4758 | "$P_SRV debug_level=3 dtls=1" \ |
| 4759 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4760 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4761 | -c "Maximum incoming record payload length is 2048" \ |
| 4762 | -c "Maximum outgoing record payload length is 2048" \ |
| 4763 | -s "Maximum incoming record payload length is 2048" \ |
| 4764 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4765 | -c "client hello, adding max_fragment_length extension" \ |
| 4766 | -s "found max fragment length extension" \ |
| 4767 | -s "server hello, max_fragment_length extension" \ |
| 4768 | -c "found max_fragment_length extension" \ |
| 4769 | -c "fragment larger than.*maximum" |
| 4770 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4771 | # Tests for Record Size Limit extension |
| 4772 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4773 | requires_gnutls_tls1_3 |
| 4774 | requires_gnutls_record_size_limit |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4775 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4776 | run_test "Record Size Limit: TLS 1.3: Server-side parsing, debug output and fatal alert" \ |
| 4777 | "$P_SRV debug_level=3 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4778 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4" \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4779 | 1 \ |
| 4780 | -c "Preparing extension (Record Size Limit/28) for 'client hello'" \ |
| 4781 | -c "Sending extension Record Size Limit/28 (2 bytes)" \ |
| 4782 | -s "ClientHello: record_size_limit(28) extension received."\ |
| 4783 | -s "found record_size_limit extension" \ |
| 4784 | -s "RecordSizeLimit: 16385 Bytes" \ |
| 4785 | -c "Received alert \[110]: An unsupported extension was sent" |
| 4786 | |
| 4787 | requires_gnutls_tls1_3 |
| 4788 | requires_gnutls_record_size_limit |
| 4789 | requires_gnutls_next_disable_tls13_compat |
| 4790 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4791 | run_test "Record Size Limit: TLS 1.3: Client-side parsing, debug output and fatal alert" \ |
| 4792 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert -d 4" \ |
| 4793 | "$P_CLI debug_level=4 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4794 | 0 \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4795 | -s "Preparing extension (Record Size Limit/28) for 'encrypted extensions'" |
| 4796 | # The P_CLI can not yet send the Record Size Limit extension. Thus, the G_NEXT_SRV does not send |
| 4797 | # a response in its EncryptedExtensions record. |
| 4798 | # -s "Parsing extension 'Record Size Limit/28 (2 bytes)" \ |
| 4799 | # -s "Sending extension Record Size Limit/28 (2 bytes)" \ |
| 4800 | # -c "EncryptedExtensions: record_size_limit(28) extension received."\ |
| 4801 | # -c "found record_size_limit extension" \ |
| 4802 | # -c "RecordSizeLimit: 16385 Bytes" \ |
| 4803 | # -s "Received alert \[110]: An unsupported extension was sent" |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4804 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4805 | # Tests for renegotiation |
| 4806 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4807 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4808 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4809 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4810 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4811 | 0 \ |
| 4812 | -C "client hello, adding renegotiation extension" \ |
| 4813 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4814 | -S "found renegotiation extension" \ |
| 4815 | -s "server hello, secure renegotiation extension" \ |
| 4816 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4817 | -C "=> renegotiate" \ |
| 4818 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4819 | -S "write hello request" |
| 4820 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4821 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4822 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4823 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4824 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4825 | 0 \ |
| 4826 | -c "client hello, adding renegotiation extension" \ |
| 4827 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4828 | -s "found renegotiation extension" \ |
| 4829 | -s "server hello, secure renegotiation extension" \ |
| 4830 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4831 | -c "=> renegotiate" \ |
| 4832 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4833 | -S "write hello request" |
| 4834 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4835 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4836 | run_test "Renegotiation: server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4837 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4838 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4839 | 0 \ |
| 4840 | -c "client hello, adding renegotiation extension" \ |
| 4841 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4842 | -s "found renegotiation extension" \ |
| 4843 | -s "server hello, secure renegotiation extension" \ |
| 4844 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4845 | -c "=> renegotiate" \ |
| 4846 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4847 | -s "write hello request" |
| 4848 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4849 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4850 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 4851 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4852 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4853 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 4854 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4855 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4856 | 0 \ |
| 4857 | -c "client hello, adding renegotiation extension" \ |
| 4858 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4859 | -s "found renegotiation extension" \ |
| 4860 | -s "server hello, secure renegotiation extension" \ |
| 4861 | -c "found renegotiation extension" \ |
| 4862 | -c "=> renegotiate" \ |
| 4863 | -s "=> renegotiate" \ |
| 4864 | -S "write hello request" \ |
| 4865 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4866 | |
| 4867 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 4868 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 4869 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4870 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4871 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4872 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 4873 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4874 | 0 \ |
| 4875 | -c "client hello, adding renegotiation extension" \ |
| 4876 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4877 | -s "found renegotiation extension" \ |
| 4878 | -s "server hello, secure renegotiation extension" \ |
| 4879 | -c "found renegotiation extension" \ |
| 4880 | -c "=> renegotiate" \ |
| 4881 | -s "=> renegotiate" \ |
| 4882 | -s "write hello request" \ |
| 4883 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 4884 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4885 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4886 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4887 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4888 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4889 | 0 \ |
| 4890 | -c "client hello, adding renegotiation extension" \ |
| 4891 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4892 | -s "found renegotiation extension" \ |
| 4893 | -s "server hello, secure renegotiation extension" \ |
| 4894 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4895 | -c "=> renegotiate" \ |
| 4896 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4897 | -s "write hello request" |
| 4898 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4899 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4900 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4901 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4902 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4903 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4904 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 max_frag_len=2048 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 4905 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4906 | -c "Maximum incoming record payload length is 2048" \ |
| 4907 | -c "Maximum outgoing record payload length is 2048" \ |
| 4908 | -s "Maximum incoming record payload length is 2048" \ |
| 4909 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 4910 | -c "client hello, adding max_fragment_length extension" \ |
| 4911 | -s "found max fragment length extension" \ |
| 4912 | -s "server hello, max_fragment_length extension" \ |
| 4913 | -c "found max_fragment_length extension" \ |
| 4914 | -c "client hello, adding renegotiation extension" \ |
| 4915 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4916 | -s "found renegotiation extension" \ |
| 4917 | -s "server hello, secure renegotiation extension" \ |
| 4918 | -c "found renegotiation extension" \ |
| 4919 | -c "=> renegotiate" \ |
| 4920 | -s "=> renegotiate" \ |
| 4921 | -s "write hello request" |
| 4922 | |
| 4923 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4924 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4925 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4926 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4927 | 1 \ |
| 4928 | -c "client hello, adding renegotiation extension" \ |
| 4929 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4930 | -S "found renegotiation extension" \ |
| 4931 | -s "server hello, secure renegotiation extension" \ |
| 4932 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4933 | -c "=> renegotiate" \ |
| 4934 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4935 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 4936 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4937 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4938 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4939 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4940 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4941 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4942 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4943 | 0 \ |
| 4944 | -C "client hello, adding renegotiation extension" \ |
| 4945 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4946 | -S "found renegotiation extension" \ |
| 4947 | -s "server hello, secure renegotiation extension" \ |
| 4948 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 4949 | -C "=> renegotiate" \ |
| 4950 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4951 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 4952 | -S "SSL - An unexpected message was received from our peer" \ |
| 4953 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 4954 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4955 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4956 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4957 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4958 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4959 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4960 | 0 \ |
| 4961 | -C "client hello, adding renegotiation extension" \ |
| 4962 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4963 | -S "found renegotiation extension" \ |
| 4964 | -s "server hello, secure renegotiation extension" \ |
| 4965 | -c "found renegotiation extension" \ |
| 4966 | -C "=> renegotiate" \ |
| 4967 | -S "=> renegotiate" \ |
| 4968 | -s "write hello request" \ |
| 4969 | -S "SSL - An unexpected message was received from our peer" \ |
| 4970 | -S "failed" |
| 4971 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4972 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4973 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4974 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4975 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4976 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4977 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4978 | 0 \ |
| 4979 | -C "client hello, adding renegotiation extension" \ |
| 4980 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4981 | -S "found renegotiation extension" \ |
| 4982 | -s "server hello, secure renegotiation extension" \ |
| 4983 | -c "found renegotiation extension" \ |
| 4984 | -C "=> renegotiate" \ |
| 4985 | -S "=> renegotiate" \ |
| 4986 | -s "write hello request" \ |
| 4987 | -S "SSL - An unexpected message was received from our peer" \ |
| 4988 | -S "failed" |
| 4989 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4990 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4991 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4992 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4993 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4994 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4995 | 0 \ |
| 4996 | -C "client hello, adding renegotiation extension" \ |
| 4997 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4998 | -S "found renegotiation extension" \ |
| 4999 | -s "server hello, secure renegotiation extension" \ |
| 5000 | -c "found renegotiation extension" \ |
| 5001 | -C "=> renegotiate" \ |
| 5002 | -S "=> renegotiate" \ |
| 5003 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5004 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5005 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5006 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5007 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5008 | "$P_SRV force_version=tls12 debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5009 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5010 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5011 | 0 \ |
| 5012 | -c "client hello, adding renegotiation extension" \ |
| 5013 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5014 | -s "found renegotiation extension" \ |
| 5015 | -s "server hello, secure renegotiation extension" \ |
| 5016 | -c "found renegotiation extension" \ |
| 5017 | -c "=> renegotiate" \ |
| 5018 | -s "=> renegotiate" \ |
| 5019 | -s "write hello request" \ |
| 5020 | -S "SSL - An unexpected message was received from our peer" \ |
| 5021 | -S "failed" |
| 5022 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5023 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5024 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5025 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5026 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5027 | 0 \ |
| 5028 | -C "client hello, adding renegotiation extension" \ |
| 5029 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5030 | -S "found renegotiation extension" \ |
| 5031 | -s "server hello, secure renegotiation extension" \ |
| 5032 | -c "found renegotiation extension" \ |
| 5033 | -S "record counter limit reached: renegotiate" \ |
| 5034 | -C "=> renegotiate" \ |
| 5035 | -S "=> renegotiate" \ |
| 5036 | -S "write hello request" \ |
| 5037 | -S "SSL - An unexpected message was received from our peer" \ |
| 5038 | -S "failed" |
| 5039 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 5040 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5041 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5042 | run_test "Renegotiation: periodic, just above period" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5043 | "$P_SRV force_version=tls12 debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 5044 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5045 | 0 \ |
| 5046 | -c "client hello, adding renegotiation extension" \ |
| 5047 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5048 | -s "found renegotiation extension" \ |
| 5049 | -s "server hello, secure renegotiation extension" \ |
| 5050 | -c "found renegotiation extension" \ |
| 5051 | -s "record counter limit reached: renegotiate" \ |
| 5052 | -c "=> renegotiate" \ |
| 5053 | -s "=> renegotiate" \ |
| 5054 | -s "write hello request" \ |
| 5055 | -S "SSL - An unexpected message was received from our peer" \ |
| 5056 | -S "failed" |
| 5057 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5058 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5059 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5060 | "$P_SRV debug_level=3 exchanges=9 renegotiation=1 renego_period=3 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5061 | "$P_CLI force_version=tls12 debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5062 | 0 \ |
| 5063 | -c "client hello, adding renegotiation extension" \ |
| 5064 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5065 | -s "found renegotiation extension" \ |
| 5066 | -s "server hello, secure renegotiation extension" \ |
| 5067 | -c "found renegotiation extension" \ |
| 5068 | -s "record counter limit reached: renegotiate" \ |
| 5069 | -c "=> renegotiate" \ |
| 5070 | -s "=> renegotiate" \ |
| 5071 | -s "write hello request" \ |
| 5072 | -S "SSL - An unexpected message was received from our peer" \ |
| 5073 | -S "failed" |
| 5074 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5075 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5076 | run_test "Renegotiation: periodic, above period, disabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5077 | "$P_SRV force_version=tls12 debug_level=3 exchanges=9 renegotiation=0 renego_period=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5078 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 5079 | 0 \ |
| 5080 | -C "client hello, adding renegotiation extension" \ |
| 5081 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5082 | -S "found renegotiation extension" \ |
| 5083 | -s "server hello, secure renegotiation extension" \ |
| 5084 | -c "found renegotiation extension" \ |
| 5085 | -S "record counter limit reached: renegotiate" \ |
| 5086 | -C "=> renegotiate" \ |
| 5087 | -S "=> renegotiate" \ |
| 5088 | -S "write hello request" \ |
| 5089 | -S "SSL - An unexpected message was received from our peer" \ |
| 5090 | -S "failed" |
| 5091 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5092 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5093 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5094 | "$P_SRV debug_level=3 nbio=2 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5095 | "$P_CLI force_version=tls12 debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | f07f421 | 2014-08-15 19:04:47 +0200 | [diff] [blame] | 5096 | 0 \ |
| 5097 | -c "client hello, adding renegotiation extension" \ |
| 5098 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5099 | -s "found renegotiation extension" \ |
| 5100 | -s "server hello, secure renegotiation extension" \ |
| 5101 | -c "found renegotiation extension" \ |
| 5102 | -c "=> renegotiate" \ |
| 5103 | -s "=> renegotiate" \ |
| 5104 | -S "write hello request" |
| 5105 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5106 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5107 | run_test "Renegotiation: nbio, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5108 | "$P_SRV force_version=tls12 debug_level=3 nbio=2 exchanges=2 renegotiation=1 renegotiate=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5109 | "$P_CLI debug_level=3 nbio=2 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | f07f421 | 2014-08-15 19:04:47 +0200 | [diff] [blame] | 5110 | 0 \ |
| 5111 | -c "client hello, adding renegotiation extension" \ |
| 5112 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5113 | -s "found renegotiation extension" \ |
| 5114 | -s "server hello, secure renegotiation extension" \ |
| 5115 | -c "found renegotiation extension" \ |
| 5116 | -c "=> renegotiate" \ |
| 5117 | -s "=> renegotiate" \ |
| 5118 | -s "write hello request" |
| 5119 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5120 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5121 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5122 | run_test "Renegotiation: openssl server, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5123 | "$O_SRV -www -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5124 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5125 | 0 \ |
| 5126 | -c "client hello, adding renegotiation extension" \ |
| 5127 | -c "found renegotiation extension" \ |
| 5128 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5129 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5130 | -C "error" \ |
| 5131 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5132 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5133 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5134 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5135 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5136 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5137 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5138 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5139 | 0 \ |
| 5140 | -c "client hello, adding renegotiation extension" \ |
| 5141 | -c "found renegotiation extension" \ |
| 5142 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5143 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5144 | -C "error" \ |
| 5145 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5146 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5147 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5148 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5149 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5150 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5151 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5152 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5153 | 1 \ |
| 5154 | -c "client hello, adding renegotiation extension" \ |
| 5155 | -C "found renegotiation extension" \ |
| 5156 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5157 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5158 | -c "error" \ |
| 5159 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5160 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5161 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5162 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5163 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5164 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5165 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5166 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5167 | allow_legacy=0" \ |
| 5168 | 1 \ |
| 5169 | -c "client hello, adding renegotiation extension" \ |
| 5170 | -C "found renegotiation extension" \ |
| 5171 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5172 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5173 | -c "error" \ |
| 5174 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5175 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5176 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5177 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5178 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5179 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5180 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5181 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5182 | allow_legacy=1" \ |
| 5183 | 0 \ |
| 5184 | -c "client hello, adding renegotiation extension" \ |
| 5185 | -C "found renegotiation extension" \ |
| 5186 | -c "=> renegotiate" \ |
| 5187 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5188 | -C "error" \ |
| 5189 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5190 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5191 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5192 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 5193 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 5194 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 5195 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5196 | 0 \ |
| 5197 | -c "client hello, adding renegotiation extension" \ |
| 5198 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5199 | -s "found renegotiation extension" \ |
| 5200 | -s "server hello, secure renegotiation extension" \ |
| 5201 | -c "found renegotiation extension" \ |
| 5202 | -c "=> renegotiate" \ |
| 5203 | -s "=> renegotiate" \ |
| 5204 | -S "write hello request" |
| 5205 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5206 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5208 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 5209 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | df9a0a8 | 2014-10-02 14:17:18 +0200 | [diff] [blame] | 5210 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 5211 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5212 | 0 \ |
| 5213 | -c "client hello, adding renegotiation extension" \ |
| 5214 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5215 | -s "found renegotiation extension" \ |
| 5216 | -s "server hello, secure renegotiation extension" \ |
| 5217 | -c "found renegotiation extension" \ |
| 5218 | -c "=> renegotiate" \ |
| 5219 | -s "=> renegotiate" \ |
| 5220 | -s "write hello request" |
| 5221 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5222 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5223 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5224 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5225 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5226 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5227 | 0 \ |
| 5228 | -c "client hello, adding renegotiation extension" \ |
| 5229 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5230 | -s "found renegotiation extension" \ |
| 5231 | -s "server hello, secure renegotiation extension" \ |
| 5232 | -s "record counter limit reached: renegotiate" \ |
| 5233 | -c "=> renegotiate" \ |
| 5234 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5235 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5236 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5237 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5238 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5239 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5240 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 5241 | "$G_SRV -u --mtu 4096" \ |
| 5242 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5243 | 0 \ |
| 5244 | -c "client hello, adding renegotiation extension" \ |
| 5245 | -c "found renegotiation extension" \ |
| 5246 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5247 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5248 | -C "error" \ |
| 5249 | -s "Extra-header:" |
| 5250 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5251 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5252 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5253 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5254 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5255 | run_test "Renego ext: gnutls server strict, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5256 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5257 | "$P_CLI debug_level=3" \ |
| 5258 | 0 \ |
| 5259 | -c "found renegotiation extension" \ |
| 5260 | -C "error" \ |
| 5261 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5262 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5263 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5264 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5265 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5266 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5267 | "$P_CLI debug_level=3" \ |
| 5268 | 0 \ |
| 5269 | -C "found renegotiation extension" \ |
| 5270 | -C "error" \ |
| 5271 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5272 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5273 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5274 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5275 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5276 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5277 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5278 | 1 \ |
| 5279 | -C "found renegotiation extension" \ |
| 5280 | -c "error" \ |
| 5281 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5282 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5283 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5284 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5285 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5286 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5287 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5288 | 0 \ |
| 5289 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5290 | -s "server hello, secure renegotiation extension" |
| 5291 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5292 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5293 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5294 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5295 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5296 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5297 | 0 \ |
| 5298 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5299 | -S "server hello, secure renegotiation extension" |
| 5300 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5301 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5302 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5303 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5304 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5305 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5306 | 1 \ |
| 5307 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5308 | -S "server hello, secure renegotiation extension" |
| 5309 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5310 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5311 | |
| 5312 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5313 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5314 | run_test "DER format: no trailing bytes" \ |
| 5315 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 5316 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5317 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5318 | 0 \ |
| 5319 | -c "Handshake was completed" \ |
| 5320 | |
| 5321 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5322 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5323 | run_test "DER format: with a trailing zero byte" \ |
| 5324 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 5325 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5326 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5327 | 0 \ |
| 5328 | -c "Handshake was completed" \ |
| 5329 | |
| 5330 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5331 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5332 | run_test "DER format: with a trailing random byte" \ |
| 5333 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 5334 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5335 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5336 | 0 \ |
| 5337 | -c "Handshake was completed" \ |
| 5338 | |
| 5339 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5340 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5341 | run_test "DER format: with 2 trailing random bytes" \ |
| 5342 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 5343 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5344 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5345 | 0 \ |
| 5346 | -c "Handshake was completed" \ |
| 5347 | |
| 5348 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5349 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5350 | run_test "DER format: with 4 trailing random bytes" \ |
| 5351 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 5352 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5353 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5354 | 0 \ |
| 5355 | -c "Handshake was completed" \ |
| 5356 | |
| 5357 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5358 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5359 | run_test "DER format: with 8 trailing random bytes" \ |
| 5360 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 5361 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5362 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5363 | 0 \ |
| 5364 | -c "Handshake was completed" \ |
| 5365 | |
| 5366 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5367 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5368 | run_test "DER format: with 9 trailing random bytes" \ |
| 5369 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 5370 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5371 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5372 | 0 \ |
| 5373 | -c "Handshake was completed" \ |
| 5374 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5375 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5376 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5377 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5378 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5379 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5380 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5381 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5382 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5383 | 1 \ |
| 5384 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5385 | -c "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5386 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5387 | -c "X509 - Certificate verification failed" |
| 5388 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5389 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5390 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5391 | key_file=data_files/server5.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5392 | "$P_CLI force_version=tls12 debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5393 | 0 \ |
| 5394 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5395 | -c "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5396 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5397 | -C "X509 - Certificate verification failed" |
| 5398 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5399 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5400 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 5401 | "$P_SRV" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5402 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5403 | 0 \ |
| 5404 | -c "x509_verify_cert() returned" \ |
| 5405 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5406 | -c "! Certificate verification flags"\ |
| 5407 | -C "! mbedtls_ssl_handshake returned" \ |
| 5408 | -C "X509 - Certificate verification failed" \ |
| 5409 | -C "SSL - No CA Chain is set, but required to operate" |
| 5410 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5411 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5412 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5413 | "$P_SRV" \ |
| 5414 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5415 | 1 \ |
| 5416 | -c "x509_verify_cert() returned" \ |
| 5417 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5418 | -c "! Certificate verification flags"\ |
| 5419 | -c "! mbedtls_ssl_handshake returned" \ |
| 5420 | -c "SSL - No CA Chain is set, but required to operate" |
| 5421 | |
| 5422 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5423 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5424 | # the client informs the server about the supported curves - it does, though, in the |
| 5425 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5426 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5427 | # different means to have the server ignoring the client's supported curve list. |
| 5428 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5429 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5430 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5431 | crt_file=data_files/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 5432 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=required groups=secp521r1" \ |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5433 | 1 \ |
| 5434 | -c "bad certificate (EC key curve)"\ |
| 5435 | -c "! Certificate verification flags"\ |
| 5436 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5437 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5438 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 5439 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5440 | crt_file=data_files/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 5441 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional groups=secp521r1" \ |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5442 | 1 \ |
| 5443 | -c "bad certificate (EC key curve)"\ |
| 5444 | -c "! Certificate verification flags"\ |
| 5445 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5446 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5447 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 5448 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5449 | key_file=data_files/server5.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5450 | "$P_CLI force_version=tls12 debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5451 | 0 \ |
| 5452 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5453 | -C "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5454 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5455 | -C "X509 - Certificate verification failed" |
| 5456 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5457 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5458 | run_test "Authentication: client SHA256, server required" \ |
| 5459 | "$P_SRV auth_mode=required" \ |
| 5460 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5461 | key_file=data_files/server6.key \ |
| 5462 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5463 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5464 | -c "Supported Signature Algorithm found: 04 " \ |
| 5465 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5466 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5467 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5468 | run_test "Authentication: client SHA384, server required" \ |
| 5469 | "$P_SRV auth_mode=required" \ |
| 5470 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5471 | key_file=data_files/server6.key \ |
| 5472 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5473 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5474 | -c "Supported Signature Algorithm found: 04 " \ |
| 5475 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5476 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5477 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5478 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 5479 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5480 | "$P_CLI debug_level=3 crt_file=none \ |
| 5481 | key_file=data_files/server5.key" \ |
| 5482 | 1 \ |
| 5483 | -S "skip write certificate request" \ |
| 5484 | -C "skip parse certificate request" \ |
| 5485 | -c "got a certificate request" \ |
| 5486 | -c "= write certificate$" \ |
| 5487 | -C "skip write certificate$" \ |
| 5488 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 5489 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5490 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5491 | -s "No client certification received from the client, but required by the authentication mode" |
| 5492 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5493 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5494 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5495 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5496 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5497 | key_file=data_files/server5.key" \ |
| 5498 | 1 \ |
| 5499 | -S "skip write certificate request" \ |
| 5500 | -C "skip parse certificate request" \ |
| 5501 | -c "got a certificate request" \ |
| 5502 | -C "skip write certificate" \ |
| 5503 | -C "skip write certificate verify" \ |
| 5504 | -S "skip parse certificate verify" \ |
| 5505 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5506 | -s "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5507 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5508 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5509 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5510 | # We don't check that the client receives the alert because it might |
| 5511 | # detect that its write end of the connection is closed and abort |
| 5512 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5513 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5514 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 5515 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 5516 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 5517 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5518 | key_file=data_files/server5.key" \ |
| 5519 | 0 \ |
| 5520 | -S "skip write certificate request" \ |
| 5521 | -C "skip parse certificate request" \ |
| 5522 | -c "got a certificate request" \ |
| 5523 | -C "skip write certificate" \ |
| 5524 | -C "skip write certificate verify" \ |
| 5525 | -S "skip parse certificate verify" \ |
| 5526 | -S "x509_verify_cert() returned" \ |
| 5527 | -S "! The certificate is not correctly signed" \ |
| 5528 | -S "X509 - Certificate verification failed" |
| 5529 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5530 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5531 | run_test "Authentication: client cert not trusted, server required" \ |
| 5532 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5533 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5534 | key_file=data_files/server5.key" \ |
| 5535 | 1 \ |
| 5536 | -S "skip write certificate request" \ |
| 5537 | -C "skip parse certificate request" \ |
| 5538 | -c "got a certificate request" \ |
| 5539 | -C "skip write certificate" \ |
| 5540 | -C "skip write certificate verify" \ |
| 5541 | -S "skip parse certificate verify" \ |
| 5542 | -s "x509_verify_cert() returned" \ |
| 5543 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5544 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5545 | -s "X509 - Certificate verification failed" |
| 5546 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5547 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5548 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5549 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5550 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5551 | key_file=data_files/server5.key" \ |
| 5552 | 0 \ |
| 5553 | -S "skip write certificate request" \ |
| 5554 | -C "skip parse certificate request" \ |
| 5555 | -c "got a certificate request" \ |
| 5556 | -C "skip write certificate" \ |
| 5557 | -C "skip write certificate verify" \ |
| 5558 | -S "skip parse certificate verify" \ |
| 5559 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5560 | -s "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5561 | -S "! mbedtls_ssl_handshake returned" \ |
| 5562 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5563 | -S "X509 - Certificate verification failed" |
| 5564 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5565 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5566 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5567 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 5568 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5569 | key_file=data_files/server5.key" \ |
| 5570 | 0 \ |
| 5571 | -s "skip write certificate request" \ |
| 5572 | -C "skip parse certificate request" \ |
| 5573 | -c "got no certificate request" \ |
| 5574 | -c "skip write certificate" \ |
| 5575 | -c "skip write certificate verify" \ |
| 5576 | -s "skip parse certificate verify" \ |
| 5577 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5578 | -S "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5579 | -S "! mbedtls_ssl_handshake returned" \ |
| 5580 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5581 | -S "X509 - Certificate verification failed" |
| 5582 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5583 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5584 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5585 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 5586 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5587 | 0 \ |
| 5588 | -S "skip write certificate request" \ |
| 5589 | -C "skip parse certificate request" \ |
| 5590 | -c "got a certificate request" \ |
| 5591 | -C "skip write certificate$" \ |
| 5592 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5593 | -c "skip write certificate verify" \ |
| 5594 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5595 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5596 | -S "! mbedtls_ssl_handshake returned" \ |
| 5597 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5598 | -S "X509 - Certificate verification failed" |
| 5599 | |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 5600 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 5601 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5602 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5603 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 5604 | "$O_NEXT_CLI_NO_CERT -no_middlebox" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5605 | 0 \ |
| 5606 | -S "skip write certificate request" \ |
| 5607 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5608 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5609 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5610 | -S "X509 - Certificate verification failed" |
| 5611 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5612 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5613 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5614 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5615 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5616 | 0 \ |
| 5617 | -C "skip parse certificate request" \ |
| 5618 | -c "got a certificate request" \ |
| 5619 | -C "skip write certificate$" \ |
| 5620 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5621 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 5622 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5623 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5624 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5625 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5626 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 5627 | 1 \ |
| 5628 | -C "skip parse certificate request" \ |
| 5629 | -c "got a certificate request" \ |
| 5630 | -C "skip write certificate$" \ |
| 5631 | -c "skip write certificate verify" \ |
| 5632 | -c "! mbedtls_ssl_handshake returned" |
| 5633 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5634 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 5635 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 5636 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5637 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 5638 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 5639 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 5640 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 5641 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 5642 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 5643 | # are in place so that the semantics are consistent with the test description. |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5644 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5645 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5646 | run_test "Authentication: server max_int chain, client default" \ |
| 5647 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5648 | key_file=data_files/dir-maxpath/09.key" \ |
| 5649 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5650 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5651 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5652 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5653 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5654 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5655 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 5656 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5657 | key_file=data_files/dir-maxpath/10.key" \ |
| 5658 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 5659 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5660 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5661 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5662 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5663 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5664 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 5665 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5666 | key_file=data_files/dir-maxpath/10.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5667 | "$P_CLI force_version=tls12 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5668 | auth_mode=optional" \ |
| 5669 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5670 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5671 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5672 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5673 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5674 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 5675 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5676 | key_file=data_files/dir-maxpath/10.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5677 | "$P_CLI force_version=tls12 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5678 | auth_mode=none" \ |
| 5679 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5680 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5681 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5682 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5683 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5684 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 5685 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 5686 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5687 | key_file=data_files/dir-maxpath/10.key" \ |
| 5688 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5689 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5690 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5691 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5692 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5693 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 5694 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 5695 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5696 | key_file=data_files/dir-maxpath/10.key" \ |
| 5697 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5698 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5699 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5700 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5701 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5702 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 5703 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5704 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5705 | key_file=data_files/dir-maxpath/10.key" \ |
| 5706 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5707 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5708 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5709 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5710 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5711 | run_test "Authentication: client max_int chain, server required" \ |
| 5712 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 5713 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5714 | key_file=data_files/dir-maxpath/09.key" \ |
| 5715 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 5716 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 5717 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5718 | # Tests for CA list in CertificateRequest messages |
| 5719 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5720 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5721 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 5722 | "$P_SRV debug_level=3 auth_mode=required" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5723 | "$P_CLI force_version=tls12 crt_file=data_files/server6.crt \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5724 | key_file=data_files/server6.key" \ |
| 5725 | 0 \ |
| 5726 | -s "requested DN" |
| 5727 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5728 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5729 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 5730 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5731 | "$P_CLI force_version=tls12 crt_file=data_files/server6.crt \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5732 | key_file=data_files/server6.key" \ |
| 5733 | 0 \ |
| 5734 | -S "requested DN" |
| 5735 | |
| 5736 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5737 | "$P_SRV force_version=tls12 debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5738 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5739 | key_file=data_files/server5.key" \ |
| 5740 | 1 \ |
| 5741 | -S "requested DN" \ |
| 5742 | -s "x509_verify_cert() returned" \ |
| 5743 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5744 | -s "! mbedtls_ssl_handshake returned" \ |
| 5745 | -c "! mbedtls_ssl_handshake returned" \ |
| 5746 | -s "X509 - Certificate verification failed" |
| 5747 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5748 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5749 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 5750 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5751 | crt_file2=data_files/server1.crt \ |
| 5752 | key_file2=data_files/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5753 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5754 | crt_file=data_files/server6.crt \ |
| 5755 | key_file=data_files/server6.key" \ |
| 5756 | 0 \ |
| 5757 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5758 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5759 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5760 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 5761 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
| 5762 | crt_file2=data_files/server2.crt \ |
| 5763 | key_file2=data_files/server2.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5764 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5765 | crt_file=data_files/server6.crt \ |
| 5766 | key_file=data_files/server6.key" \ |
| 5767 | 0 \ |
| 5768 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 5769 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5770 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5771 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 5772 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=3 \ |
| 5773 | crt_file2=data_files/server1.crt \ |
| 5774 | key_file2=data_files/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5775 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 5776 | crt_file=data_files/server6.crt \ |
| 5777 | key_file=data_files/server6.key" \ |
| 5778 | 0 \ |
| 5779 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 5780 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5781 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 5782 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5783 | |
| 5784 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5785 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 5786 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5787 | key_file=data_files/server5.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5788 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5789 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5790 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5791 | -c "x509_verify_cert() returned" \ |
| 5792 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5793 | -c "! mbedtls_ssl_handshake returned" \ |
| 5794 | -c "X509 - Certificate verification failed" |
| 5795 | |
| 5796 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5797 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 5798 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 5799 | key_file=data_files/server5.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5800 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5801 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5802 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5803 | -c "x509_verify_cert() returned" \ |
| 5804 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5805 | -C "! mbedtls_ssl_handshake returned" \ |
| 5806 | -C "X509 - Certificate verification failed" |
| 5807 | |
| 5808 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5809 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5810 | # the client informs the server about the supported curves - it does, though, in the |
| 5811 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5812 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5813 | # different means to have the server ignoring the client's supported curve list. |
| 5814 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5815 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5816 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 5817 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 5818 | crt_file=data_files/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 5819 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required groups=secp521r1" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5820 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5821 | -c "use CA callback for X.509 CRT verification" \ |
| 5822 | -c "bad certificate (EC key curve)" \ |
| 5823 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5824 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5825 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5826 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5827 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
Valerio Setti | a9aafd4 | 2023-04-11 12:30:45 +0200 | [diff] [blame] | 5828 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5829 | crt_file=data_files/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 5830 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 auth_mode=optional groups=secp521r1" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5831 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5832 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5833 | -c "bad certificate (EC key curve)"\ |
| 5834 | -c "! Certificate verification flags"\ |
| 5835 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5836 | |
| 5837 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5838 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5839 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 5840 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5841 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5842 | key_file=data_files/server6.key \ |
| 5843 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5844 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5845 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5846 | -c "Supported Signature Algorithm found: 04 " \ |
| 5847 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5848 | |
| 5849 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5850 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5851 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 5852 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 5853 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 5854 | key_file=data_files/server6.key \ |
| 5855 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5856 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5857 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5858 | -c "Supported Signature Algorithm found: 04 " \ |
| 5859 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5860 | |
| 5861 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5862 | run_test "Authentication, CA callback: client badcert, server required" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5863 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5864 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5865 | key_file=data_files/server5.key" \ |
| 5866 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5867 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5868 | -S "skip write certificate request" \ |
| 5869 | -C "skip parse certificate request" \ |
| 5870 | -c "got a certificate request" \ |
| 5871 | -C "skip write certificate" \ |
| 5872 | -C "skip write certificate verify" \ |
| 5873 | -S "skip parse certificate verify" \ |
| 5874 | -s "x509_verify_cert() returned" \ |
| 5875 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5876 | -s "! mbedtls_ssl_handshake returned" \ |
| 5877 | -s "send alert level=2 message=48" \ |
| 5878 | -c "! mbedtls_ssl_handshake returned" \ |
| 5879 | -s "X509 - Certificate verification failed" |
| 5880 | # We don't check that the client receives the alert because it might |
| 5881 | # detect that its write end of the connection is closed and abort |
| 5882 | # before reading the alert message. |
| 5883 | |
| 5884 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5885 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5886 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5887 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 5888 | key_file=data_files/server5.key" \ |
| 5889 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5890 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5891 | -S "skip write certificate request" \ |
| 5892 | -C "skip parse certificate request" \ |
| 5893 | -c "got a certificate request" \ |
| 5894 | -C "skip write certificate" \ |
| 5895 | -C "skip write certificate verify" \ |
| 5896 | -S "skip parse certificate verify" \ |
| 5897 | -s "x509_verify_cert() returned" \ |
| 5898 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5899 | -s "! mbedtls_ssl_handshake returned" \ |
| 5900 | -c "! mbedtls_ssl_handshake returned" \ |
| 5901 | -s "X509 - Certificate verification failed" |
| 5902 | |
| 5903 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5904 | run_test "Authentication, CA callback: client badcert, server optional" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5905 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5906 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 5907 | key_file=data_files/server5.key" \ |
| 5908 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5909 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5910 | -S "skip write certificate request" \ |
| 5911 | -C "skip parse certificate request" \ |
| 5912 | -c "got a certificate request" \ |
| 5913 | -C "skip write certificate" \ |
| 5914 | -C "skip write certificate verify" \ |
| 5915 | -S "skip parse certificate verify" \ |
| 5916 | -s "x509_verify_cert() returned" \ |
| 5917 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5918 | -S "! mbedtls_ssl_handshake returned" \ |
| 5919 | -C "! mbedtls_ssl_handshake returned" \ |
| 5920 | -S "X509 - Certificate verification failed" |
| 5921 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5922 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5923 | requires_full_size_output_buffer |
| 5924 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5925 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 5926 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 5927 | key_file=data_files/dir-maxpath/09.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5928 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5929 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5930 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5931 | -C "X509 - A fatal error occurred" |
| 5932 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5933 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5934 | requires_full_size_output_buffer |
| 5935 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5936 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 5937 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5938 | key_file=data_files/dir-maxpath/10.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5939 | "$P_CLI force_version=tls12 debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5940 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5941 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5942 | -c "X509 - A fatal error occurred" |
| 5943 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5944 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5945 | requires_full_size_output_buffer |
| 5946 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5947 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 5948 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 5949 | key_file=data_files/dir-maxpath/10.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5950 | "$P_CLI force_version=tls12 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5951 | debug_level=3 auth_mode=optional" \ |
| 5952 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5953 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5954 | -c "X509 - A fatal error occurred" |
| 5955 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5956 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5957 | requires_full_size_output_buffer |
| 5958 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5959 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5960 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5961 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5962 | key_file=data_files/dir-maxpath/10.key" \ |
| 5963 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5964 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5965 | -s "X509 - A fatal error occurred" |
| 5966 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5967 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5968 | requires_full_size_output_buffer |
| 5969 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5970 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5971 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5972 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 5973 | key_file=data_files/dir-maxpath/10.key" \ |
| 5974 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5975 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5976 | -s "X509 - A fatal error occurred" |
| 5977 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 5978 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5979 | requires_full_size_output_buffer |
| 5980 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 5981 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 5982 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5983 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 5984 | key_file=data_files/dir-maxpath/09.key" \ |
| 5985 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 5986 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 5987 | -S "X509 - A fatal error occurred" |
| 5988 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5989 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5990 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5991 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5992 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5993 | "$P_SRV force_version=tls12 crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5994 | key_file=data_files/server5.key \ |
| 5995 | crt_file2=data_files/server5-sha1.crt \ |
| 5996 | key_file2=data_files/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 5997 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5998 | 0 \ |
| 5999 | -c "signed using.*ECDSA with SHA256" \ |
| 6000 | -C "signed using.*ECDSA with SHA1" |
| 6001 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6002 | # tests for SNI |
| 6003 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6004 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6005 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6006 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6007 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6008 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6009 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6010 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6011 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6012 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6013 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6014 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6015 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6016 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6017 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6018 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 6019 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6020 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6021 | 0 \ |
| 6022 | -s "parse ServerName extension" \ |
| 6023 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6024 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6025 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6026 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6027 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6028 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6029 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6030 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 6031 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6032 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6033 | 0 \ |
| 6034 | -s "parse ServerName extension" \ |
| 6035 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6036 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6037 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6038 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6039 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6040 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6041 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6042 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 6043 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6044 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6045 | 1 \ |
| 6046 | -s "parse ServerName extension" \ |
| 6047 | -s "ssl_sni_wrapper() returned" \ |
| 6048 | -s "mbedtls_ssl_handshake returned" \ |
| 6049 | -c "mbedtls_ssl_handshake returned" \ |
| 6050 | -c "SSL - A fatal alert message was received from our peer" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6051 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6052 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6053 | run_test "SNI: client auth no override: optional" \ |
| 6054 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6055 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6056 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 6057 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6058 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6059 | -S "skip write certificate request" \ |
| 6060 | -C "skip parse certificate request" \ |
| 6061 | -c "got a certificate request" \ |
| 6062 | -C "skip write certificate" \ |
| 6063 | -C "skip write certificate verify" \ |
| 6064 | -S "skip parse certificate verify" |
| 6065 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6066 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6067 | run_test "SNI: client auth override: none -> optional" \ |
| 6068 | "$P_SRV debug_level=3 auth_mode=none \ |
| 6069 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6070 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 6071 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6072 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6073 | -S "skip write certificate request" \ |
| 6074 | -C "skip parse certificate request" \ |
| 6075 | -c "got a certificate request" \ |
| 6076 | -C "skip write certificate" \ |
| 6077 | -C "skip write certificate verify" \ |
| 6078 | -S "skip parse certificate verify" |
| 6079 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6080 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6081 | run_test "SNI: client auth override: optional -> none" \ |
| 6082 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6083 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6084 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 6085 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6086 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6087 | -s "skip write certificate request" \ |
| 6088 | -C "skip parse certificate request" \ |
| 6089 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 6090 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6091 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6092 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6093 | run_test "SNI: CA no override" \ |
| 6094 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6095 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6096 | ca_file=data_files/test-ca.crt \ |
| 6097 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 6098 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6099 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6100 | 1 \ |
| 6101 | -S "skip write certificate request" \ |
| 6102 | -C "skip parse certificate request" \ |
| 6103 | -c "got a certificate request" \ |
| 6104 | -C "skip write certificate" \ |
| 6105 | -C "skip write certificate verify" \ |
| 6106 | -S "skip parse certificate verify" \ |
| 6107 | -s "x509_verify_cert() returned" \ |
| 6108 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6109 | -S "The certificate has been revoked (is on a CRL)" |
| 6110 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6111 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6112 | run_test "SNI: CA override" \ |
| 6113 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6114 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6115 | ca_file=data_files/test-ca.crt \ |
| 6116 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 6117 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6118 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6119 | 0 \ |
| 6120 | -S "skip write certificate request" \ |
| 6121 | -C "skip parse certificate request" \ |
| 6122 | -c "got a certificate request" \ |
| 6123 | -C "skip write certificate" \ |
| 6124 | -C "skip write certificate verify" \ |
| 6125 | -S "skip parse certificate verify" \ |
| 6126 | -S "x509_verify_cert() returned" \ |
| 6127 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6128 | -S "The certificate has been revoked (is on a CRL)" |
| 6129 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6130 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6131 | run_test "SNI: CA override with CRL" \ |
| 6132 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6133 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6134 | ca_file=data_files/test-ca.crt \ |
| 6135 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 6136 | "$P_CLI debug_level=3 server_name=localhost \ |
| 6137 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6138 | 1 \ |
| 6139 | -S "skip write certificate request" \ |
| 6140 | -C "skip parse certificate request" \ |
| 6141 | -c "got a certificate request" \ |
| 6142 | -C "skip write certificate" \ |
| 6143 | -C "skip write certificate verify" \ |
| 6144 | -S "skip parse certificate verify" \ |
| 6145 | -s "x509_verify_cert() returned" \ |
| 6146 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6147 | -s "The certificate has been revoked (is on a CRL)" |
| 6148 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6149 | # Tests for SNI and DTLS |
| 6150 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6151 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6152 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6153 | run_test "SNI: DTLS, no SNI callback" \ |
| 6154 | "$P_SRV debug_level=3 dtls=1 \ |
| 6155 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 6156 | "$P_CLI server_name=localhost dtls=1" \ |
| 6157 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6158 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6159 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6160 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6161 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6162 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6163 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6164 | "$P_SRV debug_level=3 dtls=1 \ |
| 6165 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6166 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6167 | "$P_CLI server_name=localhost dtls=1" \ |
| 6168 | 0 \ |
| 6169 | -s "parse ServerName extension" \ |
| 6170 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6171 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6172 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6173 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6174 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6175 | run_test "SNI: DTLS, matching cert 2" \ |
| 6176 | "$P_SRV debug_level=3 dtls=1 \ |
| 6177 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6178 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6179 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 6180 | 0 \ |
| 6181 | -s "parse ServerName extension" \ |
| 6182 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6183 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6184 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6185 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6186 | run_test "SNI: DTLS, no matching cert" \ |
| 6187 | "$P_SRV debug_level=3 dtls=1 \ |
| 6188 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6189 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6190 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 6191 | 1 \ |
| 6192 | -s "parse ServerName extension" \ |
| 6193 | -s "ssl_sni_wrapper() returned" \ |
| 6194 | -s "mbedtls_ssl_handshake returned" \ |
| 6195 | -c "mbedtls_ssl_handshake returned" \ |
| 6196 | -c "SSL - A fatal alert message was received from our peer" |
| 6197 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6198 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6199 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 6200 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6201 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6202 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 6203 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6204 | 0 \ |
| 6205 | -S "skip write certificate request" \ |
| 6206 | -C "skip parse certificate request" \ |
| 6207 | -c "got a certificate request" \ |
| 6208 | -C "skip write certificate" \ |
| 6209 | -C "skip write certificate verify" \ |
| 6210 | -S "skip parse certificate verify" |
| 6211 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6212 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6213 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6214 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 6215 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6216 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 6217 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6218 | 0 \ |
| 6219 | -S "skip write certificate request" \ |
| 6220 | -C "skip parse certificate request" \ |
| 6221 | -c "got a certificate request" \ |
| 6222 | -C "skip write certificate" \ |
| 6223 | -C "skip write certificate verify" \ |
| 6224 | -S "skip parse certificate verify" |
| 6225 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6226 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6227 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6228 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6229 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6230 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 6231 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6232 | 0 \ |
| 6233 | -s "skip write certificate request" \ |
| 6234 | -C "skip parse certificate request" \ |
| 6235 | -c "got no certificate request" \ |
| 6236 | -c "skip write certificate" \ |
| 6237 | -c "skip write certificate verify" \ |
| 6238 | -s "skip parse certificate verify" |
| 6239 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6240 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6241 | run_test "SNI: DTLS, CA no override" \ |
| 6242 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6243 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6244 | ca_file=data_files/test-ca.crt \ |
| 6245 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 6246 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6247 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6248 | 1 \ |
| 6249 | -S "skip write certificate request" \ |
| 6250 | -C "skip parse certificate request" \ |
| 6251 | -c "got a certificate request" \ |
| 6252 | -C "skip write certificate" \ |
| 6253 | -C "skip write certificate verify" \ |
| 6254 | -S "skip parse certificate verify" \ |
| 6255 | -s "x509_verify_cert() returned" \ |
| 6256 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6257 | -S "The certificate has been revoked (is on a CRL)" |
| 6258 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6259 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6260 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6261 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 6262 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6263 | ca_file=data_files/test-ca.crt \ |
| 6264 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 6265 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6266 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6267 | 0 \ |
| 6268 | -S "skip write certificate request" \ |
| 6269 | -C "skip parse certificate request" \ |
| 6270 | -c "got a certificate request" \ |
| 6271 | -C "skip write certificate" \ |
| 6272 | -C "skip write certificate verify" \ |
| 6273 | -S "skip parse certificate verify" \ |
| 6274 | -S "x509_verify_cert() returned" \ |
| 6275 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6276 | -S "The certificate has been revoked (is on a CRL)" |
| 6277 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6278 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6279 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6280 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 6281 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 6282 | ca_file=data_files/test-ca.crt \ |
| 6283 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 6284 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 6285 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 6286 | 1 \ |
| 6287 | -S "skip write certificate request" \ |
| 6288 | -C "skip parse certificate request" \ |
| 6289 | -c "got a certificate request" \ |
| 6290 | -C "skip write certificate" \ |
| 6291 | -C "skip write certificate verify" \ |
| 6292 | -S "skip parse certificate verify" \ |
| 6293 | -s "x509_verify_cert() returned" \ |
| 6294 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6295 | -s "The certificate has been revoked (is on a CRL)" |
| 6296 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6297 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6298 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6299 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6300 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6301 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6302 | "$P_CLI nbio=2 tickets=0" \ |
| 6303 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6304 | -S "mbedtls_ssl_handshake returned" \ |
| 6305 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6306 | -c "Read from server: .* bytes read" |
| 6307 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6308 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6309 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6310 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6311 | "$P_CLI nbio=2 tickets=0" \ |
| 6312 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6313 | -S "mbedtls_ssl_handshake returned" \ |
| 6314 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6315 | -c "Read from server: .* bytes read" |
| 6316 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6317 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6318 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6319 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6320 | "$P_CLI nbio=2 tickets=1" \ |
| 6321 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6322 | -S "mbedtls_ssl_handshake returned" \ |
| 6323 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6324 | -c "Read from server: .* bytes read" |
| 6325 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6326 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6327 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6328 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6329 | "$P_CLI nbio=2 tickets=1" \ |
| 6330 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6331 | -S "mbedtls_ssl_handshake returned" \ |
| 6332 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6333 | -c "Read from server: .* bytes read" |
| 6334 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6335 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6336 | run_test "Non-blocking I/O: TLS 1.2 + ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6337 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6338 | "$P_CLI force_version=tls12 nbio=2 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6339 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6340 | -S "mbedtls_ssl_handshake returned" \ |
| 6341 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6342 | -c "Read from server: .* bytes read" |
| 6343 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6344 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6345 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6346 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 6347 | run_test "Non-blocking I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6348 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6349 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6350 | 0 \ |
| 6351 | -S "mbedtls_ssl_handshake returned" \ |
| 6352 | -C "mbedtls_ssl_handshake returned" \ |
| 6353 | -c "Read from server: .* bytes read" |
| 6354 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6355 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6356 | run_test "Non-blocking I/O: TLS 1.2 + ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6357 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6358 | "$P_CLI force_version=tls12 nbio=2 tickets=1 reconnect=1" \ |
| 6359 | 0 \ |
| 6360 | -S "mbedtls_ssl_handshake returned" \ |
| 6361 | -C "mbedtls_ssl_handshake returned" \ |
| 6362 | -c "Read from server: .* bytes read" |
| 6363 | |
| 6364 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6365 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6366 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 6367 | run_test "Non-blocking I/O: TLS 1.3 + ticket + resume" \ |
| 6368 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6369 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6370 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6371 | -S "mbedtls_ssl_handshake returned" \ |
| 6372 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6373 | -c "Read from server: .* bytes read" |
| 6374 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6375 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6376 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6377 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6378 | "$P_CLI force_version=tls12 nbio=2 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6379 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6380 | -S "mbedtls_ssl_handshake returned" \ |
| 6381 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6382 | -c "Read from server: .* bytes read" |
| 6383 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6384 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 6385 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6386 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6387 | run_test "Event-driven I/O: basic handshake" \ |
| 6388 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6389 | "$P_CLI event=1 tickets=0" \ |
| 6390 | 0 \ |
| 6391 | -S "mbedtls_ssl_handshake returned" \ |
| 6392 | -C "mbedtls_ssl_handshake returned" \ |
| 6393 | -c "Read from server: .* bytes read" |
| 6394 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6395 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6396 | run_test "Event-driven I/O: client auth" \ |
| 6397 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 6398 | "$P_CLI event=1 tickets=0" \ |
| 6399 | 0 \ |
| 6400 | -S "mbedtls_ssl_handshake returned" \ |
| 6401 | -C "mbedtls_ssl_handshake returned" \ |
| 6402 | -c "Read from server: .* bytes read" |
| 6403 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6404 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6405 | run_test "Event-driven I/O: ticket" \ |
| 6406 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6407 | "$P_CLI event=1 tickets=1" \ |
| 6408 | 0 \ |
| 6409 | -S "mbedtls_ssl_handshake returned" \ |
| 6410 | -C "mbedtls_ssl_handshake returned" \ |
| 6411 | -c "Read from server: .* bytes read" |
| 6412 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6413 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6414 | run_test "Event-driven I/O: ticket + client auth" \ |
| 6415 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6416 | "$P_CLI event=1 tickets=1" \ |
| 6417 | 0 \ |
| 6418 | -S "mbedtls_ssl_handshake returned" \ |
| 6419 | -C "mbedtls_ssl_handshake returned" \ |
| 6420 | -c "Read from server: .* bytes read" |
| 6421 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6422 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6423 | run_test "Event-driven I/O: TLS 1.2 + ticket + client auth + resume" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6424 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6425 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6426 | 0 \ |
| 6427 | -S "mbedtls_ssl_handshake returned" \ |
| 6428 | -C "mbedtls_ssl_handshake returned" \ |
| 6429 | -c "Read from server: .* bytes read" |
| 6430 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6431 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6432 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6433 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 6434 | run_test "Event-driven I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6435 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6436 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6437 | 0 \ |
| 6438 | -S "mbedtls_ssl_handshake returned" \ |
| 6439 | -C "mbedtls_ssl_handshake returned" \ |
| 6440 | -c "Read from server: .* bytes read" |
| 6441 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6442 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6443 | run_test "Event-driven I/O: TLS 1.2 + ticket + resume" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6444 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6445 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
| 6446 | 0 \ |
| 6447 | -S "mbedtls_ssl_handshake returned" \ |
| 6448 | -C "mbedtls_ssl_handshake returned" \ |
| 6449 | -c "Read from server: .* bytes read" |
| 6450 | |
| 6451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6452 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6453 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 6454 | run_test "Event-driven I/O: TLS 1.3 + ticket + resume" \ |
| 6455 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6456 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6457 | 0 \ |
| 6458 | -S "mbedtls_ssl_handshake returned" \ |
| 6459 | -C "mbedtls_ssl_handshake returned" \ |
| 6460 | -c "Read from server: .* bytes read" |
| 6461 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6462 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6463 | run_test "Event-driven I/O: session-id resume" \ |
| 6464 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6465 | "$P_CLI force_version=tls12 event=1 tickets=0 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6466 | 0 \ |
| 6467 | -S "mbedtls_ssl_handshake returned" \ |
| 6468 | -C "mbedtls_ssl_handshake returned" \ |
| 6469 | -c "Read from server: .* bytes read" |
| 6470 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6471 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6472 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 6473 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 6474 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6475 | 0 \ |
| 6476 | -c "Read from server: .* bytes read" |
| 6477 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6479 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 6480 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 6481 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6482 | 0 \ |
| 6483 | -c "Read from server: .* bytes read" |
| 6484 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6485 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6486 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 6487 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 6488 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6489 | 0 \ |
| 6490 | -c "Read from server: .* bytes read" |
| 6491 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6492 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6493 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 6494 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 6495 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6496 | 0 \ |
| 6497 | -c "Read from server: .* bytes read" |
| 6498 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6499 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6500 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 6501 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 6502 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6503 | 0 \ |
| 6504 | -c "Read from server: .* bytes read" |
| 6505 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6506 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6507 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 6508 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 6509 | "$P_CLI dtls=1 event=1 tickets=1 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6510 | 0 \ |
| 6511 | -c "Read from server: .* bytes read" |
| 6512 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6513 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6514 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 6515 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 6516 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6517 | 0 \ |
| 6518 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6519 | |
| 6520 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 6521 | # During session resumption, the client will send its ApplicationData record |
| 6522 | # within the same datagram as the Finished messages. In this situation, the |
| 6523 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 6524 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6525 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6526 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6527 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6528 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 6529 | "$P_CLI dtls=1 event=1 tickets=0 reconnect=1 skip_close_notify=1" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6530 | 0 \ |
| 6531 | -c "Read from server: .* bytes read" |
| 6532 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6533 | # Tests for version negotiation |
| 6534 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6535 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6536 | "$P_SRV" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6537 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6538 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6539 | -S "mbedtls_ssl_handshake returned" \ |
| 6540 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 6541 | -s "Protocol is TLSv1.2" \ |
| 6542 | -c "Protocol is TLSv1.2" |
| 6543 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6545 | run_test "Not supported version check: cli TLS 1.0" \ |
| 6546 | "$P_SRV" \ |
| 6547 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 6548 | 1 \ |
| 6549 | -s "Handshake protocol not within min/max boundaries" \ |
| 6550 | -c "Error in protocol version" \ |
| 6551 | -S "Protocol is TLSv1.0" \ |
| 6552 | -C "Handshake was completed" |
| 6553 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6554 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6555 | run_test "Not supported version check: cli TLS 1.1" \ |
| 6556 | "$P_SRV" \ |
| 6557 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 6558 | 1 \ |
| 6559 | -s "Handshake protocol not within min/max boundaries" \ |
| 6560 | -c "Error in protocol version" \ |
| 6561 | -S "Protocol is TLSv1.1" \ |
| 6562 | -C "Handshake was completed" |
| 6563 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6565 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 6566 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 6567 | "$P_CLI" \ |
| 6568 | 1 \ |
| 6569 | -s "Error in protocol version" \ |
| 6570 | -c "Handshake protocol not within min/max boundaries" \ |
| 6571 | -S "Version: TLS1.0" \ |
| 6572 | -C "Protocol is TLSv1.0" |
| 6573 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6574 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 6575 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 6576 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 6577 | "$P_CLI" \ |
| 6578 | 1 \ |
| 6579 | -s "Error in protocol version" \ |
| 6580 | -c "Handshake protocol not within min/max boundaries" \ |
| 6581 | -S "Version: TLS1.1" \ |
| 6582 | -C "Protocol is TLSv1.1" |
| 6583 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6584 | # Tests for ALPN extension |
| 6585 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6586 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6587 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6588 | "$P_SRV debug_level=3" \ |
| 6589 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6590 | 0 \ |
| 6591 | -C "client hello, adding alpn extension" \ |
| 6592 | -S "found alpn extension" \ |
| 6593 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6594 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6595 | -C "found alpn extension " \ |
| 6596 | -C "Application Layer Protocol is" \ |
| 6597 | -S "Application Layer Protocol is" |
| 6598 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6599 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6600 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6601 | "$P_SRV debug_level=3" \ |
| 6602 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6603 | 0 \ |
| 6604 | -c "client hello, adding alpn extension" \ |
| 6605 | -s "found alpn extension" \ |
| 6606 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6607 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6608 | -C "found alpn extension " \ |
| 6609 | -c "Application Layer Protocol is (none)" \ |
| 6610 | -S "Application Layer Protocol is" |
| 6611 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6612 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6613 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6614 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6615 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6616 | 0 \ |
| 6617 | -C "client hello, adding alpn extension" \ |
| 6618 | -S "found alpn extension" \ |
| 6619 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6620 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6621 | -C "found alpn extension " \ |
| 6622 | -C "Application Layer Protocol is" \ |
| 6623 | -s "Application Layer Protocol is (none)" |
| 6624 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6625 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6626 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6627 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6628 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6629 | 0 \ |
| 6630 | -c "client hello, adding alpn extension" \ |
| 6631 | -s "found alpn extension" \ |
| 6632 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6633 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6634 | -c "found alpn extension" \ |
| 6635 | -c "Application Layer Protocol is abc" \ |
| 6636 | -s "Application Layer Protocol is abc" |
| 6637 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6638 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6639 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6640 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6641 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6642 | 0 \ |
| 6643 | -c "client hello, adding alpn extension" \ |
| 6644 | -s "found alpn extension" \ |
| 6645 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6646 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6647 | -c "found alpn extension" \ |
| 6648 | -c "Application Layer Protocol is abc" \ |
| 6649 | -s "Application Layer Protocol is abc" |
| 6650 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6651 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6652 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6653 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 6654 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6655 | 0 \ |
| 6656 | -c "client hello, adding alpn extension" \ |
| 6657 | -s "found alpn extension" \ |
| 6658 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6659 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6660 | -c "found alpn extension" \ |
| 6661 | -c "Application Layer Protocol is 1234" \ |
| 6662 | -s "Application Layer Protocol is 1234" |
| 6663 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6664 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6665 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6666 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 6667 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6668 | 1 \ |
| 6669 | -c "client hello, adding alpn extension" \ |
| 6670 | -s "found alpn extension" \ |
| 6671 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 6672 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 6673 | -C "found alpn extension" \ |
| 6674 | -C "Application Layer Protocol is 1234" \ |
| 6675 | -S "Application Layer Protocol is 1234" |
| 6676 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 6677 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6678 | # Tests for keyUsage in leaf certificates, part 1: |
| 6679 | # server-side certificate/suite selection |
| 6680 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6681 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6682 | "$P_SRV force_version=tls12 key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6683 | crt_file=data_files/server2.ku-ds.crt" \ |
| 6684 | "$P_CLI" \ |
| 6685 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 6686 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6687 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6688 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6689 | "$P_SRV force_version=tls12 key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6690 | crt_file=data_files/server2.ku-ke.crt" \ |
| 6691 | "$P_CLI" \ |
| 6692 | 0 \ |
| 6693 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 6694 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6695 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6696 | "$P_SRV force_version=tls12 key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6697 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6698 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6699 | 1 \ |
| 6700 | -C "Ciphersuite is " |
| 6701 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 6702 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6703 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6704 | "$P_SRV force_version=tls12 key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6705 | crt_file=data_files/server5.ku-ds.crt" \ |
| 6706 | "$P_CLI" \ |
| 6707 | 0 \ |
| 6708 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 6709 | |
| 6710 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6711 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6712 | "$P_SRV force_version=tls12 key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6713 | crt_file=data_files/server5.ku-ka.crt" \ |
| 6714 | "$P_CLI" \ |
| 6715 | 0 \ |
| 6716 | -c "Ciphersuite is TLS-ECDH-" |
| 6717 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6718 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6719 | "$P_SRV force_version=tls12 key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6720 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 6721 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6722 | 1 \ |
| 6723 | -C "Ciphersuite is " |
| 6724 | |
| 6725 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6726 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6727 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6728 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6729 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6730 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6731 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6732 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6733 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6734 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6735 | -C "Processing of the Certificate handshake message failed" \ |
| 6736 | -c "Ciphersuite is TLS-" |
| 6737 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6738 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6739 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6740 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6741 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6742 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6743 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6744 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6745 | -C "Processing of the Certificate handshake message failed" \ |
| 6746 | -c "Ciphersuite is TLS-" |
| 6747 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6748 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6749 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6750 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6751 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6752 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6753 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6754 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6755 | -C "Processing of the Certificate handshake message failed" \ |
| 6756 | -c "Ciphersuite is TLS-" |
| 6757 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6758 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6759 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6760 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6761 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6762 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6763 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6764 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6765 | -c "Processing of the Certificate handshake message failed" \ |
| 6766 | -C "Ciphersuite is TLS-" |
| 6767 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6768 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6769 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6770 | -cert data_files/server2.ku-ke.crt" \ |
| 6771 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6772 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6773 | 0 \ |
| 6774 | -c "bad certificate (usage extensions)" \ |
| 6775 | -C "Processing of the Certificate handshake message failed" \ |
| 6776 | -c "Ciphersuite is TLS-" \ |
| 6777 | -c "! Usage does not match the keyUsage extension" |
| 6778 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6779 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6780 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6781 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6782 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6783 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 6784 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6785 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6786 | -C "Processing of the Certificate handshake message failed" \ |
| 6787 | -c "Ciphersuite is TLS-" |
| 6788 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6789 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6790 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6791 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6792 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6793 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6794 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6795 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 6796 | -c "Processing of the Certificate handshake message failed" \ |
| 6797 | -C "Ciphersuite is TLS-" |
| 6798 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6799 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6800 | "$O_SRV -tls1_2 -key data_files/server2.key \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 6801 | -cert data_files/server2.ku-ds.crt" \ |
| 6802 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 6803 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6804 | 0 \ |
| 6805 | -c "bad certificate (usage extensions)" \ |
| 6806 | -C "Processing of the Certificate handshake message failed" \ |
| 6807 | -c "Ciphersuite is TLS-" \ |
| 6808 | -c "! Usage does not match the keyUsage extension" |
| 6809 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 6810 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6811 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6812 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6813 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
| 6814 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6815 | -cert data_files/server2.ku-ds_ke.crt" \ |
| 6816 | "$P_CLI debug_level=3" \ |
| 6817 | 0 \ |
| 6818 | -C "bad certificate (usage extensions)" \ |
| 6819 | -C "Processing of the Certificate handshake message failed" \ |
| 6820 | -c "Ciphersuite is" |
| 6821 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 6822 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6823 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6824 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6825 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6826 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6827 | -cert data_files/server2.ku-ke.crt" \ |
| 6828 | "$P_CLI debug_level=1" \ |
| 6829 | 1 \ |
| 6830 | -c "bad certificate (usage extensions)" \ |
| 6831 | -c "Processing of the Certificate handshake message failed" \ |
| 6832 | -C "Ciphersuite is" |
| 6833 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 6834 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6835 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6836 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6837 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6838 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server2.key \ |
| 6839 | -cert data_files/server2.ku-ka.crt" \ |
| 6840 | "$P_CLI debug_level=1" \ |
| 6841 | 1 \ |
| 6842 | -c "bad certificate (usage extensions)" \ |
| 6843 | -c "Processing of the Certificate handshake message failed" \ |
| 6844 | -C "Ciphersuite is" |
| 6845 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 6846 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6847 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6848 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6849 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
| 6850 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6851 | -cert data_files/server5.ku-ds.crt" \ |
| 6852 | "$P_CLI debug_level=3" \ |
| 6853 | 0 \ |
| 6854 | -C "bad certificate (usage extensions)" \ |
| 6855 | -C "Processing of the Certificate handshake message failed" \ |
| 6856 | -c "Ciphersuite is" |
| 6857 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 6858 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6859 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6860 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6861 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6862 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6863 | -cert data_files/server5.ku-ke.crt" \ |
| 6864 | "$P_CLI debug_level=1" \ |
| 6865 | 1 \ |
| 6866 | -c "bad certificate (usage extensions)" \ |
| 6867 | -c "Processing of the Certificate handshake message failed" \ |
| 6868 | -C "Ciphersuite is" |
| 6869 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 6870 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6871 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6872 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | ba65fbb | 2022-06-22 14:35:05 +0200 | [diff] [blame] | 6873 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6874 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 6875 | -cert data_files/server5.ku-ka.crt" \ |
| 6876 | "$P_CLI debug_level=1" \ |
| 6877 | 1 \ |
| 6878 | -c "bad certificate (usage extensions)" \ |
| 6879 | -c "Processing of the Certificate handshake message failed" \ |
| 6880 | -C "Ciphersuite is" |
| 6881 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6882 | # Tests for keyUsage in leaf certificates, part 3: |
| 6883 | # server-side checking of client cert |
| 6884 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6885 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6886 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6887 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6888 | "$O_CLI -key data_files/server2.key \ |
| 6889 | -cert data_files/server2.ku-ds.crt" \ |
| 6890 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6891 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6892 | -S "bad certificate (usage extensions)" \ |
| 6893 | -S "Processing of the Certificate handshake message failed" |
| 6894 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6895 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6896 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6897 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6898 | "$O_CLI -key data_files/server2.key \ |
| 6899 | -cert data_files/server2.ku-ke.crt" \ |
| 6900 | 0 \ |
| 6901 | -s "bad certificate (usage extensions)" \ |
| 6902 | -S "Processing of the Certificate handshake message failed" |
| 6903 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6905 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6906 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6907 | "$O_CLI -key data_files/server2.key \ |
| 6908 | -cert data_files/server2.ku-ke.crt" \ |
| 6909 | 1 \ |
| 6910 | -s "bad certificate (usage extensions)" \ |
| 6911 | -s "Processing of the Certificate handshake message failed" |
| 6912 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6913 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6914 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6915 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6916 | "$O_CLI -key data_files/server5.key \ |
| 6917 | -cert data_files/server5.ku-ds.crt" \ |
| 6918 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6919 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6920 | -S "bad certificate (usage extensions)" \ |
| 6921 | -S "Processing of the Certificate handshake message failed" |
| 6922 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6923 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6924 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6925 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 6926 | "$O_CLI -key data_files/server5.key \ |
| 6927 | -cert data_files/server5.ku-ka.crt" \ |
| 6928 | 0 \ |
| 6929 | -s "bad certificate (usage extensions)" \ |
| 6930 | -S "Processing of the Certificate handshake message failed" |
| 6931 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 6932 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6933 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6934 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6935 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6936 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6937 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6938 | -cert data_files/server2.ku-ds.crt" \ |
| 6939 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6940 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6941 | -S "bad certificate (usage extensions)" \ |
| 6942 | -S "Processing of the Certificate handshake message failed" |
| 6943 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 6944 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6945 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6946 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6947 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6948 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6949 | "$O_NEXT_CLI_NO_CERT -key data_files/server2.key \ |
| 6950 | -cert data_files/server2.ku-ke.crt" \ |
| 6951 | 0 \ |
| 6952 | -s "bad certificate (usage extensions)" \ |
| 6953 | -S "Processing of the Certificate handshake message failed" |
| 6954 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 6955 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6956 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6957 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6958 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6959 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6960 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6961 | -cert data_files/server5.ku-ds.crt" \ |
| 6962 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 6963 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6964 | -S "bad certificate (usage extensions)" \ |
| 6965 | -S "Processing of the Certificate handshake message failed" |
| 6966 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 6967 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 6968 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 6969 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6970 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 6971 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 6972 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 6973 | -cert data_files/server5.ku-ka.crt" \ |
| 6974 | 0 \ |
| 6975 | -s "bad certificate (usage extensions)" \ |
| 6976 | -S "Processing of the Certificate handshake message failed" |
| 6977 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6978 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 6979 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6980 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6981 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6982 | "$P_SRV key_file=data_files/server5.key \ |
| 6983 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6984 | "$P_CLI" \ |
| 6985 | 0 |
| 6986 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6987 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6988 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6989 | "$P_SRV key_file=data_files/server5.key \ |
| 6990 | crt_file=data_files/server5.eku-srv.crt" \ |
| 6991 | "$P_CLI" \ |
| 6992 | 0 |
| 6993 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6994 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6995 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 6996 | "$P_SRV key_file=data_files/server5.key \ |
| 6997 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 6998 | "$P_CLI" \ |
| 6999 | 0 |
| 7000 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 7001 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7002 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 7003 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7004 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 7005 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7006 | 1 |
| 7007 | |
| 7008 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 7009 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7010 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7011 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 7012 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7013 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7014 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7015 | 0 \ |
| 7016 | -C "bad certificate (usage extensions)" \ |
| 7017 | -C "Processing of the Certificate handshake message failed" \ |
| 7018 | -c "Ciphersuite is TLS-" |
| 7019 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7020 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7021 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 7022 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7023 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7024 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7025 | 0 \ |
| 7026 | -C "bad certificate (usage extensions)" \ |
| 7027 | -C "Processing of the Certificate handshake message failed" \ |
| 7028 | -c "Ciphersuite is TLS-" |
| 7029 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7030 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7031 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 7032 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7033 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7034 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7035 | 0 \ |
| 7036 | -C "bad certificate (usage extensions)" \ |
| 7037 | -C "Processing of the Certificate handshake message failed" \ |
| 7038 | -c "Ciphersuite is TLS-" |
| 7039 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7040 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7041 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 7042 | "$O_SRV -tls1_2 -key data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7043 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7044 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7045 | 1 \ |
| 7046 | -c "bad certificate (usage extensions)" \ |
| 7047 | -c "Processing of the Certificate handshake message failed" \ |
| 7048 | -C "Ciphersuite is TLS-" |
| 7049 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7050 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7051 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7052 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7053 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
| 7054 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7055 | -cert data_files/server5.eku-srv.crt" \ |
| 7056 | "$P_CLI debug_level=1" \ |
| 7057 | 0 \ |
| 7058 | -C "bad certificate (usage extensions)" \ |
| 7059 | -C "Processing of the Certificate handshake message failed" \ |
| 7060 | -c "Ciphersuite is" |
| 7061 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7062 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7063 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7064 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7065 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
| 7066 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7067 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 7068 | "$P_CLI debug_level=1" \ |
| 7069 | 0 \ |
| 7070 | -C "bad certificate (usage extensions)" \ |
| 7071 | -C "Processing of the Certificate handshake message failed" \ |
| 7072 | -c "Ciphersuite is" |
| 7073 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7074 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7075 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7076 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7077 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
| 7078 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7079 | -cert data_files/server5.eku-cs_any.crt" \ |
| 7080 | "$P_CLI debug_level=1" \ |
| 7081 | 0 \ |
| 7082 | -C "bad certificate (usage extensions)" \ |
| 7083 | -C "Processing of the Certificate handshake message failed" \ |
| 7084 | -c "Ciphersuite is" |
| 7085 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7086 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7087 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7088 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7089 | run_test "extKeyUsage cli 1.3: codeSign -> fail" \ |
| 7090 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key data_files/server5.key \ |
| 7091 | -cert data_files/server5.eku-cs.crt" \ |
| 7092 | "$P_CLI debug_level=1" \ |
| 7093 | 1 \ |
| 7094 | -c "bad certificate (usage extensions)" \ |
| 7095 | -c "Processing of the Certificate handshake message failed" \ |
| 7096 | -C "Ciphersuite is" |
| 7097 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7098 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 7099 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7100 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7101 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7102 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7103 | "$O_CLI -key data_files/server5.key \ |
| 7104 | -cert data_files/server5.eku-cli.crt" \ |
| 7105 | 0 \ |
| 7106 | -S "bad certificate (usage extensions)" \ |
| 7107 | -S "Processing of the Certificate handshake message failed" |
| 7108 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7109 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7110 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7111 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7112 | "$O_CLI -key data_files/server5.key \ |
| 7113 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 7114 | 0 \ |
| 7115 | -S "bad certificate (usage extensions)" \ |
| 7116 | -S "Processing of the Certificate handshake message failed" |
| 7117 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7118 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7119 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7120 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7121 | "$O_CLI -key data_files/server5.key \ |
| 7122 | -cert data_files/server5.eku-cs_any.crt" \ |
| 7123 | 0 \ |
| 7124 | -S "bad certificate (usage extensions)" \ |
| 7125 | -S "Processing of the Certificate handshake message failed" |
| 7126 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7127 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7128 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7129 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7130 | "$O_CLI -key data_files/server5.key \ |
| 7131 | -cert data_files/server5.eku-cs.crt" \ |
| 7132 | 0 \ |
| 7133 | -s "bad certificate (usage extensions)" \ |
| 7134 | -S "Processing of the Certificate handshake message failed" |
| 7135 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7136 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7137 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7138 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 7139 | "$O_CLI -key data_files/server5.key \ |
| 7140 | -cert data_files/server5.eku-cs.crt" \ |
| 7141 | 1 \ |
| 7142 | -s "bad certificate (usage extensions)" \ |
| 7143 | -s "Processing of the Certificate handshake message failed" |
| 7144 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7145 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7146 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7147 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7148 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7149 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7150 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7151 | -cert data_files/server5.eku-cli.crt" \ |
| 7152 | 0 \ |
| 7153 | -S "bad certificate (usage extensions)" \ |
| 7154 | -S "Processing of the Certificate handshake message failed" |
| 7155 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7156 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7157 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7158 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7159 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7160 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7161 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7162 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 7163 | 0 \ |
| 7164 | -S "bad certificate (usage extensions)" \ |
| 7165 | -S "Processing of the Certificate handshake message failed" |
| 7166 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7167 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7168 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7169 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7170 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7171 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7172 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7173 | -cert data_files/server5.eku-cs_any.crt" \ |
| 7174 | 0 \ |
| 7175 | -S "bad certificate (usage extensions)" \ |
| 7176 | -S "Processing of the Certificate handshake message failed" |
| 7177 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7178 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7179 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7180 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7181 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7182 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7183 | "$O_NEXT_CLI_NO_CERT -key data_files/server5.key \ |
| 7184 | -cert data_files/server5.eku-cs.crt" \ |
| 7185 | 0 \ |
| 7186 | -s "bad certificate (usage extensions)" \ |
| 7187 | -S "Processing of the Certificate handshake message failed" |
| 7188 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7189 | # Tests for DHM parameters loading |
| 7190 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7191 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7192 | "$P_SRV" \ |
| 7193 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7194 | debug_level=3" \ |
| 7195 | 0 \ |
| 7196 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 7197 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7198 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7199 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7200 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 7201 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7202 | debug_level=3" \ |
| 7203 | 0 \ |
| 7204 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 7205 | -c "value of 'DHM: G ' (2 bits)" |
| 7206 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7207 | # Tests for DHM client-side size checking |
| 7208 | |
| 7209 | run_test "DHM size: server default, client default, OK" \ |
| 7210 | "$P_SRV" \ |
| 7211 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7212 | debug_level=1" \ |
| 7213 | 0 \ |
| 7214 | -C "DHM prime too short:" |
| 7215 | |
| 7216 | run_test "DHM size: server default, client 2048, OK" \ |
| 7217 | "$P_SRV" \ |
| 7218 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7219 | debug_level=1 dhmlen=2048" \ |
| 7220 | 0 \ |
| 7221 | -C "DHM prime too short:" |
| 7222 | |
| 7223 | run_test "DHM size: server 1024, client default, OK" \ |
| 7224 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 7225 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7226 | debug_level=1" \ |
| 7227 | 0 \ |
| 7228 | -C "DHM prime too short:" |
| 7229 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7230 | run_test "DHM size: server 999, client 999, OK" \ |
| 7231 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 7232 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7233 | debug_level=1 dhmlen=999" \ |
| 7234 | 0 \ |
| 7235 | -C "DHM prime too short:" |
| 7236 | |
| 7237 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 7238 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7239 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7240 | debug_level=1 dhmlen=1000" \ |
| 7241 | 0 \ |
| 7242 | -C "DHM prime too short:" |
| 7243 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7244 | run_test "DHM size: server 1000, client default, rejected" \ |
| 7245 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7246 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7247 | debug_level=1" \ |
| 7248 | 1 \ |
| 7249 | -c "DHM prime too short:" |
| 7250 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 7251 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 7252 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 7253 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7254 | debug_level=1 dhmlen=1001" \ |
| 7255 | 1 \ |
| 7256 | -c "DHM prime too short:" |
| 7257 | |
| 7258 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 7259 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 7260 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7261 | debug_level=1 dhmlen=1000" \ |
| 7262 | 1 \ |
| 7263 | -c "DHM prime too short:" |
| 7264 | |
| 7265 | run_test "DHM size: server 998, client 999, rejected" \ |
| 7266 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 7267 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7268 | debug_level=1 dhmlen=999" \ |
| 7269 | 1 \ |
| 7270 | -c "DHM prime too short:" |
| 7271 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 7272 | run_test "DHM size: server default, client 2049, rejected" \ |
| 7273 | "$P_SRV" \ |
| 7274 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 7275 | debug_level=1 dhmlen=2049" \ |
| 7276 | 1 \ |
| 7277 | -c "DHM prime too short:" |
| 7278 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7279 | # Tests for PSK callback |
| 7280 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7281 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7282 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 7283 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7284 | psk_identity=foo psk=abc123" \ |
| 7285 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7286 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7287 | -S "SSL - Unknown identity received" \ |
| 7288 | -S "SSL - Verification of the message MAC failed" |
| 7289 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7290 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7291 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 7292 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7293 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 7294 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7295 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7296 | -C "session hash for extended master secret"\ |
| 7297 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7298 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7299 | -S "SSL - Unknown identity received" \ |
| 7300 | -S "SSL - Verification of the message MAC failed" |
| 7301 | |
| 7302 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7303 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 7304 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7305 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 7306 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7307 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7308 | -C "session hash for extended master secret"\ |
| 7309 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7310 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7311 | -S "SSL - Unknown identity received" \ |
| 7312 | -S "SSL - Verification of the message MAC failed" |
| 7313 | |
| 7314 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7315 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 7316 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7317 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 7318 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7319 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7320 | -c "session hash for extended master secret"\ |
| 7321 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7322 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7323 | -S "SSL - Unknown identity received" \ |
| 7324 | -S "SSL - Verification of the message MAC failed" |
| 7325 | |
| 7326 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7327 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 7328 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7329 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 7330 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7331 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7332 | -c "session hash for extended master secret"\ |
| 7333 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7334 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 7335 | -S "SSL - Unknown identity received" \ |
| 7336 | -S "SSL - Verification of the message MAC failed" |
| 7337 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7338 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7339 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
| 7340 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7341 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7342 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7343 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7344 | -C "session hash for extended master secret"\ |
| 7345 | -S "session hash for extended master secret"\ |
| 7346 | -S "SSL - The handshake negotiation failed" \ |
| 7347 | -S "SSL - Unknown identity received" \ |
| 7348 | -S "SSL - Verification of the message MAC failed" |
| 7349 | |
| 7350 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7351 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \ |
| 7352 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7353 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7354 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7355 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7356 | -C "session hash for extended master secret"\ |
| 7357 | -S "session hash for extended master secret"\ |
| 7358 | -S "SSL - The handshake negotiation failed" \ |
| 7359 | -S "SSL - Unknown identity received" \ |
| 7360 | -S "SSL - Verification of the message MAC failed" |
| 7361 | |
| 7362 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7363 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
| 7364 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7365 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7366 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7367 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7368 | -c "session hash for extended master secret"\ |
| 7369 | -s "session hash for extended master secret"\ |
| 7370 | -S "SSL - The handshake negotiation failed" \ |
| 7371 | -S "SSL - Unknown identity received" \ |
| 7372 | -S "SSL - Verification of the message MAC failed" |
| 7373 | |
| 7374 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7375 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \ |
| 7376 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7377 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7378 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7379 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 7380 | -c "session hash for extended master secret"\ |
| 7381 | -s "session hash for extended master secret"\ |
| 7382 | -S "SSL - The handshake negotiation failed" \ |
| 7383 | -S "SSL - Unknown identity received" \ |
| 7384 | -S "SSL - Verification of the message MAC failed" |
| 7385 | |
| 7386 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7387 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
| 7388 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7389 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7390 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7391 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7392 | -C "session hash for extended master secret"\ |
| 7393 | -S "session hash for extended master secret"\ |
| 7394 | -S "SSL - The handshake negotiation failed" \ |
| 7395 | -S "SSL - Unknown identity received" \ |
| 7396 | -S "SSL - Verification of the message MAC failed" |
| 7397 | |
| 7398 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7399 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \ |
| 7400 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7401 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7402 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7403 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7404 | -C "session hash for extended master secret"\ |
| 7405 | -S "session hash for extended master secret"\ |
| 7406 | -S "SSL - The handshake negotiation failed" \ |
| 7407 | -S "SSL - Unknown identity received" \ |
| 7408 | -S "SSL - Verification of the message MAC failed" |
| 7409 | |
| 7410 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7411 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
| 7412 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7413 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7414 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7415 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7416 | -c "session hash for extended master secret"\ |
| 7417 | -s "session hash for extended master secret"\ |
| 7418 | -S "SSL - The handshake negotiation failed" \ |
| 7419 | -S "SSL - Unknown identity received" \ |
| 7420 | -S "SSL - Verification of the message MAC failed" |
| 7421 | |
| 7422 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7423 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \ |
| 7424 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7425 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7426 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7427 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7428 | -c "session hash for extended master secret"\ |
| 7429 | -s "session hash for extended master secret"\ |
| 7430 | -S "SSL - The handshake negotiation failed" \ |
| 7431 | -S "SSL - Unknown identity received" \ |
| 7432 | -S "SSL - Verification of the message MAC failed" |
| 7433 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7434 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7435 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
| 7436 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7437 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7438 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7439 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7440 | -C "session hash for extended master secret"\ |
| 7441 | -S "session hash for extended master secret"\ |
| 7442 | -S "SSL - The handshake negotiation failed" \ |
| 7443 | -S "SSL - Unknown identity received" \ |
| 7444 | -S "SSL - Verification of the message MAC failed" |
| 7445 | |
| 7446 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7447 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \ |
| 7448 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 7449 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7450 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7451 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7452 | -C "session hash for extended master secret"\ |
| 7453 | -S "session hash for extended master secret"\ |
| 7454 | -S "SSL - The handshake negotiation failed" \ |
| 7455 | -S "SSL - Unknown identity received" \ |
| 7456 | -S "SSL - Verification of the message MAC failed" |
| 7457 | |
| 7458 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7459 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
| 7460 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7461 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7462 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7463 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7464 | -c "session hash for extended master secret"\ |
| 7465 | -s "session hash for extended master secret"\ |
| 7466 | -S "SSL - The handshake negotiation failed" \ |
| 7467 | -S "SSL - Unknown identity received" \ |
| 7468 | -S "SSL - Verification of the message MAC failed" |
| 7469 | |
| 7470 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7471 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \ |
| 7472 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 7473 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7474 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
| 7475 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7476 | -c "session hash for extended master secret"\ |
| 7477 | -s "session hash for extended master secret"\ |
| 7478 | -S "SSL - The handshake negotiation failed" \ |
| 7479 | -S "SSL - Unknown identity received" \ |
| 7480 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7481 | |
| 7482 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7483 | run_test "PSK callback: raw psk on client, static opaque on server, no callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7484 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 7485 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7486 | psk_identity=foo psk=abc123" \ |
| 7487 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7488 | -C "session hash for extended master secret"\ |
| 7489 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7490 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7491 | -S "SSL - Unknown identity received" \ |
| 7492 | -S "SSL - Verification of the message MAC failed" |
| 7493 | |
| 7494 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7495 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7496 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7497 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7498 | psk_identity=foo psk=abc123" \ |
| 7499 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7500 | -C "session hash for extended master secret"\ |
| 7501 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7502 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7503 | -S "SSL - Unknown identity received" \ |
| 7504 | -S "SSL - Verification of the message MAC failed" |
| 7505 | |
| 7506 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7507 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7508 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7509 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7510 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7511 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7512 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7513 | -c "session hash for extended master secret"\ |
| 7514 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7515 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7516 | -S "SSL - Unknown identity received" \ |
| 7517 | -S "SSL - Verification of the message MAC failed" |
| 7518 | |
| 7519 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7520 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7521 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7522 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7523 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7524 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7525 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7526 | -c "session hash for extended master secret"\ |
| 7527 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7528 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7529 | -S "SSL - Unknown identity received" \ |
| 7530 | -S "SSL - Verification of the message MAC failed" |
| 7531 | |
| 7532 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7533 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \ |
| 7534 | "$P_SRV extended_ms=0 debug_level=5 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \ |
| 7535 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7536 | psk_identity=foo psk=abc123" \ |
| 7537 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7538 | -C "session hash for extended master secret"\ |
| 7539 | -S "session hash for extended master secret"\ |
| 7540 | -S "SSL - The handshake negotiation failed" \ |
| 7541 | -S "SSL - Unknown identity received" \ |
| 7542 | -S "SSL - Verification of the message MAC failed" |
| 7543 | |
| 7544 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7545 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7546 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7547 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7548 | psk_identity=foo psk=abc123" \ |
| 7549 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7550 | -C "session hash for extended master secret"\ |
| 7551 | -S "session hash for extended master secret"\ |
| 7552 | -S "SSL - The handshake negotiation failed" \ |
| 7553 | -S "SSL - Unknown identity received" \ |
| 7554 | -S "SSL - Verification of the message MAC failed" |
| 7555 | |
| 7556 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7557 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \ |
| 7558 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7559 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7560 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7561 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7562 | 0 \ |
| 7563 | -c "session hash for extended master secret"\ |
| 7564 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7565 | -S "SSL - The handshake negotiation failed" \ |
| 7566 | -S "SSL - Unknown identity received" \ |
| 7567 | -S "SSL - Verification of the message MAC failed" |
| 7568 | |
| 7569 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7570 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7571 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7572 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7573 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7574 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7575 | 0 \ |
| 7576 | -c "session hash for extended master secret"\ |
| 7577 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7578 | -S "SSL - The handshake negotiation failed" \ |
| 7579 | -S "SSL - Unknown identity received" \ |
| 7580 | -S "SSL - Verification of the message MAC failed" |
| 7581 | |
| 7582 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7583 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \ |
| 7584 | "$P_SRV extended_ms=0 debug_level=5 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 7585 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7586 | psk_identity=foo psk=abc123" \ |
| 7587 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7588 | -C "session hash for extended master secret"\ |
| 7589 | -S "session hash for extended master secret"\ |
| 7590 | -S "SSL - The handshake negotiation failed" \ |
| 7591 | -S "SSL - Unknown identity received" \ |
| 7592 | -S "SSL - Verification of the message MAC failed" |
| 7593 | |
| 7594 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7595 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7596 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7597 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7598 | psk_identity=foo psk=abc123" \ |
| 7599 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7600 | -C "session hash for extended master secret"\ |
| 7601 | -S "session hash for extended master secret"\ |
| 7602 | -S "SSL - The handshake negotiation failed" \ |
| 7603 | -S "SSL - Unknown identity received" \ |
| 7604 | -S "SSL - Verification of the message MAC failed" |
| 7605 | |
| 7606 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7607 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7608 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7609 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7610 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7611 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7612 | 0 \ |
| 7613 | -c "session hash for extended master secret"\ |
| 7614 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7615 | -S "SSL - The handshake negotiation failed" \ |
| 7616 | -S "SSL - Unknown identity received" \ |
| 7617 | -S "SSL - Verification of the message MAC failed" |
| 7618 | |
| 7619 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7620 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7621 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7622 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7623 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7624 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7625 | 0 \ |
| 7626 | -c "session hash for extended master secret"\ |
| 7627 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7628 | -S "SSL - The handshake negotiation failed" \ |
| 7629 | -S "SSL - Unknown identity received" \ |
| 7630 | -S "SSL - Verification of the message MAC failed" |
| 7631 | |
| 7632 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7633 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \ |
| 7634 | "$P_SRV extended_ms=0 debug_level=5 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 7635 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7636 | psk_identity=foo psk=abc123" \ |
| 7637 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7638 | -C "session hash for extended master secret"\ |
| 7639 | -S "session hash for extended master secret"\ |
| 7640 | -S "SSL - The handshake negotiation failed" \ |
| 7641 | -S "SSL - Unknown identity received" \ |
| 7642 | -S "SSL - Verification of the message MAC failed" |
| 7643 | |
| 7644 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7645 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \ |
| 7646 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7647 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7648 | psk_identity=foo psk=abc123" \ |
| 7649 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7650 | -C "session hash for extended master secret"\ |
| 7651 | -S "session hash for extended master secret"\ |
| 7652 | -S "SSL - The handshake negotiation failed" \ |
| 7653 | -S "SSL - Unknown identity received" \ |
| 7654 | -S "SSL - Verification of the message MAC failed" |
| 7655 | |
| 7656 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7657 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \ |
| 7658 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7659 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7660 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7661 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7662 | 0 \ |
| 7663 | -c "session hash for extended master secret"\ |
| 7664 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7665 | -S "SSL - The handshake negotiation failed" \ |
| 7666 | -S "SSL - Unknown identity received" \ |
| 7667 | -S "SSL - Verification of the message MAC failed" |
| 7668 | |
| 7669 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7670 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
| 7671 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
| 7672 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7673 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7674 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 7675 | 0 \ |
| 7676 | -c "session hash for extended master secret"\ |
| 7677 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7678 | -S "SSL - The handshake negotiation failed" \ |
| 7679 | -S "SSL - Unknown identity received" \ |
| 7680 | -S "SSL - Verification of the message MAC failed" |
| 7681 | |
| 7682 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7683 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7684 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 7685 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7686 | psk_identity=def psk=beef" \ |
| 7687 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7688 | -C "session hash for extended master secret"\ |
| 7689 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7690 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7691 | -S "SSL - Unknown identity received" \ |
| 7692 | -S "SSL - Verification of the message MAC failed" |
| 7693 | |
| 7694 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7695 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, SHA-384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7696 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7697 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7698 | psk_identity=def psk=beef" \ |
| 7699 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7700 | -C "session hash for extended master secret"\ |
| 7701 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7702 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7703 | -S "SSL - Unknown identity received" \ |
| 7704 | -S "SSL - Verification of the message MAC failed" |
| 7705 | |
| 7706 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7707 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7708 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7709 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7710 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7711 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7712 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7713 | -c "session hash for extended master secret"\ |
| 7714 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7715 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7716 | -S "SSL - Unknown identity received" \ |
| 7717 | -S "SSL - Verification of the message MAC failed" |
| 7718 | |
| 7719 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7720 | run_test "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS, SHA384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7721 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7722 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7723 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7724 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7725 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7726 | -c "session hash for extended master secret"\ |
| 7727 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7728 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7729 | -S "SSL - Unknown identity received" \ |
| 7730 | -S "SSL - Verification of the message MAC failed" |
| 7731 | |
| 7732 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7733 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 7734 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \ |
| 7735 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7736 | psk_identity=def psk=beef" \ |
| 7737 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7738 | -C "session hash for extended master secret"\ |
| 7739 | -S "session hash for extended master secret"\ |
| 7740 | -S "SSL - The handshake negotiation failed" \ |
| 7741 | -S "SSL - Unknown identity received" \ |
| 7742 | -S "SSL - Verification of the message MAC failed" |
| 7743 | |
| 7744 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7745 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 7746 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7747 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7748 | psk_identity=def psk=beef" \ |
| 7749 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7750 | -C "session hash for extended master secret"\ |
| 7751 | -S "session hash for extended master secret"\ |
| 7752 | -S "SSL - The handshake negotiation failed" \ |
| 7753 | -S "SSL - Unknown identity received" \ |
| 7754 | -S "SSL - Verification of the message MAC failed" |
| 7755 | |
| 7756 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7757 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 7758 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7759 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7760 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 7761 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7762 | 0 \ |
| 7763 | -c "session hash for extended master secret"\ |
| 7764 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7765 | -S "SSL - The handshake negotiation failed" \ |
| 7766 | -S "SSL - Unknown identity received" \ |
| 7767 | -S "SSL - Verification of the message MAC failed" |
| 7768 | |
| 7769 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7770 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 7771 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7772 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7773 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7774 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7775 | 0 \ |
| 7776 | -c "session hash for extended master secret"\ |
| 7777 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 7778 | -S "SSL - The handshake negotiation failed" \ |
| 7779 | -S "SSL - Unknown identity received" \ |
| 7780 | -S "SSL - Verification of the message MAC failed" |
| 7781 | |
| 7782 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7783 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 7784 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 7785 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7786 | psk_identity=def psk=beef" \ |
| 7787 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7788 | -C "session hash for extended master secret"\ |
| 7789 | -S "session hash for extended master secret"\ |
| 7790 | -S "SSL - The handshake negotiation failed" \ |
| 7791 | -S "SSL - Unknown identity received" \ |
| 7792 | -S "SSL - Verification of the message MAC failed" |
| 7793 | |
| 7794 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7795 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 7796 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7797 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7798 | psk_identity=def psk=beef" \ |
| 7799 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7800 | -C "session hash for extended master secret"\ |
| 7801 | -S "session hash for extended master secret"\ |
| 7802 | -S "SSL - The handshake negotiation failed" \ |
| 7803 | -S "SSL - Unknown identity received" \ |
| 7804 | -S "SSL - Verification of the message MAC failed" |
| 7805 | |
| 7806 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7807 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 7808 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7809 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7810 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7811 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7812 | 0 \ |
| 7813 | -c "session hash for extended master secret"\ |
| 7814 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7815 | -S "SSL - The handshake negotiation failed" \ |
| 7816 | -S "SSL - Unknown identity received" \ |
| 7817 | -S "SSL - Verification of the message MAC failed" |
| 7818 | |
| 7819 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7820 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 7821 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7822 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7823 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7824 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7825 | 0 \ |
| 7826 | -c "session hash for extended master secret"\ |
| 7827 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 7828 | -S "SSL - The handshake negotiation failed" \ |
| 7829 | -S "SSL - Unknown identity received" \ |
| 7830 | -S "SSL - Verification of the message MAC failed" |
| 7831 | |
| 7832 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7833 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 7834 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \ |
| 7835 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7836 | psk_identity=def psk=beef" \ |
| 7837 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7838 | -C "session hash for extended master secret"\ |
| 7839 | -S "session hash for extended master secret"\ |
| 7840 | -S "SSL - The handshake negotiation failed" \ |
| 7841 | -S "SSL - Unknown identity received" \ |
| 7842 | -S "SSL - Verification of the message MAC failed" |
| 7843 | |
| 7844 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7845 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 7846 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384" \ |
| 7847 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7848 | psk_identity=def psk=beef" \ |
| 7849 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7850 | -C "session hash for extended master secret"\ |
| 7851 | -S "session hash for extended master secret"\ |
| 7852 | -S "SSL - The handshake negotiation failed" \ |
| 7853 | -S "SSL - Unknown identity received" \ |
| 7854 | -S "SSL - Verification of the message MAC failed" |
| 7855 | |
| 7856 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7857 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 7858 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7859 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 7860 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 7861 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7862 | 0 \ |
| 7863 | -c "session hash for extended master secret"\ |
| 7864 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7865 | -S "SSL - The handshake negotiation failed" \ |
| 7866 | -S "SSL - Unknown identity received" \ |
| 7867 | -S "SSL - Verification of the message MAC failed" |
| 7868 | |
| 7869 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7870 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 7871 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 7872 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 7873 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 7874 | psk_identity=abc psk=dead extended_ms=1" \ |
| 7875 | 0 \ |
| 7876 | -c "session hash for extended master secret"\ |
| 7877 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 7878 | -S "SSL - The handshake negotiation failed" \ |
| 7879 | -S "SSL - Unknown identity received" \ |
| 7880 | -S "SSL - Verification of the message MAC failed" |
| 7881 | |
| 7882 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7883 | run_test "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7884 | "$P_SRV extended_ms=0 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 7885 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7886 | psk_identity=def psk=beef" \ |
| 7887 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7888 | -C "session hash for extended master secret"\ |
| 7889 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7890 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7891 | -S "SSL - Unknown identity received" \ |
| 7892 | -S "SSL - Verification of the message MAC failed" |
| 7893 | |
| 7894 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7895 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7896 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 7897 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7898 | psk_identity=def psk=beef" \ |
| 7899 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7900 | -C "session hash for extended master secret"\ |
| 7901 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7902 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7903 | -S "SSL - Unknown identity received" \ |
| 7904 | -S "SSL - Verification of the message MAC failed" |
| 7905 | |
| 7906 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7907 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7908 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 7909 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7910 | psk_identity=def psk=beef" \ |
| 7911 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7912 | -C "session hash for extended master secret"\ |
| 7913 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7914 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7915 | -S "SSL - Unknown identity received" \ |
| 7916 | -S "SSL - Verification of the message MAC failed" |
| 7917 | |
| 7918 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7919 | run_test "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7920 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 7921 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7922 | psk_identity=def psk=beef" \ |
| 7923 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 7924 | -C "session hash for extended master secret"\ |
| 7925 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7926 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7927 | -S "SSL - Unknown identity received" \ |
| 7928 | -S "SSL - Verification of the message MAC failed" |
| 7929 | |
| 7930 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 7931 | run_test "PSK callback: raw psk on client, matching opaque PSK on server, wrong opaque PSK from callback" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7932 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=beef debug_level=3 psk_list=abc,dead,def,abc123 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
| 7933 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 7934 | psk_identity=def psk=beef" \ |
| 7935 | 1 \ |
| 7936 | -s "SSL - Verification of the message MAC failed" |
| 7937 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7938 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 7939 | "$P_SRV" \ |
| 7940 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7941 | psk_identity=foo psk=abc123" \ |
| 7942 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 7943 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7944 | -S "SSL - Unknown identity received" \ |
| 7945 | -S "SSL - Verification of the message MAC failed" |
| 7946 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7947 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7948 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 7949 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7950 | psk_identity=foo psk=abc123" \ |
| 7951 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7952 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7953 | -s "SSL - Unknown identity received" \ |
| 7954 | -S "SSL - Verification of the message MAC failed" |
| 7955 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7956 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7957 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7958 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7959 | psk_identity=abc psk=dead" \ |
| 7960 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7961 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7962 | -S "SSL - Unknown identity received" \ |
| 7963 | -S "SSL - Verification of the message MAC failed" |
| 7964 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7965 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7966 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7967 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7968 | psk_identity=def psk=beef" \ |
| 7969 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7970 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7971 | -S "SSL - Unknown identity received" \ |
| 7972 | -S "SSL - Verification of the message MAC failed" |
| 7973 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7974 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7975 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7976 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7977 | psk_identity=ghi psk=beef" \ |
| 7978 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7979 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7980 | -s "SSL - Unknown identity received" \ |
| 7981 | -S "SSL - Verification of the message MAC failed" |
| 7982 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7983 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7984 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 7985 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 7986 | psk_identity=abc psk=beef" \ |
| 7987 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 7988 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 7989 | -S "SSL - Unknown identity received" \ |
| 7990 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 7991 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7992 | # Tests for EC J-PAKE |
| 7993 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 7994 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7995 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 7996 | run_test "ECJPAKE: client not configured" \ |
| 7997 | "$P_SRV debug_level=3" \ |
| 7998 | "$P_CLI debug_level=3" \ |
| 7999 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 8000 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8001 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8002 | -S "found ecjpake kkpp extension" \ |
| 8003 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8004 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8005 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8006 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8007 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8008 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 8009 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8010 | run_test "ECJPAKE: server not configured" \ |
| 8011 | "$P_SRV debug_level=3" \ |
| 8012 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 8013 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8014 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 8015 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8016 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8017 | -s "found ecjpake kkpp extension" \ |
| 8018 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8019 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8020 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8021 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8022 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 8023 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 8024 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 8025 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 8026 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8027 | run_test "ECJPAKE: working, TLS" \ |
| 8028 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8029 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 8030 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 8031 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 8032 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8033 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8034 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8035 | -s "found ecjpake kkpp extension" \ |
| 8036 | -S "skip ecjpake kkpp extension" \ |
| 8037 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 8038 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 8039 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 8040 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8041 | -S "SSL - Verification of the message MAC failed" |
| 8042 | |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8043 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | a6b69da | 2022-11-30 16:44:49 +0100 | [diff] [blame] | 8044 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 8045 | run_test "ECJPAKE: opaque password client+server, working, TLS" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8046 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 8047 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 8048 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8049 | 0 \ |
| 8050 | -c "add ciphersuite: c0ff" \ |
| 8051 | -c "adding ecjpake_kkpp extension" \ |
Valerio Setti | 661b9bc | 2022-11-29 17:19:25 +0100 | [diff] [blame] | 8052 | -c "using opaque password" \ |
| 8053 | -s "using opaque password" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 8054 | -C "re-using cached ecjpake parameters" \ |
| 8055 | -s "found ecjpake kkpp extension" \ |
| 8056 | -S "skip ecjpake kkpp extension" \ |
| 8057 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 8058 | -s "server hello, ecjpake kkpp extension" \ |
| 8059 | -c "found ecjpake_kkpp extension" \ |
| 8060 | -S "SSL - The handshake negotiation failed" \ |
| 8061 | -S "SSL - Verification of the message MAC failed" |
| 8062 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 8063 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 8064 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8065 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 8066 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 8067 | run_test "ECJPAKE: opaque password client only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8068 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8069 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 8070 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8071 | 0 \ |
| 8072 | -c "add ciphersuite: c0ff" \ |
| 8073 | -c "adding ecjpake_kkpp extension" \ |
| 8074 | -c "using opaque password" \ |
| 8075 | -S "using opaque password" \ |
| 8076 | -C "re-using cached ecjpake parameters" \ |
| 8077 | -s "found ecjpake kkpp extension" \ |
| 8078 | -S "skip ecjpake kkpp extension" \ |
| 8079 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 8080 | -s "server hello, ecjpake kkpp extension" \ |
| 8081 | -c "found ecjpake_kkpp extension" \ |
| 8082 | -S "SSL - The handshake negotiation failed" \ |
| 8083 | -S "SSL - Verification of the message MAC failed" |
| 8084 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 8085 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 8086 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8087 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 8088 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 8089 | run_test "ECJPAKE: opaque password server only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8090 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 8091 | "$P_CLI debug_level=3 ecjpake_pw=bla\ |
| 8092 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8093 | 0 \ |
| 8094 | -c "add ciphersuite: c0ff" \ |
| 8095 | -c "adding ecjpake_kkpp extension" \ |
| 8096 | -C "using opaque password" \ |
| 8097 | -s "using opaque password" \ |
| 8098 | -C "re-using cached ecjpake parameters" \ |
| 8099 | -s "found ecjpake kkpp extension" \ |
| 8100 | -S "skip ecjpake kkpp extension" \ |
| 8101 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 8102 | -s "server hello, ecjpake kkpp extension" \ |
| 8103 | -c "found ecjpake_kkpp extension" \ |
| 8104 | -S "SSL - The handshake negotiation failed" \ |
| 8105 | -S "SSL - Verification of the message MAC failed" |
| 8106 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8107 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8108 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8109 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 8110 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 8111 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 8112 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8113 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8114 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8115 | -s "SSL - Verification of the message MAC failed" |
| 8116 | |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8117 | server_needs_more_time 1 |
| 8118 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 8119 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 8120 | run_test "ECJPAKE_OPAQUE_PW: opaque password mismatch, TLS" \ |
| 8121 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 8122 | "$P_CLI debug_level=3 ecjpake_pw=bad ecjpake_pw_opaque=1 \ |
| 8123 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8124 | 1 \ |
| 8125 | -c "using opaque password" \ |
| 8126 | -s "using opaque password" \ |
| 8127 | -C "re-using cached ecjpake parameters" \ |
| 8128 | -s "SSL - Verification of the message MAC failed" |
| 8129 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8130 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8131 | run_test "ECJPAKE: working, DTLS" \ |
| 8132 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 8133 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 8134 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8135 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8136 | -c "re-using cached ecjpake parameters" \ |
| 8137 | -S "SSL - Verification of the message MAC failed" |
| 8138 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8139 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8140 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 8141 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 8142 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 8143 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8144 | 0 \ |
| 8145 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8146 | -S "SSL - Verification of the message MAC failed" |
| 8147 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8148 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8149 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8150 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 8151 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 8152 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 8153 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8154 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 8155 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 8156 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 8157 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8158 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8159 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 8160 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 8161 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 8162 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 8163 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 8164 | 0 |
| 8165 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 8166 | # Test for ClientHello without extensions |
| 8167 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 8168 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 8169 | run_test "ClientHello without extensions" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 8170 | "$P_SRV force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8171 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 8172 | 0 \ |
| 8173 | -s "dumping 'client hello extensions' (0 bytes)" |
| 8174 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8175 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8176 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8177 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8178 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8179 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8180 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8181 | "$P_CLI request_size=100" \ |
| 8182 | 0 \ |
| 8183 | -s "Read from client: 100 bytes read$" |
| 8184 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8185 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8186 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 8187 | "$P_SRV buffer_size=100" \ |
| 8188 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 8189 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 8190 | -s "Read from client: 101 bytes read (100 + 1)" |
| 8191 | |
| 8192 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8193 | requires_max_content_len 200 |
| 8194 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 8195 | "$P_SRV buffer_size=100" \ |
| 8196 | "$P_CLI request_size=200" \ |
| 8197 | 0 \ |
| 8198 | -s "Read from client: 200 bytes read (100 + 100)" |
| 8199 | |
| 8200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8201 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
| 8202 | "$P_SRV buffer_size=100" \ |
| 8203 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 8204 | 0 \ |
| 8205 | -s "Read from client: $MAX_CONTENT_LEN bytes read (100 + $((MAX_CONTENT_LEN - 100)))" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 8206 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8207 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8208 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8209 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8210 | "$P_SRV force_version=tls12" \ |
| 8211 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8212 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8213 | 0 \ |
| 8214 | -s "Read from client: 1 bytes read" |
| 8215 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8216 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8217 | "$P_SRV force_version=tls12" \ |
| 8218 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 8219 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 169dd6a | 2014-11-04 16:15:39 +0100 | [diff] [blame] | 8220 | 0 \ |
| 8221 | -s "Read from client: 1 bytes read" |
| 8222 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8223 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8224 | "$P_SRV force_version=tls12" \ |
| 8225 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8226 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8227 | 0 \ |
| 8228 | -s "Read from client: 1 bytes read" |
| 8229 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8230 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8231 | "$P_SRV force_version=tls12" \ |
| 8232 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8233 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 8234 | 0 \ |
| 8235 | -s "Read from client: 1 bytes read" |
| 8236 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8237 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8238 | "$P_SRV force_version=tls12" \ |
| 8239 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 8240 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 8241 | 0 \ |
| 8242 | -s "Read from client: 1 bytes read" |
| 8243 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8244 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8245 | run_test "Small client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8246 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8247 | "$P_CLI request_size=1 \ |
| 8248 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8249 | 0 \ |
| 8250 | -s "Read from client: 1 bytes read" |
| 8251 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8252 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8253 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8254 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8255 | "$P_CLI request_size=1 \ |
| 8256 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8257 | 0 \ |
| 8258 | -s "Read from client: 1 bytes read" |
| 8259 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8260 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8261 | |
| 8262 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8263 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8264 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8265 | "$P_CLI dtls=1 request_size=1 \ |
| 8266 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8267 | 0 \ |
| 8268 | -s "Read from client: 1 bytes read" |
| 8269 | |
| 8270 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8271 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8272 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 8273 | "$P_CLI dtls=1 request_size=1 \ |
| 8274 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8275 | 0 \ |
| 8276 | -s "Read from client: 1 bytes read" |
| 8277 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8278 | # Tests for small server packets |
| 8279 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8280 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8281 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8282 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8283 | 0 \ |
| 8284 | -c "Read from server: 1 bytes read" |
| 8285 | |
| 8286 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8287 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8288 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8289 | 0 \ |
| 8290 | -c "Read from server: 1 bytes read" |
| 8291 | |
| 8292 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8293 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8294 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8295 | 0 \ |
| 8296 | -c "Read from server: 1 bytes read" |
| 8297 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8298 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8299 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8300 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8301 | 0 \ |
| 8302 | -c "Read from server: 1 bytes read" |
| 8303 | |
| 8304 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8305 | "$P_SRV response_size=1 force_version=tls12" \ |
| 8306 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8307 | 0 \ |
| 8308 | -c "Read from server: 1 bytes read" |
| 8309 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8310 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8311 | run_test "Small server packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8312 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8313 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8314 | 0 \ |
| 8315 | -c "Read from server: 1 bytes read" |
| 8316 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8317 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8318 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8319 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8320 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8321 | 0 \ |
| 8322 | -c "Read from server: 1 bytes read" |
| 8323 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8324 | # Tests for small server packets in DTLS |
| 8325 | |
| 8326 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8327 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8328 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8329 | "$P_CLI dtls=1 \ |
| 8330 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8331 | 0 \ |
| 8332 | -c "Read from server: 1 bytes read" |
| 8333 | |
| 8334 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8335 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8336 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8337 | "$P_CLI dtls=1 \ |
| 8338 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8339 | 0 \ |
| 8340 | -c "Read from server: 1 bytes read" |
| 8341 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8342 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8343 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8344 | # How many fragments do we expect to write $1 bytes? |
| 8345 | fragments_for_write() { |
| 8346 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 8347 | } |
| 8348 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8349 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8350 | "$P_SRV force_version=tls12" \ |
| 8351 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8352 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8353 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8354 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8355 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8356 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8357 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8358 | "$P_SRV force_version=tls12" \ |
| 8359 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8360 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 8361 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8362 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 8363 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8364 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8365 | "$P_SRV force_version=tls12" \ |
| 8366 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 8367 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8368 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8369 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8370 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8371 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8372 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8373 | "$P_SRV force_version=tls12" \ |
| 8374 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8375 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 8376 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8377 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8378 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8379 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8380 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8381 | "$P_SRV force_version=tls12" \ |
| 8382 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8383 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 8384 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 8385 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8386 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 8387 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8388 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8389 | run_test "Large client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8390 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8391 | "$P_CLI request_size=16384 \ |
| 8392 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8393 | 0 \ |
| 8394 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8395 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8396 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8397 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8398 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8399 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8400 | "$P_CLI request_size=16384 \ |
| 8401 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8402 | 0 \ |
| 8403 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 8404 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
| 8405 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8406 | # The tests below fail when the server's OUT_CONTENT_LEN is less than 16384. |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8407 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8408 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8409 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8410 | 0 \ |
| 8411 | -c "Read from server: 16384 bytes read" |
| 8412 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8413 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8414 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8415 | "$P_CLI etm=0 force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8416 | 0 \ |
| 8417 | -s "16384 bytes written in 1 fragments" \ |
| 8418 | -c "Read from server: 16384 bytes read" |
| 8419 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8420 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8421 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8422 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8423 | 0 \ |
| 8424 | -c "Read from server: 16384 bytes read" |
| 8425 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8426 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8427 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 8428 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 8429 | 0 \ |
| 8430 | -s "16384 bytes written in 1 fragments" \ |
| 8431 | -c "Read from server: 16384 bytes read" |
| 8432 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8433 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8434 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8435 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8436 | 0 \ |
| 8437 | -c "Read from server: 16384 bytes read" |
| 8438 | |
| 8439 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 8440 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 8441 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 8442 | 0 \ |
| 8443 | -c "Read from server: 16384 bytes read" |
| 8444 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8445 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8446 | run_test "Large server packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8447 | "$P_SRV response_size=16384" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8448 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 8449 | 0 \ |
| 8450 | -c "Read from server: 16384 bytes read" |
| 8451 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 8452 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8453 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 8454 | "$P_SRV response_size=16384" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 8455 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 8456 | 0 \ |
| 8457 | -c "Read from server: 16384 bytes read" |
| 8458 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8459 | # Tests for restartable ECC |
| 8460 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8461 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 8462 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8463 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8464 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8465 | run_test "EC restart: TLS, default" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 8466 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8467 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 8468 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8469 | debug_level=1" \ |
| 8470 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8471 | -C "x509_verify_cert.*4b00" \ |
| 8472 | -C "mbedtls_pk_verify.*4b00" \ |
| 8473 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8474 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8475 | |
| 8476 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8477 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8478 | run_test "EC restart: TLS, max_ops=0" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 8479 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8480 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 8481 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8482 | debug_level=1 ec_max_ops=0" \ |
| 8483 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8484 | -C "x509_verify_cert.*4b00" \ |
| 8485 | -C "mbedtls_pk_verify.*4b00" \ |
| 8486 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8487 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8488 | |
| 8489 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8490 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8491 | run_test "EC restart: TLS, max_ops=65535" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 8492 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8493 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 8494 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8495 | debug_level=1 ec_max_ops=65535" \ |
| 8496 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8497 | -C "x509_verify_cert.*4b00" \ |
| 8498 | -C "mbedtls_pk_verify.*4b00" \ |
| 8499 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8500 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8501 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8502 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8503 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8504 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8505 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8506 | run_test "EC restart: TLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 8507 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8508 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 8509 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8510 | debug_level=1 ec_max_ops=1000" \ |
| 8511 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8512 | -c "x509_verify_cert.*4b00" \ |
| 8513 | -c "mbedtls_pk_verify.*4b00" \ |
| 8514 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8515 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8516 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8517 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8518 | # everything except ECDH (where TLS calls PSA directly). |
| 8519 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8520 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8521 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8522 | run_test "EC restart: TLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 8523 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8524 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8525 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8526 | debug_level=1 ec_max_ops=1000" \ |
| 8527 | 0 \ |
| 8528 | -c "x509_verify_cert.*4b00" \ |
| 8529 | -c "mbedtls_pk_verify.*4b00" \ |
| 8530 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8531 | -c "mbedtls_pk_sign.*4b00" |
| 8532 | |
| 8533 | # This works the same with & without USE_PSA as we never get to ECDH: |
| 8534 | # we abort as soon as we determined the cert is bad. |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8535 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8536 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8537 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 8538 | "$P_SRV groups=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8539 | crt_file=data_files/server5-badsign.crt \ |
| 8540 | key_file=data_files/server5.key" \ |
| 8541 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8542 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8543 | debug_level=1 ec_max_ops=1000" \ |
| 8544 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8545 | -c "x509_verify_cert.*4b00" \ |
| 8546 | -C "mbedtls_pk_verify.*4b00" \ |
| 8547 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8548 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8549 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8550 | -c "! mbedtls_ssl_handshake returned" \ |
| 8551 | -c "X509 - Certificate verification failed" |
| 8552 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8553 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8554 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8555 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8556 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8557 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 8558 | "$P_SRV groups=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8559 | crt_file=data_files/server5-badsign.crt \ |
| 8560 | key_file=data_files/server5.key" \ |
| 8561 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8562 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8563 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 8564 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8565 | -c "x509_verify_cert.*4b00" \ |
| 8566 | -c "mbedtls_pk_verify.*4b00" \ |
| 8567 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8568 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8569 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8570 | -C "! mbedtls_ssl_handshake returned" \ |
| 8571 | -C "X509 - Certificate verification failed" |
| 8572 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8573 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8574 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8575 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8576 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8577 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8578 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 8579 | "$P_SRV groups=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8580 | crt_file=data_files/server5-badsign.crt \ |
| 8581 | key_file=data_files/server5.key" \ |
| 8582 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8583 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8584 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 8585 | 0 \ |
| 8586 | -c "x509_verify_cert.*4b00" \ |
| 8587 | -c "mbedtls_pk_verify.*4b00" \ |
| 8588 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8589 | -c "mbedtls_pk_sign.*4b00" \ |
| 8590 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 8591 | -C "! mbedtls_ssl_handshake returned" \ |
| 8592 | -C "X509 - Certificate verification failed" |
| 8593 | |
| 8594 | # With USE_PSA disabled we expect full restartable behaviour. |
| 8595 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8596 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8597 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8598 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 8599 | "$P_SRV groups=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8600 | crt_file=data_files/server5-badsign.crt \ |
| 8601 | key_file=data_files/server5.key" \ |
| 8602 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8603 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8604 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 8605 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8606 | -C "x509_verify_cert.*4b00" \ |
| 8607 | -c "mbedtls_pk_verify.*4b00" \ |
| 8608 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8609 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8610 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 8611 | -C "! mbedtls_ssl_handshake returned" \ |
| 8612 | -C "X509 - Certificate verification failed" |
| 8613 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8614 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8615 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 8616 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8617 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8618 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8619 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 8620 | "$P_SRV groups=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8621 | crt_file=data_files/server5-badsign.crt \ |
| 8622 | key_file=data_files/server5.key" \ |
| 8623 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8624 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8625 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 8626 | 0 \ |
| 8627 | -C "x509_verify_cert.*4b00" \ |
| 8628 | -c "mbedtls_pk_verify.*4b00" \ |
| 8629 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8630 | -c "mbedtls_pk_sign.*4b00" \ |
| 8631 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 8632 | -C "! mbedtls_ssl_handshake returned" \ |
| 8633 | -C "X509 - Certificate verification failed" |
| 8634 | |
| 8635 | # With USE_PSA disabled we expect full restartable behaviour. |
| 8636 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8637 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8638 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8639 | run_test "EC restart: DTLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 8640 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8641 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 8642 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8643 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 8644 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8645 | -c "x509_verify_cert.*4b00" \ |
| 8646 | -c "mbedtls_pk_verify.*4b00" \ |
| 8647 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8648 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 8649 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8650 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8651 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8652 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8653 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8654 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8655 | run_test "EC restart: DTLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 8656 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8657 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8658 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8659 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 8660 | 0 \ |
| 8661 | -c "x509_verify_cert.*4b00" \ |
| 8662 | -c "mbedtls_pk_verify.*4b00" \ |
| 8663 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8664 | -c "mbedtls_pk_sign.*4b00" |
| 8665 | |
| 8666 | # With USE_PSA disabled we expect full restartable behaviour. |
| 8667 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8668 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8669 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 8670 | run_test "EC restart: TLS, max_ops=1000 no client auth (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 8671 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8672 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8673 | debug_level=1 ec_max_ops=1000" \ |
| 8674 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8675 | -c "x509_verify_cert.*4b00" \ |
| 8676 | -c "mbedtls_pk_verify.*4b00" \ |
| 8677 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 8678 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8679 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8680 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8681 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 8682 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8683 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 8684 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8685 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8686 | run_test "EC restart: TLS, max_ops=1000 no client auth (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 8687 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 8688 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8689 | debug_level=1 ec_max_ops=1000" \ |
| 8690 | 0 \ |
| 8691 | -c "x509_verify_cert.*4b00" \ |
| 8692 | -c "mbedtls_pk_verify.*4b00" \ |
| 8693 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8694 | -C "mbedtls_pk_sign.*4b00" |
| 8695 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8696 | # Restartable is only for ECDHE-ECDSA, with another ciphersuite we expect no |
| 8697 | # restartable behaviour at all (not even client auth). |
| 8698 | # This is the same as "EC restart: TLS, max_ops=1000" except with ECDHE-RSA, |
| 8699 | # and all 4 assertions negated. |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8700 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 8701 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8702 | run_test "EC restart: TLS, max_ops=1000, ECDHE-RSA" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 8703 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 8704 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 \ |
| 8705 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8706 | debug_level=1 ec_max_ops=1000" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8707 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 8708 | -C "x509_verify_cert.*4b00" \ |
| 8709 | -C "mbedtls_pk_verify.*4b00" \ |
| 8710 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 8711 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 8712 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8713 | # Tests of asynchronous private key support in SSL |
| 8714 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8715 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8716 | run_test "SSL async private: sign, delay=0" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8717 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8718 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8719 | "$P_CLI" \ |
| 8720 | 0 \ |
| 8721 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8722 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8723 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8724 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8725 | run_test "SSL async private: sign, delay=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8726 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8727 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8728 | "$P_CLI" \ |
| 8729 | 0 \ |
| 8730 | -s "Async sign callback: using key slot " \ |
| 8731 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8732 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8733 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8734 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 8735 | run_test "SSL async private: sign, delay=2" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8736 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 8737 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 8738 | "$P_CLI" \ |
| 8739 | 0 \ |
| 8740 | -s "Async sign callback: using key slot " \ |
| 8741 | -U "Async sign callback: using key slot " \ |
| 8742 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 8743 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8744 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8745 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8746 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 8747 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 8748 | run_test "SSL async private: sign, SNI" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8749 | "$P_SRV force_version=tls12 debug_level=3 \ |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 8750 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 8751 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 8752 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 8753 | "$P_CLI server_name=polarssl.example" \ |
| 8754 | 0 \ |
| 8755 | -s "Async sign callback: using key slot " \ |
| 8756 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8757 | -s "parse ServerName extension" \ |
| 8758 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 8759 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 8760 | |
| 8761 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8762 | run_test "SSL async private: decrypt, delay=0" \ |
| 8763 | "$P_SRV \ |
| 8764 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8765 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8766 | 0 \ |
| 8767 | -s "Async decrypt callback: using key slot " \ |
| 8768 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8769 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8770 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8771 | run_test "SSL async private: decrypt, delay=1" \ |
| 8772 | "$P_SRV \ |
| 8773 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8774 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8775 | 0 \ |
| 8776 | -s "Async decrypt callback: using key slot " \ |
| 8777 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8778 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8779 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8780 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8781 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 8782 | "$P_SRV psk=abc123 \ |
| 8783 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 8784 | "$P_CLI psk=abc123 \ |
| 8785 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8786 | 0 \ |
| 8787 | -s "Async decrypt callback: using key slot " \ |
| 8788 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8789 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8790 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8791 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 8792 | "$P_SRV psk=abc123 \ |
| 8793 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 8794 | "$P_CLI psk=abc123 \ |
| 8795 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 8796 | 0 \ |
| 8797 | -s "Async decrypt callback: using key slot " \ |
| 8798 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 8799 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8800 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8801 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8802 | run_test "SSL async private: sign callback not present" \ |
| 8803 | "$P_SRV \ |
| 8804 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8805 | "$P_CLI force_version=tls12; [ \$? -eq 1 ] && |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8806 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8807 | 0 \ |
| 8808 | -S "Async sign callback" \ |
| 8809 | -s "! mbedtls_ssl_handshake returned" \ |
| 8810 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 8811 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 8812 | -s "Successful connection" |
| 8813 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8814 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8815 | run_test "SSL async private: decrypt callback not present" \ |
| 8816 | "$P_SRV debug_level=1 \ |
| 8817 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 8818 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 8819 | [ \$? -eq 1 ] && $P_CLI force_version=tls12" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8820 | 0 \ |
| 8821 | -S "Async decrypt callback" \ |
| 8822 | -s "! mbedtls_ssl_handshake returned" \ |
| 8823 | -s "got no RSA private key" \ |
| 8824 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 8825 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8826 | |
| 8827 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8828 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8829 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8830 | "$P_SRV \ |
| 8831 | async_operations=s async_private_delay1=1 \ |
| 8832 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8833 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8834 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8835 | 0 \ |
| 8836 | -s "Async sign callback: using key slot 0," \ |
| 8837 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8838 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8839 | |
| 8840 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8841 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8842 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8843 | "$P_SRV \ |
| 8844 | async_operations=s async_private_delay2=1 \ |
| 8845 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8846 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8847 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8848 | 0 \ |
| 8849 | -s "Async sign callback: using key slot 0," \ |
| 8850 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8851 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8852 | |
| 8853 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8854 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 8855 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8856 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 8857 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8858 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8859 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8860 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8861 | 0 \ |
| 8862 | -s "Async sign callback: using key slot 1," \ |
| 8863 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8864 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8865 | |
| 8866 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8867 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8868 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8869 | "$P_SRV \ |
| 8870 | async_operations=s async_private_delay1=1 \ |
| 8871 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8872 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8873 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8874 | 0 \ |
| 8875 | -s "Async sign callback: no key matches this certificate." |
| 8876 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8877 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8878 | run_test "SSL async private: sign, error in start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8879 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8880 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8881 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8882 | "$P_CLI" \ |
| 8883 | 1 \ |
| 8884 | -s "Async sign callback: injected error" \ |
| 8885 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8886 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8887 | -s "! mbedtls_ssl_handshake returned" |
| 8888 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8889 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8890 | run_test "SSL async private: sign, cancel after start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8891 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8892 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8893 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8894 | "$P_CLI" \ |
| 8895 | 1 \ |
| 8896 | -s "Async sign callback: using key slot " \ |
| 8897 | -S "Async resume" \ |
| 8898 | -s "Async cancel" |
| 8899 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8900 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8901 | run_test "SSL async private: sign, error in resume" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8902 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8903 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8904 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8905 | "$P_CLI" \ |
| 8906 | 1 \ |
| 8907 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8908 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 8909 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8910 | -s "! mbedtls_ssl_handshake returned" |
| 8911 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8912 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8913 | run_test "SSL async private: decrypt, error in start" \ |
| 8914 | "$P_SRV \ |
| 8915 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8916 | async_private_error=1" \ |
| 8917 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8918 | 1 \ |
| 8919 | -s "Async decrypt callback: injected error" \ |
| 8920 | -S "Async resume" \ |
| 8921 | -S "Async cancel" \ |
| 8922 | -s "! mbedtls_ssl_handshake returned" |
| 8923 | |
| 8924 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 8925 | run_test "SSL async private: decrypt, cancel after start" \ |
| 8926 | "$P_SRV \ |
| 8927 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8928 | async_private_error=2" \ |
| 8929 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8930 | 1 \ |
| 8931 | -s "Async decrypt callback: using key slot " \ |
| 8932 | -S "Async resume" \ |
| 8933 | -s "Async cancel" |
| 8934 | |
| 8935 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 8936 | run_test "SSL async private: decrypt, error in resume" \ |
| 8937 | "$P_SRV \ |
| 8938 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8939 | async_private_error=3" \ |
| 8940 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8941 | 1 \ |
| 8942 | -s "Async decrypt callback: using key slot " \ |
| 8943 | -s "Async resume callback: decrypt done but injected error" \ |
| 8944 | -S "Async cancel" \ |
| 8945 | -s "! mbedtls_ssl_handshake returned" |
| 8946 | |
| 8947 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8948 | run_test "SSL async private: cancel after start then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8949 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8950 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8951 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8952 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 8953 | 0 \ |
| 8954 | -s "Async cancel" \ |
| 8955 | -s "! mbedtls_ssl_handshake returned" \ |
| 8956 | -s "Async resume" \ |
| 8957 | -s "Successful connection" |
| 8958 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8959 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8960 | run_test "SSL async private: error in resume then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 8961 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8962 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 8963 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8964 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 8965 | 0 \ |
| 8966 | -s "! mbedtls_ssl_handshake returned" \ |
| 8967 | -s "Async resume" \ |
| 8968 | -s "Successful connection" |
| 8969 | |
| 8970 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8971 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 8972 | # Note: the function "detect_required_features()" is not able to detect more than |
| 8973 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 8974 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 8975 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8976 | run_test "SSL async private: cancel after start then fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8977 | "$P_SRV \ |
| 8978 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 8979 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 8980 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8981 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 8982 | [ \$? -eq 1 ] && |
| 8983 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 8984 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 8985 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 8986 | -S "Async resume" \ |
| 8987 | -s "Async cancel" \ |
| 8988 | -s "! mbedtls_ssl_handshake returned" \ |
| 8989 | -s "Async sign callback: no key matches this certificate." \ |
| 8990 | -s "Successful connection" |
| 8991 | |
| 8992 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8993 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 8994 | # Note: the function "detect_required_features()" is not able to detect more than |
| 8995 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 8996 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 8997 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 8998 | run_test "SSL async private: sign, error in resume then fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8999 | "$P_SRV \ |
| 9000 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 9001 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 9002 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 9003 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 9004 | [ \$? -eq 1 ] && |
| 9005 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9006 | 0 \ |
| 9007 | -s "Async resume" \ |
| 9008 | -s "! mbedtls_ssl_handshake returned" \ |
| 9009 | -s "Async sign callback: no key matches this certificate." \ |
| 9010 | -s "Successful connection" |
| 9011 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9012 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9013 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9014 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9015 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9016 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9017 | exchanges=2 renegotiation=1" \ |
| 9018 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 9019 | 0 \ |
| 9020 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9021 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9022 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9023 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9024 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9025 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9026 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9027 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9028 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 9029 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 9030 | 0 \ |
| 9031 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9032 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 9033 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9034 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9035 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9036 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9037 | "$P_SRV \ |
| 9038 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9039 | exchanges=2 renegotiation=1" \ |
| 9040 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 9041 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9042 | 0 \ |
| 9043 | -s "Async decrypt callback: using key slot " \ |
| 9044 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 9045 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9046 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9047 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 9048 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9049 | "$P_SRV \ |
| 9050 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 9051 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 9052 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 9053 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9054 | 0 \ |
| 9055 | -s "Async decrypt callback: using key slot " \ |
| 9056 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9057 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9058 | # Tests for ECC extensions (rfc 4492) |
| 9059 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9060 | requires_config_enabled MBEDTLS_AES_C |
| 9061 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9062 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9063 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9064 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 9065 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9066 | "$P_CLI debug_level=3 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA256" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9067 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 9068 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9069 | -C "client hello, adding supported_point_formats extension" \ |
| 9070 | -S "found supported elliptic curves extension" \ |
| 9071 | -S "found supported point formats extension" |
| 9072 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9073 | requires_config_enabled MBEDTLS_AES_C |
| 9074 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9075 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9076 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9077 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9078 | "$P_SRV debug_level=3 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA256" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9079 | "$P_CLI debug_level=3" \ |
| 9080 | 0 \ |
| 9081 | -C "found supported_point_formats extension" \ |
| 9082 | -S "server hello, supported_point_formats extension" |
| 9083 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9084 | requires_config_enabled MBEDTLS_AES_C |
| 9085 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9086 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9087 | run_test "Force an ECC ciphersuite in the client side" \ |
| 9088 | "$P_SRV debug_level=3" \ |
| 9089 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 9090 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 9091 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9092 | -c "client hello, adding supported_point_formats extension" \ |
| 9093 | -s "found supported elliptic curves extension" \ |
| 9094 | -s "found supported point formats extension" |
| 9095 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 9096 | requires_config_enabled MBEDTLS_AES_C |
| 9097 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9098 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 9099 | run_test "Force an ECC ciphersuite in the server side" \ |
| 9100 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 9101 | "$P_CLI debug_level=3" \ |
| 9102 | 0 \ |
| 9103 | -c "found supported_point_formats extension" \ |
| 9104 | -s "server hello, supported_point_formats extension" |
| 9105 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9106 | # Tests for DTLS HelloVerifyRequest |
| 9107 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9108 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9109 | run_test "DTLS cookie: enabled" \ |
| 9110 | "$P_SRV dtls=1 debug_level=2" \ |
| 9111 | "$P_CLI dtls=1 debug_level=2" \ |
| 9112 | 0 \ |
| 9113 | -s "cookie verification failed" \ |
| 9114 | -s "cookie verification passed" \ |
| 9115 | -S "cookie verification skipped" \ |
| 9116 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9117 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9118 | -S "SSL - The requested feature is not available" |
| 9119 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9120 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9121 | run_test "DTLS cookie: disabled" \ |
| 9122 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 9123 | "$P_CLI dtls=1 debug_level=2" \ |
| 9124 | 0 \ |
| 9125 | -S "cookie verification failed" \ |
| 9126 | -S "cookie verification passed" \ |
| 9127 | -s "cookie verification skipped" \ |
| 9128 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9129 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9130 | -S "SSL - The requested feature is not available" |
| 9131 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9132 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9133 | run_test "DTLS cookie: default (failing)" \ |
| 9134 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 9135 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 9136 | 1 \ |
| 9137 | -s "cookie verification failed" \ |
| 9138 | -S "cookie verification passed" \ |
| 9139 | -S "cookie verification skipped" \ |
| 9140 | -C "received hello verify request" \ |
| 9141 | -S "hello verification requested" \ |
| 9142 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9143 | |
| 9144 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9145 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9146 | run_test "DTLS cookie: enabled, IPv6" \ |
| 9147 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 9148 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 9149 | 0 \ |
| 9150 | -s "cookie verification failed" \ |
| 9151 | -s "cookie verification passed" \ |
| 9152 | -S "cookie verification skipped" \ |
| 9153 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9154 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 9155 | -S "SSL - The requested feature is not available" |
| 9156 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9157 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 9158 | run_test "DTLS cookie: enabled, nbio" \ |
| 9159 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 9160 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9161 | 0 \ |
| 9162 | -s "cookie verification failed" \ |
| 9163 | -s "cookie verification passed" \ |
| 9164 | -S "cookie verification skipped" \ |
| 9165 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 9166 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 9167 | -S "SSL - The requested feature is not available" |
| 9168 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9169 | # Tests for client reconnecting from the same port with DTLS |
| 9170 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9171 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9172 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9173 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9174 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 9175 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=10000-20000" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9176 | 0 \ |
| 9177 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9178 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9179 | -S "Client initiated reconnection from same port" |
| 9180 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9181 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9182 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9183 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9184 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 9185 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=10000-20000 reconnect_hard=1" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9186 | 0 \ |
| 9187 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9188 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9189 | -s "Client initiated reconnection from same port" |
| 9190 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9191 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9192 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9193 | run_test "DTLS client reconnect from same port: reconnect, nbio, no valgrind" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9194 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 9195 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-1000 reconnect_hard=1" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9196 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9197 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 9198 | -s "Client initiated reconnection from same port" |
| 9199 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9200 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9201 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 9202 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 9203 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 9204 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 9205 | 0 \ |
| 9206 | -S "The operation timed out" \ |
| 9207 | -s "Client initiated reconnection from same port" |
| 9208 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9209 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9210 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 9211 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 cookies=0" \ |
Manuel Pégourié-Gonnard | 6ad23b9 | 2015-09-15 12:57:46 +0200 | [diff] [blame] | 9212 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 9213 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 9214 | -s "The operation timed out" \ |
| 9215 | -S "Client initiated reconnection from same port" |
| 9216 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9217 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 9218 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 9219 | -p "$P_PXY inject_clihlo=1" \ |
| 9220 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 9221 | "$P_CLI dtls=1 exchanges=2" \ |
| 9222 | 0 \ |
| 9223 | -s "possible client reconnect from the same port" \ |
| 9224 | -S "Client initiated reconnection from same port" |
| 9225 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9226 | # Tests for various cases of client authentication with DTLS |
| 9227 | # (focused on handshake flows and message parsing) |
| 9228 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9229 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9230 | run_test "DTLS client auth: required" \ |
| 9231 | "$P_SRV dtls=1 auth_mode=required" \ |
| 9232 | "$P_CLI dtls=1" \ |
| 9233 | 0 \ |
| 9234 | -s "Verifying peer X.509 certificate... ok" |
| 9235 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9236 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9237 | run_test "DTLS client auth: optional, client has no cert" \ |
| 9238 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 9239 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 9240 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9241 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9242 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9243 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9244 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9245 | "$P_SRV dtls=1 auth_mode=none" \ |
| 9246 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 9247 | 0 \ |
| 9248 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 9249 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 9250 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 9251 | run_test "DTLS wrong PSK: badmac alert" \ |
| 9252 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 9253 | "$P_CLI dtls=1 psk=abc124" \ |
| 9254 | 1 \ |
| 9255 | -s "SSL - Verification of the message MAC failed" \ |
| 9256 | -c "SSL - A fatal alert message was received from our peer" |
| 9257 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9258 | # Tests for receiving fragmented handshake messages with DTLS |
| 9259 | |
| 9260 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9261 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9262 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 9263 | "$G_SRV -u --mtu 2048 -a" \ |
| 9264 | "$P_CLI dtls=1 debug_level=2" \ |
| 9265 | 0 \ |
| 9266 | -C "found fragmented DTLS handshake message" \ |
| 9267 | -C "error" |
| 9268 | |
| 9269 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9270 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9271 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 9272 | "$G_SRV -u --mtu 512" \ |
| 9273 | "$P_CLI dtls=1 debug_level=2" \ |
| 9274 | 0 \ |
| 9275 | -c "found fragmented DTLS handshake message" \ |
| 9276 | -C "error" |
| 9277 | |
| 9278 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9279 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9280 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 9281 | "$G_SRV -u --mtu 128" \ |
| 9282 | "$P_CLI dtls=1 debug_level=2" \ |
| 9283 | 0 \ |
| 9284 | -c "found fragmented DTLS handshake message" \ |
| 9285 | -C "error" |
| 9286 | |
| 9287 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9288 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 9289 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 9290 | "$G_SRV -u --mtu 128" \ |
| 9291 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9292 | 0 \ |
| 9293 | -c "found fragmented DTLS handshake message" \ |
| 9294 | -C "error" |
| 9295 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9296 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9297 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9298 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9299 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 9300 | "$G_SRV -u --mtu 256" \ |
| 9301 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 9302 | 0 \ |
| 9303 | -c "found fragmented DTLS handshake message" \ |
| 9304 | -c "client hello, adding renegotiation extension" \ |
| 9305 | -c "found renegotiation extension" \ |
| 9306 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9307 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9308 | -C "error" \ |
| 9309 | -s "Extra-header:" |
| 9310 | |
| 9311 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9312 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9313 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9314 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 9315 | "$G_SRV -u --mtu 256" \ |
| 9316 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 9317 | 0 \ |
| 9318 | -c "found fragmented DTLS handshake message" \ |
| 9319 | -c "client hello, adding renegotiation extension" \ |
| 9320 | -c "found renegotiation extension" \ |
| 9321 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9322 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 9323 | -C "error" \ |
| 9324 | -s "Extra-header:" |
| 9325 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9326 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9327 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 9328 | "$O_SRV -dtls -mtu 2048" \ |
| 9329 | "$P_CLI dtls=1 debug_level=2" \ |
| 9330 | 0 \ |
| 9331 | -C "found fragmented DTLS handshake message" \ |
| 9332 | -C "error" |
| 9333 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9334 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9335 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 9336 | "$O_SRV -dtls -mtu 256" \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9337 | "$P_CLI dtls=1 debug_level=2" \ |
| 9338 | 0 \ |
| 9339 | -c "found fragmented DTLS handshake message" \ |
| 9340 | -C "error" |
| 9341 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9342 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9343 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 9344 | "$O_SRV -dtls -mtu 256" \ |
| 9345 | "$P_CLI dtls=1 debug_level=2" \ |
| 9346 | 0 \ |
| 9347 | -c "found fragmented DTLS handshake message" \ |
| 9348 | -C "error" |
| 9349 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9350 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 9351 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 9352 | "$O_SRV -dtls -mtu 256" \ |
| 9353 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 9354 | 0 \ |
| 9355 | -c "found fragmented DTLS handshake message" \ |
| 9356 | -C "error" |
| 9357 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9358 | # Tests for sending fragmented handshake messages with DTLS |
| 9359 | # |
| 9360 | # Use client auth when we need the client to send large messages, |
| 9361 | # and use large cert chains on both sides too (the long chains we have all use |
| 9362 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 9363 | # Sizes reached (UDP payload): |
| 9364 | # - 2037B for server certificate |
| 9365 | # - 1542B for client certificate |
| 9366 | # - 1013B for newsessionticket |
| 9367 | # - all others below 512B |
| 9368 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 9369 | |
| 9370 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9371 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9372 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9373 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9374 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9375 | run_test "DTLS fragmenting: none (for reference)" \ |
| 9376 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9377 | crt_file=data_files/server7_int-ca.crt \ |
| 9378 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9379 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9380 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9381 | "$P_CLI dtls=1 debug_level=2 \ |
| 9382 | crt_file=data_files/server8_int-ca2.crt \ |
| 9383 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9384 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9385 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9386 | 0 \ |
| 9387 | -S "found fragmented DTLS handshake message" \ |
| 9388 | -C "found fragmented DTLS handshake message" \ |
| 9389 | -C "error" |
| 9390 | |
| 9391 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9392 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9393 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9394 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9395 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9396 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9397 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9398 | crt_file=data_files/server7_int-ca.crt \ |
| 9399 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9400 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9401 | max_frag_len=1024" \ |
| 9402 | "$P_CLI dtls=1 debug_level=2 \ |
| 9403 | crt_file=data_files/server8_int-ca2.crt \ |
| 9404 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9405 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9406 | max_frag_len=2048" \ |
| 9407 | 0 \ |
| 9408 | -S "found fragmented DTLS handshake message" \ |
| 9409 | -c "found fragmented DTLS handshake message" \ |
| 9410 | -C "error" |
| 9411 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9412 | # With the MFL extension, the server has no way of forcing |
| 9413 | # the client to not exceed a certain MTU; hence, the following |
| 9414 | # test can't be replicated with an MTU proxy such as the one |
| 9415 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9416 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9417 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9418 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9419 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9420 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9421 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9422 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9423 | crt_file=data_files/server7_int-ca.crt \ |
| 9424 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9425 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9426 | max_frag_len=512" \ |
| 9427 | "$P_CLI dtls=1 debug_level=2 \ |
| 9428 | crt_file=data_files/server8_int-ca2.crt \ |
| 9429 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9430 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 9431 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9432 | 0 \ |
| 9433 | -S "found fragmented DTLS handshake message" \ |
| 9434 | -c "found fragmented DTLS handshake message" \ |
| 9435 | -C "error" |
| 9436 | |
| 9437 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9438 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9439 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9440 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9441 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9442 | run_test "DTLS fragmenting: client-initiated, server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9443 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9444 | crt_file=data_files/server7_int-ca.crt \ |
| 9445 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9446 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9447 | max_frag_len=2048" \ |
| 9448 | "$P_CLI dtls=1 debug_level=2 \ |
| 9449 | crt_file=data_files/server8_int-ca2.crt \ |
| 9450 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9451 | hs_timeout=2500-60000 \ |
| 9452 | max_frag_len=1024" \ |
| 9453 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9454 | -S "found fragmented DTLS handshake message" \ |
| 9455 | -c "found fragmented DTLS handshake message" \ |
| 9456 | -C "error" |
| 9457 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9458 | # While not required by the standard defining the MFL extension |
| 9459 | # (according to which it only applies to records, not to datagrams), |
| 9460 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9461 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9462 | # to the peer. |
| 9463 | # The next test checks that no datagrams significantly larger than the |
| 9464 | # negotiated MFL are sent. |
| 9465 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9466 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9467 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9468 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9469 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9470 | run_test "DTLS fragmenting: client-initiated, server only (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 9471 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9472 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 9473 | crt_file=data_files/server7_int-ca.crt \ |
| 9474 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9475 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9476 | max_frag_len=2048" \ |
| 9477 | "$P_CLI dtls=1 debug_level=2 \ |
| 9478 | crt_file=data_files/server8_int-ca2.crt \ |
| 9479 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9480 | hs_timeout=2500-60000 \ |
| 9481 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9482 | 0 \ |
| 9483 | -S "found fragmented DTLS handshake message" \ |
| 9484 | -c "found fragmented DTLS handshake message" \ |
| 9485 | -C "error" |
| 9486 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9487 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9488 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9489 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9490 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9492 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9493 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9494 | crt_file=data_files/server7_int-ca.crt \ |
| 9495 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9496 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9497 | max_frag_len=2048" \ |
| 9498 | "$P_CLI dtls=1 debug_level=2 \ |
| 9499 | crt_file=data_files/server8_int-ca2.crt \ |
| 9500 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9501 | hs_timeout=2500-60000 \ |
| 9502 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 9503 | 0 \ |
| 9504 | -s "found fragmented DTLS handshake message" \ |
| 9505 | -c "found fragmented DTLS handshake message" \ |
| 9506 | -C "error" |
| 9507 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9508 | # While not required by the standard defining the MFL extension |
| 9509 | # (according to which it only applies to records, not to datagrams), |
| 9510 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 9511 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 9512 | # to the peer. |
| 9513 | # The next test checks that no datagrams significantly larger than the |
| 9514 | # negotiated MFL are sent. |
| 9515 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9516 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9517 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9518 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9519 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9520 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 9521 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9522 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9523 | crt_file=data_files/server7_int-ca.crt \ |
| 9524 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9525 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9526 | max_frag_len=2048" \ |
| 9527 | "$P_CLI dtls=1 debug_level=2 \ |
| 9528 | crt_file=data_files/server8_int-ca2.crt \ |
| 9529 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9530 | hs_timeout=2500-60000 \ |
| 9531 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 9532 | 0 \ |
| 9533 | -s "found fragmented DTLS handshake message" \ |
| 9534 | -c "found fragmented DTLS handshake message" \ |
| 9535 | -C "error" |
| 9536 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9537 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9538 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9539 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9540 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9541 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 9542 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9543 | crt_file=data_files/server7_int-ca.crt \ |
| 9544 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9545 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9546 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9547 | "$P_CLI dtls=1 debug_level=2 \ |
| 9548 | crt_file=data_files/server8_int-ca2.crt \ |
| 9549 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9550 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9551 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9552 | 0 \ |
| 9553 | -S "found fragmented DTLS handshake message" \ |
| 9554 | -C "found fragmented DTLS handshake message" \ |
| 9555 | -C "error" |
| 9556 | |
| 9557 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9558 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9559 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9560 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9561 | run_test "DTLS fragmenting: client (MTU)" \ |
| 9562 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9563 | crt_file=data_files/server7_int-ca.crt \ |
| 9564 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9565 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 9566 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9567 | "$P_CLI dtls=1 debug_level=2 \ |
| 9568 | crt_file=data_files/server8_int-ca2.crt \ |
| 9569 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9570 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9571 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9572 | 0 \ |
| 9573 | -s "found fragmented DTLS handshake message" \ |
| 9574 | -C "found fragmented DTLS handshake message" \ |
| 9575 | -C "error" |
| 9576 | |
| 9577 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9578 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9579 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9580 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9581 | run_test "DTLS fragmenting: server (MTU)" \ |
| 9582 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9583 | crt_file=data_files/server7_int-ca.crt \ |
| 9584 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9585 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9586 | mtu=512" \ |
| 9587 | "$P_CLI dtls=1 debug_level=2 \ |
| 9588 | crt_file=data_files/server8_int-ca2.crt \ |
| 9589 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9590 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9591 | mtu=2048" \ |
| 9592 | 0 \ |
| 9593 | -S "found fragmented DTLS handshake message" \ |
| 9594 | -c "found fragmented DTLS handshake message" \ |
| 9595 | -C "error" |
| 9596 | |
| 9597 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9598 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9599 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9600 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9601 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9602 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9603 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9604 | crt_file=data_files/server7_int-ca.crt \ |
| 9605 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9606 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 9607 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9608 | "$P_CLI dtls=1 debug_level=2 \ |
| 9609 | crt_file=data_files/server8_int-ca2.crt \ |
| 9610 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9611 | hs_timeout=2500-60000 \ |
| 9612 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 9613 | 0 \ |
| 9614 | -s "found fragmented DTLS handshake message" \ |
| 9615 | -c "found fragmented DTLS handshake message" \ |
| 9616 | -C "error" |
| 9617 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9618 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9619 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9620 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9621 | requires_hash_alg SHA_256 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9622 | requires_config_enabled MBEDTLS_AES_C |
| 9623 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9624 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9625 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 9626 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9627 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9628 | crt_file=data_files/server7_int-ca.crt \ |
| 9629 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9630 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 9631 | mtu=512" \ |
| 9632 | "$P_CLI dtls=1 debug_level=2 \ |
| 9633 | crt_file=data_files/server8_int-ca2.crt \ |
| 9634 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9635 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9636 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9637 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9638 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9639 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9640 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9641 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9642 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9643 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9644 | # Forcing ciphersuite for this test to fit the MTU of 508 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9645 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 9646 | # retransmissions, but in some cases (like both the server and client using |
| 9647 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 9648 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 9649 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9650 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9651 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9652 | requires_config_enabled MBEDTLS_AES_C |
| 9653 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9654 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9655 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9656 | -p "$P_PXY mtu=508" \ |
| 9657 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9658 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9659 | key_file=data_files/server7.key \ |
| 9660 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9661 | "$P_CLI dtls=1 debug_level=2 \ |
| 9662 | crt_file=data_files/server8_int-ca2.crt \ |
| 9663 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9664 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9665 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 9666 | 0 \ |
| 9667 | -s "found fragmented DTLS handshake message" \ |
| 9668 | -c "found fragmented DTLS handshake message" \ |
| 9669 | -C "error" |
| 9670 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9671 | # Forcing ciphersuite for this test to fit the MTU of 508 with full config. |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9672 | only_with_valgrind |
| 9673 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9674 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9675 | requires_config_enabled MBEDTLS_AES_C |
| 9676 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9677 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 9678 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9679 | -p "$P_PXY mtu=508" \ |
| 9680 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9681 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9682 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9683 | hs_timeout=250-10000" \ |
| 9684 | "$P_CLI dtls=1 debug_level=2 \ |
| 9685 | crt_file=data_files/server8_int-ca2.crt \ |
| 9686 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9687 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 9688 | hs_timeout=250-10000" \ |
| 9689 | 0 \ |
| 9690 | -s "found fragmented DTLS handshake message" \ |
| 9691 | -c "found fragmented DTLS handshake message" \ |
| 9692 | -C "error" |
| 9693 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9694 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
Manuel Pégourié-Gonnard | 3d183ce | 2018-08-22 09:56:22 +0200 | [diff] [blame] | 9695 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9696 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9697 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9698 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9699 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9700 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9701 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9702 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9703 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9704 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9705 | crt_file=data_files/server7_int-ca.crt \ |
| 9706 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9707 | hs_timeout=10000-60000 \ |
| 9708 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9709 | "$P_CLI dtls=1 debug_level=2 \ |
| 9710 | crt_file=data_files/server8_int-ca2.crt \ |
| 9711 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9712 | hs_timeout=10000-60000 \ |
| 9713 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9714 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9715 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9716 | -s "found fragmented DTLS handshake message" \ |
| 9717 | -c "found fragmented DTLS handshake message" \ |
| 9718 | -C "error" |
| 9719 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9720 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9721 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 9722 | # OTOH the client might resend if the server is to slow to reset after sending |
| 9723 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9724 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9725 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9726 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9727 | requires_config_enabled MBEDTLS_AES_C |
| 9728 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9729 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9730 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9731 | -p "$P_PXY mtu=512" \ |
| 9732 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9733 | crt_file=data_files/server7_int-ca.crt \ |
| 9734 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9735 | hs_timeout=10000-60000 \ |
| 9736 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9737 | "$P_CLI dtls=1 debug_level=2 \ |
| 9738 | crt_file=data_files/server8_int-ca2.crt \ |
| 9739 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9740 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9741 | hs_timeout=10000-60000 \ |
| 9742 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9743 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9744 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9745 | -s "found fragmented DTLS handshake message" \ |
| 9746 | -c "found fragmented DTLS handshake message" \ |
| 9747 | -C "error" |
| 9748 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9749 | not_with_valgrind # spurious autoreduction due to timeout |
| 9750 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9751 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9752 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9753 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9754 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9755 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9756 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9757 | crt_file=data_files/server7_int-ca.crt \ |
| 9758 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9759 | hs_timeout=10000-60000 \ |
| 9760 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9761 | "$P_CLI dtls=1 debug_level=2 \ |
| 9762 | crt_file=data_files/server8_int-ca2.crt \ |
| 9763 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9764 | hs_timeout=10000-60000 \ |
| 9765 | mtu=1024 nbio=2" \ |
| 9766 | 0 \ |
| 9767 | -S "autoreduction" \ |
| 9768 | -s "found fragmented DTLS handshake message" \ |
| 9769 | -c "found fragmented DTLS handshake message" \ |
| 9770 | -C "error" |
| 9771 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9772 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9773 | not_with_valgrind # spurious autoreduction due to timeout |
| 9774 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9775 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9776 | requires_config_enabled MBEDTLS_AES_C |
| 9777 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9778 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9779 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 9780 | -p "$P_PXY mtu=512" \ |
| 9781 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9782 | crt_file=data_files/server7_int-ca.crt \ |
| 9783 | key_file=data_files/server7.key \ |
| 9784 | hs_timeout=10000-60000 \ |
| 9785 | mtu=512 nbio=2" \ |
| 9786 | "$P_CLI dtls=1 debug_level=2 \ |
| 9787 | crt_file=data_files/server8_int-ca2.crt \ |
| 9788 | key_file=data_files/server8.key \ |
| 9789 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9790 | hs_timeout=10000-60000 \ |
| 9791 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9792 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9793 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9794 | -s "found fragmented DTLS handshake message" \ |
| 9795 | -c "found fragmented DTLS handshake message" \ |
| 9796 | -C "error" |
| 9797 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9798 | # Forcing ciphersuite for this test to fit the MTU of 1450 with full config. |
Hanno Becker | b841b4f | 2018-08-28 10:25:51 +0100 | [diff] [blame] | 9799 | # This ensures things still work after session_reset(). |
| 9800 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9801 | # Since we don't support reading fragmented ClientHello yet, |
| 9802 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 9803 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9804 | # An autoreduction on the client-side might happen if the server is |
| 9805 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 9806 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9807 | # resumed listening, which would result in a spurious autoreduction. |
| 9808 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9809 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9810 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9811 | requires_config_enabled MBEDTLS_AES_C |
| 9812 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9813 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9814 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 9815 | -p "$P_PXY mtu=1450" \ |
| 9816 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9817 | crt_file=data_files/server7_int-ca.crt \ |
| 9818 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9819 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9820 | mtu=1450" \ |
| 9821 | "$P_CLI dtls=1 debug_level=2 \ |
| 9822 | crt_file=data_files/server8_int-ca2.crt \ |
| 9823 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9824 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9825 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 9826 | mtu=1450 reconnect=1 skip_close_notify=1 reco_delay=1000" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9827 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9828 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 9829 | -s "found fragmented DTLS handshake message" \ |
| 9830 | -c "found fragmented DTLS handshake message" \ |
| 9831 | -C "error" |
| 9832 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9833 | # An autoreduction on the client-side might happen if the server is |
| 9834 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9835 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9836 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9837 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9838 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9839 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9840 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9841 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9842 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 9843 | -p "$P_PXY mtu=512" \ |
| 9844 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9845 | crt_file=data_files/server7_int-ca.crt \ |
| 9846 | key_file=data_files/server7.key \ |
| 9847 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9848 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9849 | mtu=512" \ |
| 9850 | "$P_CLI dtls=1 debug_level=2 \ |
| 9851 | crt_file=data_files/server8_int-ca2.crt \ |
| 9852 | key_file=data_files/server8.key \ |
| 9853 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9854 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9855 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9856 | mtu=512" \ |
| 9857 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9858 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9859 | -s "found fragmented DTLS handshake message" \ |
| 9860 | -c "found fragmented DTLS handshake message" \ |
| 9861 | -C "error" |
| 9862 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9863 | # An autoreduction on the client-side might happen if the server is |
| 9864 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9865 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9866 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9867 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9868 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9869 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9870 | requires_config_enabled MBEDTLS_AES_C |
| 9871 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9872 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9873 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 9874 | -p "$P_PXY mtu=512" \ |
| 9875 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9876 | crt_file=data_files/server7_int-ca.crt \ |
| 9877 | key_file=data_files/server7.key \ |
| 9878 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9879 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9880 | mtu=512" \ |
| 9881 | "$P_CLI dtls=1 debug_level=2 \ |
| 9882 | crt_file=data_files/server8_int-ca2.crt \ |
| 9883 | key_file=data_files/server8.key \ |
| 9884 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9885 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9886 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9887 | mtu=512" \ |
| 9888 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9889 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9890 | -s "found fragmented DTLS handshake message" \ |
| 9891 | -c "found fragmented DTLS handshake message" \ |
| 9892 | -C "error" |
| 9893 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9894 | # An autoreduction on the client-side might happen if the server is |
| 9895 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9896 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9897 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9898 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9899 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9900 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9901 | requires_config_enabled MBEDTLS_AES_C |
| 9902 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9903 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9904 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9905 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9906 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9907 | crt_file=data_files/server7_int-ca.crt \ |
| 9908 | key_file=data_files/server7.key \ |
| 9909 | exchanges=2 renegotiation=1 \ |
| 9910 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9911 | hs_timeout=10000-60000 \ |
| 9912 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9913 | "$P_CLI dtls=1 debug_level=2 \ |
| 9914 | crt_file=data_files/server8_int-ca2.crt \ |
| 9915 | key_file=data_files/server8.key \ |
| 9916 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9917 | hs_timeout=10000-60000 \ |
| 9918 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9919 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9920 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9921 | -s "found fragmented DTLS handshake message" \ |
| 9922 | -c "found fragmented DTLS handshake message" \ |
| 9923 | -C "error" |
| 9924 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9925 | # An autoreduction on the client-side might happen if the server is |
| 9926 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9927 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9928 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9929 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9930 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9931 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9932 | requires_config_enabled MBEDTLS_AES_C |
| 9933 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 9934 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9935 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9936 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9937 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9938 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9939 | crt_file=data_files/server7_int-ca.crt \ |
| 9940 | key_file=data_files/server7.key \ |
| 9941 | exchanges=2 renegotiation=1 \ |
| 9942 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9943 | hs_timeout=10000-60000 \ |
| 9944 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9945 | "$P_CLI dtls=1 debug_level=2 \ |
| 9946 | crt_file=data_files/server8_int-ca2.crt \ |
| 9947 | key_file=data_files/server8.key \ |
| 9948 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9949 | hs_timeout=10000-60000 \ |
| 9950 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9951 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9952 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9953 | -s "found fragmented DTLS handshake message" \ |
| 9954 | -c "found fragmented DTLS handshake message" \ |
| 9955 | -C "error" |
| 9956 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9957 | # An autoreduction on the client-side might happen if the server is |
| 9958 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 9959 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9960 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9961 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 9962 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9963 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 9964 | requires_config_enabled MBEDTLS_AES_C |
| 9965 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9966 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9967 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9968 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9969 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9970 | crt_file=data_files/server7_int-ca.crt \ |
| 9971 | key_file=data_files/server7.key \ |
| 9972 | exchanges=2 renegotiation=1 \ |
| 9973 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9974 | hs_timeout=10000-60000 \ |
| 9975 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9976 | "$P_CLI dtls=1 debug_level=2 \ |
| 9977 | crt_file=data_files/server8_int-ca2.crt \ |
| 9978 | key_file=data_files/server8.key \ |
| 9979 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 9980 | hs_timeout=10000-60000 \ |
| 9981 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9982 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 9983 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 9984 | -s "found fragmented DTLS handshake message" \ |
| 9985 | -c "found fragmented DTLS handshake message" \ |
| 9986 | -C "error" |
| 9987 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9988 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9989 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9990 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9991 | requires_config_enabled MBEDTLS_AES_C |
| 9992 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9993 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9994 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9995 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 9996 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9997 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 auth_mode=required \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 9998 | crt_file=data_files/server7_int-ca.crt \ |
| 9999 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10000 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10001 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10002 | crt_file=data_files/server8_int-ca2.crt \ |
| 10003 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10004 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10005 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 10006 | 0 \ |
| 10007 | -s "found fragmented DTLS handshake message" \ |
| 10008 | -c "found fragmented DTLS handshake message" \ |
| 10009 | -C "error" |
| 10010 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10011 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10012 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10013 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10014 | requires_config_enabled MBEDTLS_AES_C |
| 10015 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10016 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10017 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10018 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 10019 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 10020 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 10021 | crt_file=data_files/server7_int-ca.crt \ |
| 10022 | key_file=data_files/server7.key \ |
| 10023 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 10024 | "$P_CLI dtls=1 debug_level=2 \ |
| 10025 | crt_file=data_files/server8_int-ca2.crt \ |
| 10026 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10027 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10028 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 10029 | 0 \ |
| 10030 | -s "found fragmented DTLS handshake message" \ |
| 10031 | -c "found fragmented DTLS handshake message" \ |
| 10032 | -C "error" |
| 10033 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10034 | # interop tests for DTLS fragmentating with reliable connection |
| 10035 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10036 | # here and below we just want to test that the we fragment in a way that |
| 10037 | # pleases other implementations, so we don't need the peer to fragment |
| 10038 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10039 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 10040 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10041 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10042 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 10043 | "$G_SRV -u" \ |
| 10044 | "$P_CLI dtls=1 debug_level=2 \ |
| 10045 | crt_file=data_files/server8_int-ca2.crt \ |
| 10046 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10047 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10048 | 0 \ |
| 10049 | -c "fragmenting handshake message" \ |
| 10050 | -C "error" |
| 10051 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 10052 | # We use --insecure for the GnuTLS client because it expects |
| 10053 | # the hostname / IP it connects to to be the name used in the |
| 10054 | # certificate obtained from the server. Here, however, it |
| 10055 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 10056 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 10057 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 10058 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10059 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10060 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 10061 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 10062 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10063 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10064 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Valerio Setti | 3b2c028 | 2023-03-08 10:22:29 +0100 | [diff] [blame] | 10065 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10066 | crt_file=data_files/server7_int-ca.crt \ |
| 10067 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10068 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 10069 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10070 | 0 \ |
| 10071 | -s "fragmenting handshake message" |
| 10072 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10073 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10074 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10075 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10076 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 10077 | "$O_SRV -dtls1_2 -verify 10" \ |
| 10078 | "$P_CLI dtls=1 debug_level=2 \ |
| 10079 | crt_file=data_files/server8_int-ca2.crt \ |
| 10080 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10081 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10082 | 0 \ |
| 10083 | -c "fragmenting handshake message" \ |
| 10084 | -C "error" |
| 10085 | |
| 10086 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10087 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10088 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10089 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 10090 | "$P_SRV dtls=1 debug_level=2 \ |
| 10091 | crt_file=data_files/server7_int-ca.crt \ |
| 10092 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10093 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 10094 | "$O_CLI -dtls1_2" \ |
| 10095 | 0 \ |
| 10096 | -s "fragmenting handshake message" |
| 10097 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10098 | # interop tests for DTLS fragmentating with unreliable connection |
| 10099 | # |
| 10100 | # again we just want to test that the we fragment in a way that |
| 10101 | # pleases other implementations, so we don't need the peer to fragment |
| 10102 | requires_gnutls_next |
| 10103 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10104 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 10105 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10106 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10107 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 10108 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10109 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10110 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10111 | crt_file=data_files/server8_int-ca2.crt \ |
| 10112 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10113 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10114 | 0 \ |
| 10115 | -c "fragmenting handshake message" \ |
| 10116 | -C "error" |
| 10117 | |
| 10118 | requires_gnutls_next |
| 10119 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10120 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10121 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10122 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10123 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 10124 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10125 | "$P_SRV dtls=1 debug_level=2 \ |
| 10126 | crt_file=data_files/server7_int-ca.crt \ |
| 10127 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10128 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10129 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10130 | 0 \ |
| 10131 | -s "fragmenting handshake message" |
| 10132 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 10133 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 10134 | ## it might trigger a bug due to openssl server (https://github.com/openssl/openssl/issues/6902) |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10135 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10136 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10137 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10138 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10139 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10140 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 10141 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 10142 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10143 | "$P_CLI dtls=1 debug_level=2 \ |
| 10144 | crt_file=data_files/server8_int-ca2.crt \ |
| 10145 | key_file=data_files/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10146 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 10147 | 0 \ |
| 10148 | -c "fragmenting handshake message" \ |
| 10149 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10150 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 10151 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 10152 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 10153 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10154 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10155 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10156 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10157 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10158 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 10159 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 10160 | "$P_SRV dtls=1 debug_level=2 \ |
| 10161 | crt_file=data_files/server7_int-ca.crt \ |
| 10162 | key_file=data_files/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 10163 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 10164 | "$O_CLI -dtls1_2" \ |
| 10165 | 0 \ |
| 10166 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 10167 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10168 | # Tests for DTLS-SRTP (RFC 5764) |
| 10169 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10170 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10171 | run_test "DTLS-SRTP all profiles supported" \ |
| 10172 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10173 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10174 | 0 \ |
| 10175 | -s "found use_srtp extension" \ |
| 10176 | -s "found srtp profile" \ |
| 10177 | -s "selected srtp profile" \ |
| 10178 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10179 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10180 | -c "client hello, adding use_srtp extension" \ |
| 10181 | -c "found use_srtp extension" \ |
| 10182 | -c "found srtp profile" \ |
| 10183 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10184 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10185 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10186 | -C "error" |
| 10187 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10188 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10189 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10190 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10191 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 10192 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10193 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=5 debug_level=3" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10194 | 0 \ |
| 10195 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10196 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 10197 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10198 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10199 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10200 | -c "client hello, adding use_srtp extension" \ |
| 10201 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10202 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10203 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10204 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10205 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10206 | -C "error" |
| 10207 | |
| 10208 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10209 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10210 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10211 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10212 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10213 | 0 \ |
| 10214 | -s "found use_srtp extension" \ |
| 10215 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10216 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10217 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10218 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10219 | -c "client hello, adding use_srtp extension" \ |
| 10220 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10221 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10222 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10223 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10224 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10225 | -C "error" |
| 10226 | |
| 10227 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10228 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10229 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 10230 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10231 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10232 | 0 \ |
| 10233 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10234 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10235 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10236 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10237 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10238 | -c "client hello, adding use_srtp extension" \ |
| 10239 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10240 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10241 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10242 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10243 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10244 | -C "error" |
| 10245 | |
| 10246 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10247 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10248 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 10249 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10250 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10251 | 0 \ |
| 10252 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10253 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10254 | -S "selected srtp profile" \ |
| 10255 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10256 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10257 | -c "client hello, adding use_srtp extension" \ |
| 10258 | -C "found use_srtp extension" \ |
| 10259 | -C "found srtp profile" \ |
| 10260 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10261 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10262 | -C "error" |
| 10263 | |
| 10264 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10265 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10266 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 10267 | "$P_SRV dtls=1 debug_level=3" \ |
| 10268 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10269 | 0 \ |
| 10270 | -s "found use_srtp extension" \ |
| 10271 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10272 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10273 | -c "client hello, adding use_srtp extension" \ |
| 10274 | -C "found use_srtp extension" \ |
| 10275 | -C "found srtp profile" \ |
| 10276 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10277 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10278 | -C "error" |
| 10279 | |
| 10280 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10281 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10282 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 10283 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 10284 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10285 | 0 \ |
| 10286 | -s "found use_srtp extension" \ |
| 10287 | -s "found srtp profile" \ |
| 10288 | -s "selected srtp profile" \ |
| 10289 | -s "server hello, adding use_srtp extension" \ |
| 10290 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10291 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10292 | -c "client hello, adding use_srtp extension" \ |
| 10293 | -c "found use_srtp extension" \ |
| 10294 | -c "found srtp profile" \ |
| 10295 | -c "selected srtp profile" \ |
| 10296 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10297 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10298 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10299 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10300 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10301 | -C "error" |
| 10302 | |
| 10303 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10304 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10305 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 10306 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10307 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10308 | 0 \ |
| 10309 | -s "found use_srtp extension" \ |
| 10310 | -s "found srtp profile" \ |
| 10311 | -s "selected srtp profile" \ |
| 10312 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10313 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10314 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10315 | -S "dumping 'using mki' (8 bytes)" \ |
| 10316 | -c "client hello, adding use_srtp extension" \ |
| 10317 | -c "found use_srtp extension" \ |
| 10318 | -c "found srtp profile" \ |
| 10319 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10320 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 10321 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 10322 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 10323 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10324 | -C "dumping 'received mki' (8 bytes)" \ |
| 10325 | -C "error" |
| 10326 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10327 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10328 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10329 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 10330 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10331 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10332 | 0 \ |
| 10333 | -s "found use_srtp extension" \ |
| 10334 | -s "found srtp profile" \ |
| 10335 | -s "selected srtp profile" \ |
| 10336 | -s "server hello, adding use_srtp extension" \ |
| 10337 | -s "DTLS-SRTP key material is"\ |
| 10338 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10339 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 10340 | |
| 10341 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10342 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10343 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 10344 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10345 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10346 | 0 \ |
| 10347 | -s "found use_srtp extension" \ |
| 10348 | -s "found srtp profile" \ |
| 10349 | -s "selected srtp profile" \ |
| 10350 | -s "server hello, adding use_srtp extension" \ |
| 10351 | -s "DTLS-SRTP key material is"\ |
| 10352 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10353 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10354 | |
| 10355 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10356 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10357 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 10358 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10359 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10360 | 0 \ |
| 10361 | -s "found use_srtp extension" \ |
| 10362 | -s "found srtp profile" \ |
| 10363 | -s "selected srtp profile" \ |
| 10364 | -s "server hello, adding use_srtp extension" \ |
| 10365 | -s "DTLS-SRTP key material is"\ |
| 10366 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10367 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10368 | |
| 10369 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10370 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10371 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 10372 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10373 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10374 | 0 \ |
| 10375 | -s "found use_srtp extension" \ |
| 10376 | -s "found srtp profile" \ |
| 10377 | -s "selected srtp profile" \ |
| 10378 | -s "server hello, adding use_srtp extension" \ |
| 10379 | -s "DTLS-SRTP key material is"\ |
| 10380 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10381 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10382 | |
| 10383 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10384 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10385 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 10386 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10387 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10388 | 0 \ |
| 10389 | -s "found use_srtp extension" \ |
| 10390 | -s "found srtp profile" \ |
| 10391 | -s "selected srtp profile" \ |
| 10392 | -s "server hello, adding use_srtp extension" \ |
| 10393 | -s "DTLS-SRTP key material is"\ |
| 10394 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 10395 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 10396 | |
| 10397 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10398 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10399 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 10400 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10401 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10402 | 0 \ |
| 10403 | -s "found use_srtp extension" \ |
| 10404 | -s "found srtp profile" \ |
| 10405 | -S "selected srtp profile" \ |
| 10406 | -S "server hello, adding use_srtp extension" \ |
| 10407 | -S "DTLS-SRTP key material is"\ |
| 10408 | -C "SRTP Extension negotiated, profile" |
| 10409 | |
| 10410 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10411 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10412 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 10413 | "$P_SRV dtls=1 debug_level=3" \ |
| 10414 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10415 | 0 \ |
| 10416 | -s "found use_srtp extension" \ |
| 10417 | -S "server hello, adding use_srtp extension" \ |
| 10418 | -S "DTLS-SRTP key material is"\ |
| 10419 | -C "SRTP Extension negotiated, profile" |
| 10420 | |
| 10421 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10423 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 10424 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10425 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10426 | 0 \ |
| 10427 | -c "client hello, adding use_srtp extension" \ |
| 10428 | -c "found use_srtp extension" \ |
| 10429 | -c "found srtp profile" \ |
| 10430 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 10431 | -c "DTLS-SRTP key material is"\ |
| 10432 | -C "error" |
| 10433 | |
| 10434 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10435 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10436 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 10437 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10438 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10439 | 0 \ |
| 10440 | -c "client hello, adding use_srtp extension" \ |
| 10441 | -c "found use_srtp extension" \ |
| 10442 | -c "found srtp profile" \ |
| 10443 | -c "selected srtp profile" \ |
| 10444 | -c "DTLS-SRTP key material is"\ |
| 10445 | -C "error" |
| 10446 | |
| 10447 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10448 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10449 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 10450 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10451 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10452 | 0 \ |
| 10453 | -c "client hello, adding use_srtp extension" \ |
| 10454 | -c "found use_srtp extension" \ |
| 10455 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10456 | -c "selected srtp profile" \ |
| 10457 | -c "DTLS-SRTP key material is"\ |
| 10458 | -C "error" |
| 10459 | |
| 10460 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10461 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10462 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 10463 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10464 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10465 | 0 \ |
| 10466 | -c "client hello, adding use_srtp extension" \ |
| 10467 | -c "found use_srtp extension" \ |
| 10468 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10469 | -c "selected srtp profile" \ |
| 10470 | -c "DTLS-SRTP key material is"\ |
| 10471 | -C "error" |
| 10472 | |
| 10473 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10474 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10475 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 10476 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10477 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10478 | 0 \ |
| 10479 | -c "client hello, adding use_srtp extension" \ |
| 10480 | -c "found use_srtp extension" \ |
| 10481 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10482 | -c "selected srtp profile" \ |
| 10483 | -c "DTLS-SRTP key material is"\ |
| 10484 | -C "error" |
| 10485 | |
| 10486 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10487 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10488 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 10489 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10490 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 10491 | 0 \ |
| 10492 | -c "client hello, adding use_srtp extension" \ |
| 10493 | -C "found use_srtp extension" \ |
| 10494 | -C "found srtp profile" \ |
| 10495 | -C "selected srtp profile" \ |
| 10496 | -C "DTLS-SRTP key material is"\ |
| 10497 | -C "error" |
| 10498 | |
| 10499 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10500 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10501 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 10502 | "$O_SRV -dtls" \ |
| 10503 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10504 | 0 \ |
| 10505 | -c "client hello, adding use_srtp extension" \ |
| 10506 | -C "found use_srtp extension" \ |
| 10507 | -C "found srtp profile" \ |
| 10508 | -C "selected srtp profile" \ |
| 10509 | -C "DTLS-SRTP key material is"\ |
| 10510 | -C "error" |
| 10511 | |
| 10512 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10513 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10514 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 10515 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 10516 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10517 | 0 \ |
| 10518 | -c "client hello, adding use_srtp extension" \ |
| 10519 | -c "found use_srtp extension" \ |
| 10520 | -c "found srtp profile" \ |
| 10521 | -c "selected srtp profile" \ |
| 10522 | -c "DTLS-SRTP key material is"\ |
| 10523 | -c "DTLS-SRTP no mki value negotiated"\ |
| 10524 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10525 | -C "dumping 'received mki' (8 bytes)" \ |
| 10526 | -C "error" |
| 10527 | |
| 10528 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10529 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10530 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10531 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10532 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10533 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10534 | 0 \ |
| 10535 | -s "found use_srtp extension" \ |
| 10536 | -s "found srtp profile" \ |
| 10537 | -s "selected srtp profile" \ |
| 10538 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10539 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10540 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 10541 | |
| 10542 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10543 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10545 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10546 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10547 | "$G_CLI -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_80:SRTP_NULL_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10548 | 0 \ |
| 10549 | -s "found use_srtp extension" \ |
| 10550 | -s "found srtp profile" \ |
| 10551 | -s "selected srtp profile" \ |
| 10552 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10553 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10554 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 10555 | |
| 10556 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10557 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10558 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10559 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10560 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 10561 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10562 | 0 \ |
| 10563 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10564 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10565 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10566 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10567 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10568 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10569 | |
| 10570 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10571 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10572 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10573 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls client." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10574 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10575 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10576 | 0 \ |
| 10577 | -s "found use_srtp extension" \ |
| 10578 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10579 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10580 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10581 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10582 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 10583 | |
| 10584 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10585 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10586 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10587 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10588 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10589 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10590 | 0 \ |
| 10591 | -s "found use_srtp extension" \ |
| 10592 | -s "found srtp profile" \ |
| 10593 | -s "selected srtp profile" \ |
| 10594 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10595 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10596 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 10597 | |
| 10598 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10599 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10600 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10601 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10602 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 10603 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10604 | 0 \ |
| 10605 | -s "found use_srtp extension" \ |
| 10606 | -s "found srtp profile" \ |
| 10607 | -S "selected srtp profile" \ |
| 10608 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10609 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10610 | -C "SRTP profile:" |
| 10611 | |
| 10612 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10613 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10615 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls client" \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10616 | "$P_SRV dtls=1 debug_level=3" \ |
| 10617 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10618 | 0 \ |
| 10619 | -s "found use_srtp extension" \ |
| 10620 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10621 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10622 | -C "SRTP profile:" |
| 10623 | |
| 10624 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10625 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10626 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10627 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 10628 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \ |
| 10629 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10630 | 0 \ |
| 10631 | -c "client hello, adding use_srtp extension" \ |
| 10632 | -c "found use_srtp extension" \ |
| 10633 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10634 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10635 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10636 | -C "error" |
| 10637 | |
| 10638 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10639 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10640 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10641 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 10642 | "$G_SRV -u --srtp-profiles=SRTP_NULL_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_80:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \ |
| 10643 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10644 | 0 \ |
| 10645 | -c "client hello, adding use_srtp extension" \ |
| 10646 | -c "found use_srtp extension" \ |
| 10647 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10648 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10649 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10650 | -C "error" |
| 10651 | |
| 10652 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10653 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10654 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10655 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 10656 | "$G_SRV -u --srtp-profiles=SRTP_NULL_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_80:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \ |
| 10657 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10658 | 0 \ |
| 10659 | -c "client hello, adding use_srtp extension" \ |
| 10660 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10661 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10662 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10663 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10664 | -C "error" |
| 10665 | |
| 10666 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10667 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10668 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10669 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 10670 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10671 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10672 | 0 \ |
| 10673 | -c "client hello, adding use_srtp extension" \ |
| 10674 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10675 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10676 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10677 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10678 | -C "error" |
| 10679 | |
| 10680 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10681 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10682 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10683 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 10684 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 10685 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 10686 | 0 \ |
| 10687 | -c "client hello, adding use_srtp extension" \ |
| 10688 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10689 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10690 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10691 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10692 | -C "error" |
| 10693 | |
| 10694 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10695 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10697 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 10698 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 10699 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10700 | 0 \ |
| 10701 | -c "client hello, adding use_srtp extension" \ |
| 10702 | -C "found use_srtp extension" \ |
| 10703 | -C "found srtp profile" \ |
| 10704 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10705 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10706 | -C "error" |
| 10707 | |
| 10708 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10709 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10710 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10711 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 10712 | "$G_SRV -u" \ |
| 10713 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 10714 | 0 \ |
| 10715 | -c "client hello, adding use_srtp extension" \ |
| 10716 | -C "found use_srtp extension" \ |
| 10717 | -C "found srtp profile" \ |
| 10718 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10719 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10720 | -C "error" |
| 10721 | |
| 10722 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 10723 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10724 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10725 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 10726 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \ |
| 10727 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 10728 | 0 \ |
| 10729 | -c "client hello, adding use_srtp extension" \ |
| 10730 | -c "found use_srtp extension" \ |
| 10731 | -c "found srtp profile" \ |
| 10732 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 10733 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 10734 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 10735 | -c "dumping 'sending mki' (8 bytes)" \ |
| 10736 | -c "dumping 'received mki' (8 bytes)" \ |
| 10737 | -C "error" |
| 10738 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10739 | # Tests for specific things with "unreliable" UDP connection |
| 10740 | |
| 10741 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10742 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10743 | run_test "DTLS proxy: reference" \ |
| 10744 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10745 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 10746 | "$P_CLI dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 10747 | 0 \ |
| 10748 | -C "replayed record" \ |
| 10749 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 10750 | -C "Buffer record from epoch" \ |
| 10751 | -S "Buffer record from epoch" \ |
| 10752 | -C "ssl_buffer_message" \ |
| 10753 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 10754 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10755 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10756 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10757 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 10758 | -c "HTTP/1.0 200 OK" |
| 10759 | |
| 10760 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10761 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10762 | run_test "DTLS proxy: duplicate every packet" \ |
| 10763 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10764 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 10765 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10766 | 0 \ |
| 10767 | -c "replayed record" \ |
| 10768 | -s "replayed record" \ |
| 10769 | -c "record from another epoch" \ |
| 10770 | -s "record from another epoch" \ |
| 10771 | -S "resend" \ |
| 10772 | -s "Extra-header:" \ |
| 10773 | -c "HTTP/1.0 200 OK" |
| 10774 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10775 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 10776 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 10777 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10778 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 10779 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10780 | 0 \ |
| 10781 | -c "replayed record" \ |
| 10782 | -S "replayed record" \ |
| 10783 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10784 | -s "record from another epoch" \ |
| 10785 | -c "resend" \ |
| 10786 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10787 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10788 | -c "HTTP/1.0 200 OK" |
| 10789 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10790 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10791 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 10792 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10793 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10794 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10795 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10796 | -c "next record in same datagram" \ |
| 10797 | -s "next record in same datagram" |
| 10798 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10799 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10800 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 10801 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10802 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 10803 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10804 | 0 \ |
| 10805 | -c "next record in same datagram" \ |
| 10806 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10807 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10808 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10809 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 10810 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10811 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 10812 | "$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10813 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10814 | -c "discarding invalid record (mac)" \ |
| 10815 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10816 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10817 | -c "HTTP/1.0 200 OK" \ |
| 10818 | -S "too many records with bad MAC" \ |
| 10819 | -S "Verification of the message MAC failed" |
| 10820 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10821 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10822 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 10823 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10824 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 10825 | "$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10826 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10827 | -C "discarding invalid record (mac)" \ |
| 10828 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10829 | -S "Extra-header:" \ |
| 10830 | -C "HTTP/1.0 200 OK" \ |
| 10831 | -s "too many records with bad MAC" \ |
| 10832 | -s "Verification of the message MAC failed" |
| 10833 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10834 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10835 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 10836 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10837 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 10838 | "$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10839 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10840 | -c "discarding invalid record (mac)" \ |
| 10841 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10842 | -s "Extra-header:" \ |
| 10843 | -c "HTTP/1.0 200 OK" \ |
| 10844 | -S "too many records with bad MAC" \ |
| 10845 | -S "Verification of the message MAC failed" |
| 10846 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10847 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10848 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 10849 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 10850 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 10851 | "$P_CLI dtls=1 dgram_packing=0 debug_level=1 read_timeout=100 exchanges=2" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10852 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10853 | -c "discarding invalid record (mac)" \ |
| 10854 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10855 | -s "Extra-header:" \ |
| 10856 | -c "HTTP/1.0 200 OK" \ |
| 10857 | -s "too many records with bad MAC" \ |
| 10858 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10859 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10860 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10861 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 10862 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 10863 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 10864 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10865 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10866 | -c "record from another epoch" \ |
| 10867 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10868 | -s "Extra-header:" \ |
| 10869 | -c "HTTP/1.0 200 OK" |
| 10870 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10871 | # Tests for reordering support with DTLS |
| 10872 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10873 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10874 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10875 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 10876 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10877 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10878 | hs_timeout=2500-60000" \ |
| 10879 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10880 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10881 | 0 \ |
| 10882 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10883 | -c "Next handshake message has been buffered - load"\ |
| 10884 | -S "Buffering HS message" \ |
| 10885 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10886 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10887 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10888 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10889 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 10890 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10891 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10892 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10893 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 10894 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10895 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10896 | hs_timeout=2500-60000" \ |
| 10897 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10898 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10899 | 0 \ |
| 10900 | -c "Buffering HS message" \ |
| 10901 | -c "found fragmented DTLS handshake message"\ |
| 10902 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 10903 | -c "Next handshake message has been buffered - load"\ |
| 10904 | -S "Buffering HS message" \ |
| 10905 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10906 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 10907 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10908 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 10909 | -S "Remember CCS message" |
| 10910 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10911 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 10912 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 10913 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 10914 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10915 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10916 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10917 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10918 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10919 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10920 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10921 | hs_timeout=2500-60000" \ |
| 10922 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10923 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10924 | 0 \ |
| 10925 | -c "Buffering HS message" \ |
| 10926 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10927 | -C "attempt to make space by freeing buffered messages" \ |
| 10928 | -S "Buffering HS message" \ |
| 10929 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10930 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10931 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10932 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10933 | -S "Remember CCS message" |
| 10934 | |
| 10935 | # The size constraints ensure that the delayed certificate message can't |
| 10936 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 10937 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10938 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10939 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 10940 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10941 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10942 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 10943 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10944 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10945 | hs_timeout=2500-60000" \ |
| 10946 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10947 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10948 | 0 \ |
| 10949 | -c "Buffering HS message" \ |
| 10950 | -c "attempt to make space by freeing buffered future messages" \ |
| 10951 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10952 | -S "Buffering HS message" \ |
| 10953 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10954 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10955 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10956 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10957 | -S "Remember CCS message" |
| 10958 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10959 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10960 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10961 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 10962 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10963 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 10964 | hs_timeout=2500-60000" \ |
| 10965 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10966 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10967 | 0 \ |
| 10968 | -C "Buffering HS message" \ |
| 10969 | -C "Next handshake message has been buffered - load"\ |
| 10970 | -s "Buffering HS message" \ |
| 10971 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10972 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10973 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10974 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10975 | -S "Remember CCS message" |
| 10976 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10977 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10978 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10979 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 10980 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10981 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10982 | hs_timeout=2500-60000" \ |
| 10983 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10984 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10985 | 0 \ |
| 10986 | -C "Buffering HS message" \ |
| 10987 | -C "Next handshake message has been buffered - load"\ |
| 10988 | -S "Buffering HS message" \ |
| 10989 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10990 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10991 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10992 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10993 | -S "Remember CCS message" |
| 10994 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10995 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10996 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10997 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 10998 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10999 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11000 | hs_timeout=2500-60000" \ |
| 11001 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11002 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11003 | 0 \ |
| 11004 | -C "Buffering HS message" \ |
| 11005 | -C "Next handshake message has been buffered - load"\ |
| 11006 | -S "Buffering HS message" \ |
| 11007 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11008 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11009 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11010 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11011 | -s "Remember CCS message" |
| 11012 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11013 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11014 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11015 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11016 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11017 | hs_timeout=2500-60000" \ |
| 11018 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11019 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 11020 | 0 \ |
| 11021 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 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" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11025 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11026 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 11027 | # from the server are delayed, so that the encrypted Finished message |
| 11028 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 11029 | # in afterwards, the encrypted Finished message must be freed in order |
| 11030 | # to make space for the NewSessionTicket to be reassembled. |
| 11031 | # This works only in very particular circumstances: |
| 11032 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 11033 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 11034 | # the encrypted Finished message. |
| 11035 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 11036 | # needs to be fragmented. |
| 11037 | # - All messages sent by the server must be small enough to be either sent |
| 11038 | # without fragmentation or be reassembled within the bounds of |
| 11039 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 11040 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 11041 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 11042 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11043 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 11044 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 11045 | "$P_SRV mtu=140 response_size=90 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 11046 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 11047 | 0 \ |
| 11048 | -s "Buffer record from epoch 1" \ |
| 11049 | -s "Found buffered record from current epoch - load" \ |
| 11050 | -c "Buffer record from epoch 1" \ |
| 11051 | -C "Found buffered record from current epoch - load" \ |
| 11052 | -c "Enough space available after freeing future epoch record" |
| 11053 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 11054 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 11055 | |
| 11056 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11057 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 11058 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11059 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11060 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11061 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11062 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11063 | 0 \ |
| 11064 | -s "Extra-header:" \ |
| 11065 | -c "HTTP/1.0 200 OK" |
| 11066 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11067 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11068 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 11069 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11070 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 11071 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11072 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 11073 | 0 \ |
| 11074 | -s "Extra-header:" \ |
| 11075 | -c "HTTP/1.0 200 OK" |
| 11076 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11077 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11078 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11079 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 11080 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11081 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 11082 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11083 | 0 \ |
| 11084 | -s "Extra-header:" \ |
| 11085 | -c "HTTP/1.0 200 OK" |
| 11086 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11087 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11088 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11089 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 11090 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11091 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 11092 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11093 | 0 \ |
| 11094 | -s "Extra-header:" \ |
| 11095 | -c "HTTP/1.0 200 OK" |
| 11096 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11097 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11098 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11099 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 11100 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11101 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 11102 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11103 | 0 \ |
| 11104 | -s "Extra-header:" \ |
| 11105 | -c "HTTP/1.0 200 OK" |
| 11106 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11107 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11108 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 11109 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 11110 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11111 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 11112 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11113 | 0 \ |
| 11114 | -s "Extra-header:" \ |
| 11115 | -c "HTTP/1.0 200 OK" |
| 11116 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11117 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11118 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11119 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 11120 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11121 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 nbio=2 tickets=1 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 11122 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11123 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 nbio=2 tickets=1" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11124 | 0 \ |
| 11125 | -s "Extra-header:" \ |
| 11126 | -c "HTTP/1.0 200 OK" |
| 11127 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11128 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 11129 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 11130 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 11131 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11132 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 11133 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11134 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 11135 | debug_level=3 reconnect=1 skip_close_notify=1 read_timeout=1000 max_resend=10 \ |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 11136 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11137 | 0 \ |
| 11138 | -s "a session has been resumed" \ |
| 11139 | -c "a session has been resumed" \ |
| 11140 | -s "Extra-header:" \ |
| 11141 | -c "HTTP/1.0 200 OK" |
| 11142 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11143 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 11144 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 11145 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 11146 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11147 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 11148 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11149 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 11150 | debug_level=3 reconnect=1 skip_close_notify=1 read_timeout=1000 max_resend=10 \ |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 11151 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 11152 | 0 \ |
| 11153 | -s "a session has been resumed" \ |
| 11154 | -c "a session has been resumed" \ |
| 11155 | -s "Extra-header:" \ |
| 11156 | -c "HTTP/1.0 200 OK" |
| 11157 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11158 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11159 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11160 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11161 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11162 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 11163 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11164 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 11165 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 11166 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11167 | 0 \ |
| 11168 | -c "=> renegotiate" \ |
| 11169 | -s "=> renegotiate" \ |
| 11170 | -s "Extra-header:" \ |
| 11171 | -c "HTTP/1.0 200 OK" |
| 11172 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11173 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11174 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11175 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 11176 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11177 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 11178 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11179 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 11180 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11181 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11182 | 0 \ |
| 11183 | -c "=> renegotiate" \ |
| 11184 | -s "=> renegotiate" \ |
| 11185 | -s "Extra-header:" \ |
| 11186 | -c "HTTP/1.0 200 OK" |
| 11187 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11188 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11189 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11190 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11191 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11192 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11193 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11194 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11195 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11196 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11197 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11198 | 0 \ |
| 11199 | -c "=> renegotiate" \ |
| 11200 | -s "=> renegotiate" \ |
| 11201 | -s "Extra-header:" \ |
| 11202 | -c "HTTP/1.0 200 OK" |
| 11203 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11204 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 11205 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11206 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego, nbio" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11207 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11208 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11209 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11210 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11211 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 11212 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 11213 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 11214 | 0 \ |
| 11215 | -c "=> renegotiate" \ |
| 11216 | -s "=> renegotiate" \ |
| 11217 | -s "Extra-header:" \ |
| 11218 | -c "HTTP/1.0 200 OK" |
| 11219 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11220 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 11221 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 11222 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 11223 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11224 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11225 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11226 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11227 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11228 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 11229 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
| 11230 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11231 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 11232 | -c "HTTP/1.0 200 OK" |
| 11233 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11234 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11235 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11236 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11237 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11238 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 11239 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11240 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11241 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11242 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11243 | -c "HTTP/1.0 200 OK" |
| 11244 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11245 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11246 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11247 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11248 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11249 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 11250 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11251 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11252 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 nbio=2 tickets=0" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11253 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11254 | -c "HTTP/1.0 200 OK" |
| 11255 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 11256 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11257 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11258 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11259 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11260 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 11261 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 11262 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11263 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11264 | 0 \ |
| 11265 | -s "Extra-header:" \ |
| 11266 | -c "Extra-header:" |
| 11267 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11268 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11269 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11270 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11271 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11272 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 11273 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11274 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11275 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 11276 | 0 \ |
| 11277 | -s "Extra-header:" \ |
| 11278 | -c "Extra-header:" |
| 11279 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11280 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 11281 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 11282 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11283 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11284 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 11285 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11286 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11287 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 nbio=2" \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 11288 | 0 \ |
| 11289 | -s "Extra-header:" \ |
| 11290 | -c "Extra-header:" |
| 11291 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11292 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11293 | run_test "export keys functionality" \ |
| 11294 | "$P_SRV eap_tls=1 debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 11295 | "$P_CLI force_version=tls12 eap_tls=1 debug_level=3" \ |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11296 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 11297 | -c "EAP-TLS key material is:"\ |
| 11298 | -s "EAP-TLS key material is:"\ |
| 11299 | -c "EAP-TLS IV is:" \ |
| 11300 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 11301 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11302 | # openssl feature tests: check if tls1.3 exists. |
| 11303 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11304 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11305 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 11306 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 11307 | 0 \ |
| 11308 | -c "TLS 1.3" \ |
| 11309 | -s "TLS 1.3" |
| 11310 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 11311 | # gnutls feature tests: check if TLS 1.3 is supported as well as the NO_TICKETS and DISABLE_TLS13_COMPAT_MODE options. |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11312 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 11313 | requires_gnutls_next_no_ticket |
| 11314 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11315 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11316 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert " \ |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 11317 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 11318 | 0 \ |
| 11319 | -s "Version: TLS1.3" \ |
| 11320 | -c "Version: TLS1.3" |
| 11321 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 11322 | # TLS1.3 test cases |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 11323 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 11324 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11325 | requires_ciphersuite_enabled TLS1-3-CHACHA20-POLY1305-SHA256 |
Valerio Setti | cf29c5d | 2023-09-01 09:03:41 +0200 | [diff] [blame] | 11326 | requires_any_configs_enabled "PSA_WANT_ECC_MONTGOMERY_255" |
| 11327 | requires_any_configs_enabled "PSA_WANT_ECC_SECP_R1_256" |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 11328 | run_test "TLS 1.3: Default" \ |
| 11329 | "$P_SRV allow_sha1=0 debug_level=3 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13" \ |
| 11330 | "$P_CLI allow_sha1=0" \ |
| 11331 | 0 \ |
| 11332 | -s "Protocol is TLSv1.3" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11333 | -s "Ciphersuite is TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 11334 | -s "ECDH/FFDH group: " \ |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 11335 | -s "selected signature algorithm ecdsa_secp256r1_sha256" |
| 11336 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 11337 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11338 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11339 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11340 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11341 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11342 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11343 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11344 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11345 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11346 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11347 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11348 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11349 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11350 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11351 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11352 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11353 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11354 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11355 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11356 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11357 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 11358 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11359 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11360 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11361 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11362 | -c "=> parse certificate verify" \ |
| 11363 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11364 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11365 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 11366 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11367 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 11368 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 11369 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 11370 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11371 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11372 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11373 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11374 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 11375 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 11376 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11377 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 11378 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11379 | -s "SERVER HELLO was queued" \ |
| 11380 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11381 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11382 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11383 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11384 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11385 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11386 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11387 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11388 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11389 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11390 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11391 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 11392 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 11393 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11394 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 11395 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11396 | -c "=> parse certificate verify" \ |
| 11397 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11398 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11399 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 11400 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 11401 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 11402 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 11403 | requires_openssl_tls1_3_with_compatible_ephemeral |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11404 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11405 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11406 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11407 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11408 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11409 | run_test "TLS 1.3: alpn - openssl" \ |
| 11410 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -alpn h2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11411 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11412 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11413 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11414 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11415 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11416 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11417 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11418 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11419 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11420 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11421 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11422 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11423 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11424 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 11425 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11426 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11427 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11428 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11429 | -c "=> parse certificate verify" \ |
| 11430 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11431 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11432 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11433 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11434 | -c "HTTP/1.0 200 ok" \ |
| 11435 | -c "Application Layer Protocol is h2" |
| 11436 | |
| 11437 | requires_gnutls_tls1_3 |
| 11438 | requires_gnutls_next_no_ticket |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11439 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11440 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11441 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11442 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11443 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11444 | run_test "TLS 1.3: alpn - gnutls" \ |
| 11445 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert --alpn=h2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11446 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11447 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11448 | -s "SERVER HELLO was queued" \ |
| 11449 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 11450 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 11451 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 11452 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 11453 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 11454 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 11455 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 11456 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 11457 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 11458 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11459 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 11460 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 11461 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11462 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11463 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11464 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 11465 | -c "=> parse certificate verify" \ |
| 11466 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11467 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 11468 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11469 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 11470 | -c "HTTP/1.0 200 OK" \ |
| 11471 | -c "Application Layer Protocol is h2" |
| 11472 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 11473 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11474 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11475 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11476 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11477 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11478 | run_test "TLS 1.3: server alpn - openssl" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 11479 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key alpn=h2" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11480 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 11481 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11482 | -s "found alpn extension" \ |
| 11483 | -s "server side, adding alpn extension" \ |
| 11484 | -s "Protocol is TLSv1.3" \ |
| 11485 | -s "HTTP/1.0 200 OK" \ |
| 11486 | -s "Application Layer Protocol is h2" |
| 11487 | |
| 11488 | requires_gnutls_tls1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11489 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 11490 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11491 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11492 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11493 | run_test "TLS 1.3: server alpn - gnutls" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 11494 | "$P_SRV debug_level=3 tickets=0 crt_file=data_files/server5.crt key_file=data_files/server5.key alpn=h2" \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 11495 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 11496 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 11497 | -s "found alpn extension" \ |
| 11498 | -s "server side, adding alpn extension" \ |
| 11499 | -s "Protocol is TLSv1.3" \ |
| 11500 | -s "HTTP/1.0 200 OK" \ |
| 11501 | -s "Application Layer Protocol is h2" |
| 11502 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11503 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11504 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11505 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11506 | skip_handshake_stage_check |
| 11507 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11508 | run_test "TLS 1.3: Not supported version check:gnutls: srv max TLS 1.0" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11509 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11510 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11511 | 1 \ |
| 11512 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11513 | -S "Version: TLS1.0" \ |
| 11514 | -C "Protocol is TLSv1.0" |
| 11515 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11516 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11517 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11518 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11519 | skip_handshake_stage_check |
| 11520 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11521 | run_test "TLS 1.3: Not supported version check:gnutls: srv max TLS 1.1" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11522 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11523 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11524 | 1 \ |
| 11525 | -s "Client's version: 3.3" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11526 | -S "Version: TLS1.1" \ |
| 11527 | -C "Protocol is TLSv1.1" |
| 11528 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11529 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11530 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11531 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11532 | skip_handshake_stage_check |
| 11533 | requires_gnutls_tls1_3 |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11534 | run_test "TLS 1.3: Not supported version check:gnutls: srv max TLS 1.2" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11535 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11536 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11537 | 1 \ |
| 11538 | -s "Client's version: 3.3" \ |
| 11539 | -c "is a fatal alert message (msg 40)" \ |
| 11540 | -S "Version: TLS1.2" \ |
| 11541 | -C "Protocol is TLSv1.2" |
| 11542 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11543 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11544 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11545 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11546 | skip_handshake_stage_check |
| 11547 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11548 | run_test "TLS 1.3: Not supported version check:openssl: srv max TLS 1.0" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11549 | "$O_NEXT_SRV -msg -tls1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11550 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11551 | 1 \ |
| 11552 | -s "fatal protocol_version" \ |
| 11553 | -c "is a fatal alert message (msg 70)" \ |
| 11554 | -S "Version: TLS1.0" \ |
| 11555 | -C "Protocol : TLSv1.0" |
| 11556 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11558 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11559 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11560 | skip_handshake_stage_check |
| 11561 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11562 | run_test "TLS 1.3: Not supported version check:openssl: srv max TLS 1.1" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11563 | "$O_NEXT_SRV -msg -tls1_1" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11564 | "$P_CLI debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11565 | 1 \ |
| 11566 | -s "fatal protocol_version" \ |
| 11567 | -c "is a fatal alert message (msg 70)" \ |
| 11568 | -S "Version: TLS1.1" \ |
| 11569 | -C "Protocol : TLSv1.1" |
| 11570 | |
Ronald Cron | 6f135e1 | 2021-12-08 16:57:54 +0100 | [diff] [blame] | 11571 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 11572 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11573 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11574 | skip_handshake_stage_check |
| 11575 | requires_openssl_next |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 11576 | run_test "TLS 1.3: Not supported version check:openssl: srv max TLS 1.2" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11577 | "$O_NEXT_SRV -msg -tls1_2" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11578 | "$P_CLI force_version=tls13 debug_level=4" \ |
Jerry Yu | 8f9d7db | 2021-11-22 17:28:01 +0800 | [diff] [blame] | 11579 | 1 \ |
| 11580 | -s "fatal protocol_version" \ |
| 11581 | -c "is a fatal alert message (msg 70)" \ |
| 11582 | -S "Version: TLS1.2" \ |
| 11583 | -C "Protocol : TLSv1.2" |
| 11584 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 11585 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11586 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11587 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11588 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11589 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11590 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11591 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -verify 10" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11592 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11593 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11594 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11595 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11596 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11597 | -c "HTTP/1.0 200 ok" \ |
| 11598 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11599 | |
| 11600 | requires_gnutls_tls1_3 |
| 11601 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11602 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11603 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11604 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11605 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11606 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11607 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --verify-client-cert" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11608 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11609 | 0 \ |
| 11610 | -c "got a certificate request" \ |
| 11611 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 11612 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11613 | -c "HTTP/1.0 200 OK" \ |
| 11614 | -c "Protocol is TLSv1.3" |
| 11615 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 11616 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 11617 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11618 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11619 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11620 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11621 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11622 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11623 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 11624 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11625 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11626 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11627 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11628 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11629 | |
| 11630 | requires_gnutls_tls1_3 |
| 11631 | requires_gnutls_next_no_ticket |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11632 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11633 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11634 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11635 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11636 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11637 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
Jerry Yu | 25e0ddc | 2022-01-29 10:33:13 +0800 | [diff] [blame] | 11638 | key_file=data_files/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 11639 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11640 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11641 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11642 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11643 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11644 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 11645 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 11646 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11647 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11648 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11649 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11650 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11651 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11652 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11653 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11654 | 0 \ |
| 11655 | -c "got a certificate request" \ |
| 11656 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11657 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11658 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11659 | |
| 11660 | requires_gnutls_tls1_3 |
| 11661 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11662 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11663 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11664 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11665 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11666 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11667 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11668 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11669 | key_file=data_files/ecdsa_secp256r1.key" \ |
| 11670 | 0 \ |
| 11671 | -c "got a certificate request" \ |
| 11672 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11673 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11674 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11675 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 11676 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11677 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11678 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11679 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11680 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11681 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11682 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11683 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11684 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11685 | 0 \ |
| 11686 | -c "got a certificate request" \ |
| 11687 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11688 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11689 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11690 | |
| 11691 | requires_gnutls_tls1_3 |
| 11692 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11693 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11694 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11695 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11696 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11697 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11698 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11699 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11700 | key_file=data_files/ecdsa_secp384r1.key" \ |
| 11701 | 0 \ |
| 11702 | -c "got a certificate request" \ |
| 11703 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11704 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11705 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11706 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 11707 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11708 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11709 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11710 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11711 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11712 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11713 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11714 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11715 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11716 | 0 \ |
| 11717 | -c "got a certificate request" \ |
| 11718 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11719 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11720 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11721 | |
| 11722 | requires_gnutls_tls1_3 |
| 11723 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11724 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11725 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11726 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11727 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11728 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11729 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11730 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11731 | key_file=data_files/ecdsa_secp521r1.key" \ |
| 11732 | 0 \ |
| 11733 | -c "got a certificate request" \ |
| 11734 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11735 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11736 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11737 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 11738 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11739 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11740 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11741 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11742 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11743 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11744 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11745 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11746 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11747 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11748 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11749 | -c "got a certificate request" \ |
| 11750 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11751 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11752 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11753 | |
| 11754 | requires_gnutls_tls1_3 |
| 11755 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11756 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11757 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11758 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11759 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11760 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11761 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11762 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11763 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11764 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11765 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 11766 | -c "got a certificate request" \ |
| 11767 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 11768 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 11769 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 11770 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 11771 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11772 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11773 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11774 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11775 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11776 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11777 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 11778 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11779 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11780 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11781 | 0 \ |
| 11782 | -c "got a certificate request" \ |
| 11783 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11784 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11785 | -c "Protocol is TLSv1.3" |
| 11786 | |
| 11787 | requires_gnutls_tls1_3 |
| 11788 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11789 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11790 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11791 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11792 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11793 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11794 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 11795 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11796 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11797 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
| 11798 | 0 \ |
| 11799 | -c "got a certificate request" \ |
| 11800 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11801 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11802 | -c "Protocol is TLSv1.3" |
| 11803 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 11804 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11805 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11806 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11807 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11808 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11809 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11810 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 11811 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11812 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11813 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11814 | 0 \ |
| 11815 | -c "got a certificate request" \ |
| 11816 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11817 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11818 | -c "Protocol is TLSv1.3" |
| 11819 | |
| 11820 | requires_gnutls_tls1_3 |
| 11821 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11822 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11823 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11824 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11825 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11826 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11827 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 11828 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 11829 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11830 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
| 11831 | 0 \ |
| 11832 | -c "got a certificate request" \ |
| 11833 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11834 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11835 | -c "Protocol is TLSv1.3" |
| 11836 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 11837 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 11838 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11839 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11840 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11841 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11842 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 11843 | run_test "TLS 1.3: Client authentication, client alg not in server list - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11844 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11845 | -sigalgs ecdsa_secp256r1_sha256" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11846 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11847 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512" \ |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11848 | 1 \ |
| 11849 | -c "got a certificate request" \ |
| 11850 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11851 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 11852 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11853 | |
| 11854 | requires_gnutls_tls1_3 |
| 11855 | requires_gnutls_next_no_ticket |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11856 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11857 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11858 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11859 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11860 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 11861 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 11862 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 11863 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
Jerry Yu | 2ff6ba1 | 2022-02-23 10:38:25 +0800 | [diff] [blame] | 11864 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512" \ |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11865 | 1 \ |
| 11866 | -c "got a certificate request" \ |
| 11867 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11868 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 11869 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 11870 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11871 | # Test using an opaque private key for client authentication |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 11872 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11873 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11874 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11875 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11876 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11877 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 11878 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
| 11879 | "$P_CLI debug_level=4 crt_file=data_files/cli2.crt key_file=data_files/cli2.key key_opaque=1" \ |
| 11880 | 0 \ |
| 11881 | -c "got a certificate request" \ |
| 11882 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11883 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11884 | -c "Protocol is TLSv1.3" |
| 11885 | |
| 11886 | requires_gnutls_tls1_3 |
| 11887 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11888 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11889 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 11890 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 11891 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11892 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 11893 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
| 11894 | "$P_CLI debug_level=3 crt_file=data_files/cli2.crt \ |
| 11895 | key_file=data_files/cli2.key key_opaque=1" \ |
| 11896 | 0 \ |
| 11897 | -c "got a certificate request" \ |
| 11898 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11899 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11900 | -c "Protocol is TLSv1.3" |
| 11901 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 11902 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11903 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11904 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11905 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11906 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11907 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11908 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 11909 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11910 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 11911 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 11912 | 0 \ |
| 11913 | -c "got a certificate request" \ |
| 11914 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11915 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11916 | -c "Protocol is TLSv1.3" |
| 11917 | |
| 11918 | requires_gnutls_tls1_3 |
| 11919 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11920 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11921 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11922 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11923 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11924 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11925 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 11926 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11927 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp256r1.crt \ |
| 11928 | key_file=data_files/ecdsa_secp256r1.key key_opaque=1" \ |
| 11929 | 0 \ |
| 11930 | -c "got a certificate request" \ |
| 11931 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11932 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11933 | -c "Protocol is TLSv1.3" |
| 11934 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 11935 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11936 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11937 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11938 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11939 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11940 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11941 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 11942 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11943 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 11944 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 11945 | 0 \ |
| 11946 | -c "got a certificate request" \ |
| 11947 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11948 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11949 | -c "Protocol is TLSv1.3" |
| 11950 | |
| 11951 | requires_gnutls_tls1_3 |
| 11952 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11953 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11954 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11955 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11956 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11957 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11958 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 11959 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11960 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp384r1.crt \ |
| 11961 | key_file=data_files/ecdsa_secp384r1.key key_opaque=1" \ |
| 11962 | 0 \ |
| 11963 | -c "got a certificate request" \ |
| 11964 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11965 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11966 | -c "Protocol is TLSv1.3" |
| 11967 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 11968 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11969 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11970 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11971 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11972 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11973 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11974 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 11975 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 11976 | "$P_CLI debug_level=4 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11977 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11978 | 0 \ |
| 11979 | -c "got a certificate request" \ |
| 11980 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11981 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11982 | -c "Protocol is TLSv1.3" |
| 11983 | |
| 11984 | requires_gnutls_tls1_3 |
| 11985 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11986 | requires_config_enabled MBEDTLS_DEBUG_C |
| 11987 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11988 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 11989 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 11990 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 11991 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 11992 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 11993 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 11994 | key_file=data_files/ecdsa_secp521r1.key key_opaque=1" \ |
| 11995 | 0 \ |
| 11996 | -c "got a certificate request" \ |
| 11997 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 11998 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 11999 | -c "Protocol is TLSv1.3" |
| 12000 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12001 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12002 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12003 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12004 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12005 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12006 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12007 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12008 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 12009 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
| 12010 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
| 12011 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 12012 | 0 \ |
| 12013 | -c "got a certificate request" \ |
| 12014 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12015 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12016 | -c "Protocol is TLSv1.3" |
| 12017 | |
| 12018 | requires_gnutls_tls1_3 |
| 12019 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12020 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12021 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12022 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12023 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12024 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12025 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12026 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 12027 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
| 12028 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
| 12029 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
| 12030 | 0 \ |
| 12031 | -c "got a certificate request" \ |
| 12032 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12033 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12034 | -c "Protocol is TLSv1.3" |
| 12035 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12036 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12037 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12038 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12039 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12040 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12041 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12042 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12043 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 12044 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12045 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12046 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 12047 | 0 \ |
| 12048 | -c "got a certificate request" \ |
| 12049 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12050 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12051 | -c "Protocol is TLSv1.3" |
| 12052 | |
| 12053 | requires_gnutls_tls1_3 |
| 12054 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12055 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12056 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12057 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12058 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12059 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12060 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12061 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 12062 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12063 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12064 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
| 12065 | 0 \ |
| 12066 | -c "got a certificate request" \ |
| 12067 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12068 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12069 | -c "Protocol is TLSv1.3" |
| 12070 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12071 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12072 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12073 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12074 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12075 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12076 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12077 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12078 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 12079 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12080 | "$P_CLI debug_level=4 crt_file=data_files/cert_sha256.crt \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12081 | key_file=data_files/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 12082 | 0 \ |
| 12083 | -c "got a certificate request" \ |
| 12084 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12085 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12086 | -c "Protocol is TLSv1.3" |
| 12087 | |
| 12088 | requires_gnutls_tls1_3 |
| 12089 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12090 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12091 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12092 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12093 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12094 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12095 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12096 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 12097 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12098 | "$P_CLI debug_level=3 crt_file=data_files/server2-sha256.crt \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12099 | key_file=data_files/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
| 12100 | 0 \ |
| 12101 | -c "got a certificate request" \ |
| 12102 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12103 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12104 | -c "Protocol is TLSv1.3" |
| 12105 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12106 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12107 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12108 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12109 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12110 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12111 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12112 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12113 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 12114 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 12115 | -sigalgs ecdsa_secp256r1_sha256" \ |
| 12116 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 12117 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 12118 | 1 \ |
| 12119 | -c "got a certificate request" \ |
| 12120 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12121 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12122 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12123 | |
| 12124 | requires_gnutls_tls1_3 |
| 12125 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12126 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12127 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12128 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12129 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12130 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12131 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12132 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 12133 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
| 12134 | "$P_CLI debug_level=3 crt_file=data_files/ecdsa_secp521r1.crt \ |
| 12135 | key_file=data_files/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
| 12136 | 1 \ |
| 12137 | -c "got a certificate request" \ |
| 12138 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12139 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12140 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12141 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12142 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12143 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12144 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12145 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12146 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12147 | run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_128_GCM_SHA256 - openssl" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12148 | "$O_NEXT_SRV -ciphersuites TLS_AES_128_GCM_SHA256 -sigalgs ecdsa_secp256r1_sha256 -groups P-256 -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12149 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12150 | 0 \ |
| 12151 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12152 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12153 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12154 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12155 | -c "HTTP/1.0 200 ok" |
| 12156 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12157 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12158 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12159 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12160 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12161 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12162 | run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_256_GCM_SHA384 - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12163 | "$O_NEXT_SRV -ciphersuites TLS_AES_256_GCM_SHA384 -sigalgs ecdsa_secp256r1_sha256 -groups P-256 -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12164 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12165 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12166 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12167 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12168 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12169 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 12170 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12171 | |
| 12172 | requires_gnutls_tls1_3 |
| 12173 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12174 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12175 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 12176 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12177 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12178 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12179 | run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_128_GCM_SHA256 - gnutls" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12180 | "$G_NEXT_SRV -d 4 --priority=NONE:+GROUP-SECP256R1:+AES-128-GCM:+SHA256:+AEAD:+SIGN-ECDSA-SECP256R1-SHA256:+VERS-TLS1.3:%NO_TICKETS --disable-client-cert" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12181 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12182 | 0 \ |
| 12183 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12184 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12185 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12186 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12187 | -c "HTTP/1.0 200 OK" |
| 12188 | |
| 12189 | requires_gnutls_tls1_3 |
| 12190 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 12191 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12192 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 12193 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12194 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12195 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 12196 | run_test "TLS 1.3: HRR check, ciphersuite TLS_AES_256_GCM_SHA384 - gnutls" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12197 | "$G_NEXT_SRV -d 4 --priority=NONE:+GROUP-SECP256R1:+AES-256-GCM:+SHA384:+AEAD:+SIGN-ECDSA-SECP256R1-SHA256:+VERS-TLS1.3:%NO_TICKETS --disable-client-cert" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12198 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12199 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 12200 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 12201 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12202 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12203 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 12204 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12205 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12206 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12207 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12208 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12209 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12210 | run_test "TLS 1.3: Server side check - openssl" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12211 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12212 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 12213 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12214 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12215 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12216 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12217 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12218 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12219 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12220 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 12221 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12222 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12223 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12224 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12225 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12226 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12227 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12228 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Jerry Yu | 7eaadae | 2022-05-23 14:53:27 +0800 | [diff] [blame] | 12229 | "$O_NEXT_CLI -msg -debug -cert data_files/server5.crt -key data_files/server5.key -tls1_3 -no_middlebox" \ |
XiaokangQian | 9a4e1dd | 2022-05-26 00:58:11 +0000 | [diff] [blame] | 12230 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12231 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12232 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12233 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12234 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12235 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12236 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12237 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12238 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12239 | -s "=> parse client hello" \ |
| 12240 | -s "<= parse client hello" |
| 12241 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12242 | requires_gnutls_tls1_3 |
| 12243 | requires_gnutls_next_no_ticket |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12244 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 12245 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12246 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 12247 | run_test "TLS 1.3: Server side check - gnutls" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12248 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
XiaokangQian | 3f84d5d | 2022-04-19 06:36:17 +0000 | [diff] [blame] | 12249 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12250 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 12251 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12252 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12253 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12254 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 12255 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12256 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 12257 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12258 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12259 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 12260 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12261 | requires_gnutls_tls1_3 |
| 12262 | requires_gnutls_next_no_ticket |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12263 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12264 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12265 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12266 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12267 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12268 | "$G_NEXT_CLI localhost -d 4 --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12269 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12270 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12271 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12272 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12273 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12274 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 12275 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12276 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12277 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 12278 | -s "=> parse client hello" \ |
| 12279 | -s "<= parse client hello" |
| 12280 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12281 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12282 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 12283 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12284 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12285 | run_test "TLS 1.3: Server side check - mbedtls" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12286 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12287 | "$P_CLI debug_level=4" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12288 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12289 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12290 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12291 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12292 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 12293 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12294 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12295 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12296 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12297 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 12298 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 12299 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12300 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12301 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12302 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12303 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 12304 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12305 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12306 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 12307 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12308 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12309 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12310 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12311 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 12312 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12313 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 12314 | -s "=> parse client hello" \ |
| 12315 | -s "<= parse client hello" |
| 12316 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12317 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12318 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12319 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12320 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12321 | run_test "TLS 1.3: Server side check - mbedtls with client empty certificate" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12322 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12323 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12324 | 1 \ |
| 12325 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12326 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12327 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12328 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12329 | -s "=> write certificate request" \ |
| 12330 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 12331 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12332 | -s "=> parse client hello" \ |
| 12333 | -s "<= parse client hello" |
| 12334 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12335 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12336 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12337 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12338 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12339 | run_test "TLS 1.3: Server side check - mbedtls with optional client authentication" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12340 | "$P_SRV debug_level=4 auth_mode=optional crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12341 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 12342 | 0 \ |
| 12343 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12344 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12345 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12346 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12347 | -s "=> write certificate request" \ |
| 12348 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12349 | -s "=> parse client hello" \ |
| 12350 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12351 | |
| 12352 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12353 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12354 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12355 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 12356 | requires_config_enabled PSA_WANT_ALG_ECDH |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12357 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 12358 | "$P_SRV debug_level=4 groups=secp384r1" \ |
| 12359 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 12360 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12361 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 12362 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12363 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12364 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 12365 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12366 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 12367 | -s "=> write hello retry request" \ |
| 12368 | -s "<= write hello retry request" |
| 12369 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12370 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12371 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12372 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12373 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12374 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12375 | "$P_SRV debug_level=4 crt_file=none key_file=none" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12376 | "$P_CLI debug_level=4" \ |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 12377 | 1 \ |
| 12378 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12379 | -s "No certificate available." |
| 12380 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12381 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12382 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12383 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12384 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12385 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12386 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12387 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0 \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 12388 | sni=localhost,data_files/server5.crt,data_files/server5.key,data_files/test-ca_cat12.crt,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12389 | "$O_NEXT_CLI -msg -debug -servername localhost -CAfile data_files/test-ca_cat12.crt -cert data_files/server5.crt -key data_files/server5.key -tls1_3" \ |
| 12390 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12391 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12392 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12393 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 12394 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12395 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12396 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12397 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12398 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12399 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12400 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0 \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 12401 | sni=localhost,data_files/server5.crt,data_files/server5.key,data_files/test-ca_cat12.crt,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12402 | "$G_NEXT_CLI localhost -d 4 --sni-hostname=localhost --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS -V" \ |
| 12403 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12404 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12405 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12406 | |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12407 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12408 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12409 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12410 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12411 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 12412 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12413 | "$P_SRV debug_level=4 auth_mode=required crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0 \ |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12414 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 12415 | "$P_CLI debug_level=4 server_name=localhost crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12416 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 12417 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 12418 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 12419 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 12420 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12421 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12422 | TEST_SUITE_NAME=${i##*/} |
| 12423 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 12424 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 12425 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 12426 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 12427 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12428 | # Test 1.3 compatibility mode |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12429 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12430 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12431 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12432 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12433 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12434 | run_test "TLS 1.3 m->m both peers do not support middlebox compatibility" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12435 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12436 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12437 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12438 | -s "Protocol is TLSv1.3" \ |
| 12439 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12440 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12441 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12442 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12443 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12444 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12445 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12446 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12447 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12448 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12449 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12450 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12451 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12452 | -s "Protocol is TLSv1.3" \ |
| 12453 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12454 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12455 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12456 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12457 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12458 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12459 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12460 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12461 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12462 | run_test "TLS 1.3 m->O both peers do not support middlebox compatibility" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12463 | "$O_NEXT_SRV -msg -tls1_3 -no_middlebox -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12464 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12465 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12466 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12467 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12468 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12469 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12470 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12471 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12472 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12473 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12474 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12475 | run_test "TLS 1.3 m->O server with middlebox compat support, not client" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12476 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12477 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12478 | 1 \ |
| 12479 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12480 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12481 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12482 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12483 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12484 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12485 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12486 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 12487 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12488 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12489 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12490 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12491 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12492 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12493 | requires_gnutls_tls1_3 |
| 12494 | requires_gnutls_next_no_ticket |
| 12495 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12496 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12497 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12498 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12499 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12500 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 12501 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12502 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12503 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12504 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12505 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12506 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12507 | |
| 12508 | requires_gnutls_tls1_3 |
| 12509 | requires_gnutls_next_no_ticket |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12510 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12511 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12512 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12513 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12514 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 12515 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12516 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 12517 | 1 \ |
| 12518 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12519 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12520 | requires_gnutls_tls1_3 |
| 12521 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12522 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12523 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12524 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12525 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12526 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 12527 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12528 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12529 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12530 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12531 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12532 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12533 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12534 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12535 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12536 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12537 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12538 | run_test "TLS 1.3 O->m both peers do not support middlebox compatibility" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12539 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12540 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12541 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12542 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12543 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12544 | -C "14 03 03 00 01" |
| 12545 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12546 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12547 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12548 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12549 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12550 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12551 | run_test "TLS 1.3 O->m server with middlebox compat support, not client" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12552 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12553 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12554 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12555 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12556 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 12557 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12558 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12559 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12560 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12561 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12562 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12563 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12564 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12565 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12566 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12567 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12568 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12569 | -c "14 03 03 00 01" |
| 12570 | |
| 12571 | requires_gnutls_tls1_3 |
| 12572 | requires_gnutls_next_no_ticket |
| 12573 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12574 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12575 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12576 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12577 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12578 | run_test "TLS 1.3 G->m both peers do not support middlebox compatibility" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12579 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12580 | "$G_NEXT_CLI localhost --priority=NORMAL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12581 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12582 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12583 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12584 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12585 | |
| 12586 | requires_gnutls_tls1_3 |
| 12587 | requires_gnutls_next_no_ticket |
| 12588 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12589 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12590 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12591 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12592 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12593 | run_test "TLS 1.3 G->m server with middlebox compat support, not client" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12594 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12595 | "$G_NEXT_CLI localhost --debug=10 --priority=NORMAL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12596 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12597 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12598 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12599 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12600 | -c "discarding change cipher spec in TLS1.3" |
| 12601 | |
| 12602 | requires_gnutls_tls1_3 |
| 12603 | requires_gnutls_next_no_ticket |
| 12604 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12605 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12606 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12607 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12608 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12609 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12610 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12611 | "$G_NEXT_CLI localhost --debug=10 --priority=NORMAL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12612 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12613 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12614 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 12615 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12616 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12617 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12618 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12619 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12620 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12621 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12622 | run_test "TLS 1.3 m->m HRR both peers do not support middlebox compatibility" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 12623 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 12624 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12625 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12626 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12627 | -c "Protocol is TLSv1.3" \ |
| 12628 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12629 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12630 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12631 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12632 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12633 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12634 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 12635 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12636 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12637 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12638 | run_test "TLS 1.3 m->m HRR both with middlebox compat support" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 12639 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 12640 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12641 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12642 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12643 | -c "Protocol is TLSv1.3" \ |
| 12644 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12645 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12646 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12647 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12648 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12649 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12650 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12651 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12652 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12653 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 12654 | "$O_NEXT_SRV -msg -tls1_3 -groups P-384 -no_middlebox -num_tickets 0 -no_cache" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 12655 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12656 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12657 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12658 | -c "received HelloRetryRequest message" \ |
| 12659 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12660 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12661 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12662 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12663 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12664 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12665 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12666 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12667 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 12668 | "$O_NEXT_SRV -msg -tls1_3 -groups P-384 -num_tickets 0 -no_cache" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 12669 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12670 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12671 | -c "received HelloRetryRequest message" \ |
| 12672 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12673 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12674 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12675 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12676 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12677 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12678 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12679 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 12680 | "$O_NEXT_SRV -msg -tls1_3 -groups P-384 -num_tickets 0 -no_resume_ephemeral -no_cache" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 12681 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12682 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12683 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12684 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12685 | |
| 12686 | requires_gnutls_tls1_3 |
| 12687 | requires_gnutls_next_no_ticket |
| 12688 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12689 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12690 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12691 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12692 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12693 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 12694 | "$G_NEXT_SRV --priority=NORMAL:-GROUP-ALL:+GROUP-SECP384R1:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE --disable-client-cert" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 12695 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12696 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12697 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12698 | -c "received HelloRetryRequest message" \ |
| 12699 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 12700 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12701 | |
| 12702 | requires_gnutls_tls1_3 |
| 12703 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12704 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12705 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12706 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12707 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12708 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 12709 | "$G_NEXT_SRV --priority=NORMAL:-GROUP-ALL:+GROUP-SECP384R1:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS --disable-client-cert" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 12710 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12711 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12712 | -c "received HelloRetryRequest message" \ |
| 12713 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 12714 | |
| 12715 | requires_gnutls_tls1_3 |
| 12716 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12717 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12718 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 12719 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12720 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12721 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12722 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 12723 | "$G_NEXT_SRV --priority=NORMAL:-GROUP-ALL:+GROUP-SECP384R1:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS --disable-client-cert" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 12724 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12725 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12726 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12727 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 12728 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12729 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12730 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12731 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12732 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12733 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12734 | run_test "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 12735 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12736 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12737 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12738 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12739 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12740 | -C "14 03 03 00 01" |
| 12741 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12742 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12743 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12744 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12745 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12746 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12747 | run_test "TLS 1.3 O->m HRR server with middlebox compat support, not client" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 12748 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12749 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12750 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12751 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12752 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12753 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12754 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12755 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12756 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12757 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12758 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12759 | run_test "TLS 1.3 O->m HRR both with middlebox compat support" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 12760 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12761 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12762 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12763 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12764 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12765 | -c "14 03 03 00 01" |
| 12766 | |
| 12767 | requires_gnutls_tls1_3 |
| 12768 | requires_gnutls_next_no_ticket |
| 12769 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12770 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 12771 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12772 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12773 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12774 | run_test "TLS 1.3 G->m HRR both peers do not support middlebox compatibility" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 12775 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12776 | "$G_NEXT_CLI localhost --priority=NORMAL:-GROUP-ALL:+GROUP-SECP256R1:+GROUP-SECP384R1:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12777 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12778 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12779 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12780 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 12781 | |
| 12782 | requires_gnutls_tls1_3 |
| 12783 | requires_gnutls_next_no_ticket |
| 12784 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12785 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12786 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 12787 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12788 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12789 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12790 | run_test "TLS 1.3 G->m HRR server with middlebox compat support, not client" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 12791 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12792 | "$G_NEXT_CLI localhost --debug=10 --priority=NORMAL:-GROUP-ALL:+GROUP-SECP256R1:+GROUP-SECP384R1:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12793 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12794 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12795 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12796 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 12797 | -c "discarding change cipher spec in TLS1.3" |
| 12798 | |
| 12799 | requires_gnutls_tls1_3 |
| 12800 | requires_gnutls_next_no_ticket |
| 12801 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12802 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12803 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 12804 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12805 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12806 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12807 | run_test "TLS 1.3 G->m HRR both with middlebox compat support" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 12808 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12809 | "$G_NEXT_CLI localhost --debug=10 --priority=NORMAL:-GROUP-ALL:+GROUP-SECP256R1:+GROUP-SECP384R1:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12810 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 12811 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 12812 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 12813 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 12814 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12815 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12816 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12817 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12818 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12819 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12820 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
| 12821 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12822 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 12823 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 12824 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12825 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12826 | 0 \ |
| 12827 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12828 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12829 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12830 | |
| 12831 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12832 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12833 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12834 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12835 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12836 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
| 12837 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 12838 | -d 4 |
| 12839 | --priority=NORMAL:-VERS-ALL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS " \ |
| 12840 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12841 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12842 | 0 \ |
| 12843 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12844 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12845 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12846 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12847 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12848 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12849 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12850 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12851 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12852 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12853 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12854 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12855 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12856 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12857 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12858 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12859 | 0 \ |
| 12860 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12861 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 12862 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12863 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 12864 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 12865 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12866 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12867 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12868 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12869 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12870 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12871 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12872 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12873 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12874 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12875 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12876 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12877 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 12878 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 12879 | 0 \ |
| 12880 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12881 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12882 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 12883 | |
| 12884 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12885 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12886 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12887 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12888 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12889 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12890 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12891 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12892 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12893 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12894 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12895 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 12896 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 12897 | 0 \ |
| 12898 | -c "Negotiated version: 3.4" \ |
| 12899 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 12900 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12901 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 12902 | |
| 12903 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12904 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12905 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12906 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12907 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12908 | run_test "TLS 1.3: Check server no suitable signature algorithm, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12909 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12910 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12911 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12912 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 12913 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12914 | --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key \ |
| 12915 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 12916 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12917 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12918 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12919 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12920 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12921 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12922 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12923 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12924 | run_test "TLS 1.3: Check server no suitable signature algorithm, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12925 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12926 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12927 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12928 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
| 12929 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12930 | -cert data_files/server2-sha256.crt -key data_files/server2.key \ |
| 12931 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 12932 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12933 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12934 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12935 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12936 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12937 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12938 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12939 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12940 | run_test "TLS 1.3: Check server no suitable signature algorithm, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12941 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12942 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 12943 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 12944 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
| 12945 | "$P_CLI allow_sha1=0 debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12946 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12947 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 12948 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12949 | |
| 12950 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12951 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12952 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12953 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12954 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12955 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12956 | "$P_SRV debug_level=4 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12957 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12958 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12959 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile data_files/test-ca_cat12.crt \ |
| 12960 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 12961 | 1 \ |
| 12962 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12963 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12964 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12965 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12966 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12967 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12968 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12969 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12970 | "$P_SRV debug_level=4 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12971 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12972 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12973 | "$O_NEXT_CLI_NO_CERT -msg -CAfile data_files/test-ca_cat12.crt \ |
| 12974 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 12975 | 1 \ |
| 12976 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12977 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12978 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12979 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 12980 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12981 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12982 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12983 | run_test "TLS 1.3: Check server no suitable certificate, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 12984 | "$P_SRV debug_level=4 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12985 | crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 12986 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 12987 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 12988 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12989 | 1 \ |
| 12990 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 12991 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12992 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12993 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12994 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12995 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12996 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 12997 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
| 12998 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 12999 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 13000 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp521r1_sha512" \ |
| 13001 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13002 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13003 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13004 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13005 | |
| 13006 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13007 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13008 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13009 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13010 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13011 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
| 13012 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 13013 | -d 4 |
| 13014 | --priority=NORMAL:-VERS-ALL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS " \ |
| 13015 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13016 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13017 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13018 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13019 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13020 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13021 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13022 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13023 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13024 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13025 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13026 | "$P_SRV debug_level=4 auth_mode=required |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13027 | crt_file2=data_files/server2-sha256.crt key_file2=data_files/server2.key |
| 13028 | crt_file=data_files/server5.crt key_file=data_files/server5.key |
| 13029 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp521r1_sha512" \ |
| 13030 | "$P_CLI debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13031 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13032 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13033 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13034 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13035 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13036 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13037 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13038 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13039 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13040 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13041 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->O" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13042 | "$O_NEXT_SRV -msg -tls1_3 -no_resume_ephemeral -no_cache --num_tickets 4" \ |
| 13043 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13044 | 0 \ |
| 13045 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13046 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 13047 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13048 | -c "Reconnecting with saved session" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13049 | -c "HTTP/1.0 200 ok" |
| 13050 | |
| 13051 | requires_gnutls_tls1_3 |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13052 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13053 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13054 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13055 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13056 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13057 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->G" \ |
Ronald Cron | a709a0f | 2022-09-27 16:46:11 +0200 | [diff] [blame] | 13058 | "$G_NEXT_SRV -d 10 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 --disable-client-cert" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13059 | "$P_CLI debug_level=1 reco_mode=1 reconnect=1" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13060 | 0 \ |
| 13061 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 29ab32d | 2022-07-07 11:33:35 +0000 | [diff] [blame] | 13062 | -c "got new session ticket." \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 13063 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13064 | -c "Reconnecting with saved session" \ |
| 13065 | -c "HTTP/1.0 200 OK" \ |
| 13066 | -s "This is a resumed session" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13067 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13068 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13069 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13070 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13071 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13072 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13073 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13074 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13075 | # https://github.com/openssl/openssl/issues/10714 |
| 13076 | # Until now, OpenSSL client does not support reconnect. |
| 13077 | skip_next_test |
| 13078 | run_test "TLS 1.3: NewSessionTicket: Basic check, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13079 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=4" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13080 | "$O_NEXT_CLI -msg -debug -tls1_3 -reconnect" \ |
| 13081 | 0 \ |
| 13082 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13083 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13084 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13085 | |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13086 | requires_gnutls_tls1_3 |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13087 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13088 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13089 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13090 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13091 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13092 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13093 | run_test "TLS 1.3: NewSessionTicket: Basic check, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13094 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=4" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13095 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -r" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13096 | 0 \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13097 | -c "Connecting again- trying to resume previous session" \ |
| 13098 | -c "NEW SESSION TICKET (4) was received" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13099 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13100 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13101 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13102 | -s "key exchange mode: ephemeral" \ |
| 13103 | -s "key exchange mode: psk_ephemeral" \ |
| 13104 | -s "found pre_shared_key extension" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13105 | |
Ronald Cron | 0a1c504 | 2023-02-20 10:44:22 +0100 | [diff] [blame] | 13106 | requires_gnutls_tls1_3 |
| 13107 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13108 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13109 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13110 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13111 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13112 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Ronald Cron | d89360b | 2023-02-21 08:53:33 +0100 | [diff] [blame] | 13113 | # Test the session resumption when the cipher suite for the original session is |
| 13114 | # TLS1-3-AES-256-GCM-SHA384. In that case, the PSK is 384 bits long and not |
| 13115 | # 256 bits long as with all the other TLS 1.3 cipher suites. |
Ronald Cron | 0a1c504 | 2023-02-20 10:44:22 +0100 | [diff] [blame] | 13116 | requires_ciphersuite_enabled TLS1-3-AES-256-GCM-SHA384 |
| 13117 | run_test "TLS 1.3: NewSessionTicket: Basic check with AES-256-GCM only, G->m" \ |
| 13118 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key force_version=tls13 tickets=4" \ |
| 13119 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:-CIPHER-ALL:+AES-256-GCM -V -r" \ |
| 13120 | 0 \ |
| 13121 | -c "Connecting again- trying to resume previous session" \ |
| 13122 | -c "NEW SESSION TICKET (4) was received" \ |
| 13123 | -s "Ciphersuite is TLS1-3-AES-256-GCM-SHA384" \ |
| 13124 | -s "=> write NewSessionTicket msg" \ |
| 13125 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13126 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
| 13127 | -s "key exchange mode: ephemeral" \ |
| 13128 | -s "key exchange mode: psk_ephemeral" \ |
| 13129 | -s "found pre_shared_key extension" |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13130 | |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13131 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13132 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13133 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13134 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13135 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13136 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13137 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13138 | run_test "TLS 1.3: NewSessionTicket: Basic check, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13139 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=4" \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 13140 | "$P_CLI debug_level=4 reco_mode=1 reconnect=1" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13141 | 0 \ |
| 13142 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 7a51305 | 2022-08-09 13:34:21 +0800 | [diff] [blame] | 13143 | -c "got new session ticket ( 3 )" \ |
Jerry Yu | 24e3855 | 2022-07-15 16:35:26 +0800 | [diff] [blame] | 13144 | -c "Saving session for reuse... ok" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13145 | -c "Reconnecting with saved session" \ |
Jerry Yu | f7b5b59 | 2022-07-07 07:55:53 +0000 | [diff] [blame] | 13146 | -c "HTTP/1.0 200 OK" \ |
| 13147 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13148 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13149 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Jerry Yu | e976492 | 2022-08-03 14:34:24 +0800 | [diff] [blame] | 13150 | -s "key exchange mode: ephemeral" \ |
| 13151 | -s "key exchange mode: psk_ephemeral" \ |
| 13152 | -s "found pre_shared_key extension" |
| 13153 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13154 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13155 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13156 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13157 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13158 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->O" \ |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13159 | "$O_NEXT_SRV_NO_CERT -cert data_files/server2-sha256.crt -key data_files/server2.key |
| 13160 | -msg -tls1_2 |
| 13161 | -Verify 10 " \ |
| 13162 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13163 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13164 | min_version=tls12 max_version=tls13 " \ |
| 13165 | 0 \ |
| 13166 | -c "Protocol is TLSv1.2" \ |
| 13167 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13168 | |
| 13169 | |
| 13170 | requires_gnutls_tls1_3 |
| 13171 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 13172 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13173 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 13174 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->G" \ |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 13175 | "$G_NEXT_SRV_NO_CERT --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key |
| 13176 | -d 4 |
| 13177 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 13178 | "$P_CLI debug_level=4 crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key |
| 13179 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 13180 | min_version=tls12 max_version=tls13 " \ |
| 13181 | 0 \ |
| 13182 | -c "Protocol is TLSv1.2" \ |
| 13183 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13184 | |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13185 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13186 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13187 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13188 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13189 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13190 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13191 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13192 | run_test "TLS 1.3: NewSessionTicket: servername check, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13193 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=4 \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13194 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 13195 | "$P_CLI debug_level=4 server_name=localhost reco_mode=1 reconnect=1" \ |
| 13196 | 0 \ |
| 13197 | -c "Protocol is TLSv1.3" \ |
| 13198 | -c "got new session ticket." \ |
| 13199 | -c "Saving session for reuse... ok" \ |
| 13200 | -c "Reconnecting with saved session" \ |
| 13201 | -c "HTTP/1.0 200 OK" \ |
| 13202 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13203 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13204 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13205 | -s "key exchange mode: ephemeral" \ |
| 13206 | -s "key exchange mode: psk_ephemeral" \ |
| 13207 | -s "found pre_shared_key extension" |
| 13208 | |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13209 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
| 13210 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13211 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13212 | requires_config_enabled MBEDTLS_DEBUG_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13213 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13214 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 13215 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13216 | run_test "TLS 1.3: NewSessionTicket: servername negative check, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13217 | "$P_SRV debug_level=4 crt_file=data_files/server5.crt key_file=data_files/server5.key tickets=4 \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13218 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Jerry Yu | ad9e99b | 2022-10-28 12:18:52 +0800 | [diff] [blame] | 13219 | "$P_CLI debug_level=4 server_name=localhost reco_server_name=remote reco_mode=1 reconnect=1" \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13220 | 1 \ |
| 13221 | -c "Protocol is TLSv1.3" \ |
| 13222 | -c "got new session ticket." \ |
| 13223 | -c "Saving session for reuse... ok" \ |
| 13224 | -c "Reconnecting with saved session" \ |
Xiaokang Qian | ed0620c | 2022-10-12 06:58:13 +0000 | [diff] [blame] | 13225 | -c "Hostname mismatch the session ticket, disable session resumption." \ |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13226 | -s "=> write NewSessionTicket msg" \ |
Jerry Yu | a8d3c50 | 2022-10-30 14:51:23 +0800 | [diff] [blame] | 13227 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET" \ |
| 13228 | -s "server state: MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH" |
Xiaokang Qian | 281fd1b | 2022-09-20 11:35:41 +0000 | [diff] [blame] | 13229 | |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13230 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13231 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13232 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 13233 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13234 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13235 | requires_config_enabled PSA_WANT_ALG_FFDH |
| 13236 | requires_gnutls_tls1_3 |
| 13237 | requires_gnutls_next_no_ticket |
| 13238 | requires_gnutls_next_disable_tls13_compat |
| 13239 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe3072,rsa_pss_rsae_sha256" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13240 | "$P_SRV crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe3072 tls13_kex_modes=ephemeral cookies=0 tickets=0" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13241 | "$G_NEXT_CLI_NO_CERT --debug=4 --single-key-share --x509cafile data_files/test-ca_cat12.crt --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE3072:+VERS-TLS1.3:%NO_TICKETS" \ |
| 13242 | 0 \ |
| 13243 | -s "Protocol is TLSv1.3" \ |
| 13244 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 13245 | -s "received signature algorithm: 0x804" \ |
| 13246 | -s "got named group: ffdhe3072(0101)" \ |
| 13247 | -s "Certificate verification was skipped" \ |
| 13248 | -C "received HelloRetryRequest message" |
| 13249 | |
| 13250 | |
| 13251 | requires_gnutls_tls1_3 |
| 13252 | requires_gnutls_next_no_ticket |
| 13253 | requires_gnutls_next_disable_tls13_compat |
| 13254 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13255 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13256 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 13257 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13258 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13259 | requires_config_enabled PSA_WANT_ALG_FFDH |
| 13260 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe3072,rsa_pss_rsae_sha256" \ |
| 13261 | "$G_NEXT_SRV_NO_CERT --http --disable-client-cert --debug=4 --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE3072:+VERS-TLS1.3:%NO_TICKETS" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13262 | "$P_CLI ca_file=data_files/test-ca_cat12.crt debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe3072" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13263 | 0 \ |
| 13264 | -c "HTTP/1.0 200 OK" \ |
| 13265 | -c "Protocol is TLSv1.3" \ |
| 13266 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 13267 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 13268 | -c "NamedGroup: ffdhe3072 ( 101 )" \ |
| 13269 | -c "Verifying peer X.509 certificate... ok" \ |
| 13270 | -C "received HelloRetryRequest message" |
| 13271 | |
| 13272 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13273 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13274 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 13275 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13276 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13277 | requires_config_enabled PSA_WANT_ALG_FFDH |
| 13278 | requires_gnutls_tls1_3 |
| 13279 | requires_gnutls_next_no_ticket |
| 13280 | requires_gnutls_next_disable_tls13_compat |
| 13281 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe4096,rsa_pss_rsae_sha256" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13282 | "$P_SRV crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe4096 tls13_kex_modes=ephemeral cookies=0 tickets=0" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13283 | "$G_NEXT_CLI_NO_CERT --debug=4 --single-key-share --x509cafile data_files/test-ca_cat12.crt --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE4096:+VERS-TLS1.3:%NO_TICKETS" \ |
| 13284 | 0 \ |
| 13285 | -s "Protocol is TLSv1.3" \ |
| 13286 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 13287 | -s "received signature algorithm: 0x804" \ |
| 13288 | -s "got named group: ffdhe4096(0102)" \ |
| 13289 | -s "Certificate verification was skipped" \ |
| 13290 | -C "received HelloRetryRequest message" |
| 13291 | |
| 13292 | |
| 13293 | requires_gnutls_tls1_3 |
| 13294 | requires_gnutls_next_no_ticket |
| 13295 | requires_gnutls_next_disable_tls13_compat |
| 13296 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13297 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13298 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 13299 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13300 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13301 | requires_config_enabled PSA_WANT_ALG_FFDH |
| 13302 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe4096,rsa_pss_rsae_sha256" \ |
| 13303 | "$G_NEXT_SRV_NO_CERT --http --disable-client-cert --debug=4 --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE4096:+VERS-TLS1.3:%NO_TICKETS" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13304 | "$P_CLI ca_file=data_files/test-ca_cat12.crt debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe4096" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13305 | 0 \ |
| 13306 | -c "HTTP/1.0 200 OK" \ |
| 13307 | -c "Protocol is TLSv1.3" \ |
| 13308 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 13309 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 13310 | -c "NamedGroup: ffdhe4096 ( 102 )" \ |
| 13311 | -c "Verifying peer X.509 certificate... ok" \ |
| 13312 | -C "received HelloRetryRequest message" |
| 13313 | |
| 13314 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13315 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13316 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 13317 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13318 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13319 | requires_config_enabled PSA_WANT_ALG_FFDH |
| 13320 | requires_gnutls_tls1_3 |
| 13321 | requires_gnutls_next_no_ticket |
| 13322 | requires_gnutls_next_disable_tls13_compat |
| 13323 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe6144,rsa_pss_rsae_sha256" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13324 | "$P_SRV crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe6144 tls13_kex_modes=ephemeral cookies=0 tickets=0" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13325 | "$G_NEXT_CLI_NO_CERT --debug=4 --single-key-share --x509cafile data_files/test-ca_cat12.crt --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE6144:+VERS-TLS1.3:%NO_TICKETS" \ |
| 13326 | 0 \ |
| 13327 | -s "Protocol is TLSv1.3" \ |
| 13328 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 13329 | -s "received signature algorithm: 0x804" \ |
| 13330 | -s "got named group: ffdhe6144(0103)" \ |
| 13331 | -s "Certificate verification was skipped" \ |
| 13332 | -C "received HelloRetryRequest message" |
| 13333 | |
| 13334 | requires_gnutls_tls1_3 |
| 13335 | requires_gnutls_next_no_ticket |
| 13336 | requires_gnutls_next_disable_tls13_compat |
| 13337 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13338 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13339 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 13340 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13341 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13342 | requires_config_enabled PSA_WANT_ALG_FFDH |
| 13343 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe6144,rsa_pss_rsae_sha256" \ |
| 13344 | "$G_NEXT_SRV_NO_CERT --http --disable-client-cert --debug=4 --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE6144:+VERS-TLS1.3:%NO_TICKETS" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13345 | "$P_CLI ca_file=data_files/test-ca_cat12.crt debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe6144" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13346 | 0 \ |
| 13347 | -c "HTTP/1.0 200 OK" \ |
| 13348 | -c "Protocol is TLSv1.3" \ |
| 13349 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 13350 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 13351 | -c "NamedGroup: ffdhe6144 ( 103 )" \ |
| 13352 | -c "Verifying peer X.509 certificate... ok" \ |
| 13353 | -C "received HelloRetryRequest message" |
| 13354 | |
| 13355 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13356 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13357 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 13358 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13359 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13360 | requires_config_enabled PSA_WANT_ALG_FFDH |
| 13361 | requires_gnutls_tls1_3 |
| 13362 | requires_gnutls_next_no_ticket |
| 13363 | requires_gnutls_next_disable_tls13_compat |
| 13364 | client_needs_more_time 4 |
| 13365 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe8192,rsa_pss_rsae_sha256" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13366 | "$P_SRV crt_file=data_files/server2-sha256.crt key_file=data_files/server2.key debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe8192 tls13_kex_modes=ephemeral cookies=0 tickets=0" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13367 | "$G_NEXT_CLI_NO_CERT --debug=4 --single-key-share --x509cafile data_files/test-ca_cat12.crt --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE8192:+VERS-TLS1.3:%NO_TICKETS" \ |
| 13368 | 0 \ |
| 13369 | -s "Protocol is TLSv1.3" \ |
| 13370 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 13371 | -s "received signature algorithm: 0x804" \ |
| 13372 | -s "got named group: ffdhe8192(0104)" \ |
| 13373 | -s "Certificate verification was skipped" \ |
| 13374 | -C "received HelloRetryRequest message" |
| 13375 | |
| 13376 | requires_gnutls_tls1_3 |
| 13377 | requires_gnutls_next_no_ticket |
| 13378 | requires_gnutls_next_disable_tls13_compat |
| 13379 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13380 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13381 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 13382 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13383 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 13384 | requires_config_enabled PSA_WANT_ALG_FFDH |
| 13385 | client_needs_more_time 4 |
| 13386 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe8192,rsa_pss_rsae_sha256" \ |
| 13387 | "$G_NEXT_SRV_NO_CERT --http --disable-client-cert --debug=4 --x509certfile data_files/server2-sha256.crt --x509keyfile data_files/server2.key --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE8192:+VERS-TLS1.3:%NO_TICKETS" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13388 | "$P_CLI ca_file=data_files/test-ca_cat12.crt debug_level=4 force_ciphersuite=TLS1-3-AES-128-GCM-SHA256 sig_algs=rsa_pss_rsae_sha256 groups=ffdhe8192" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 13389 | 0 \ |
| 13390 | -c "HTTP/1.0 200 OK" \ |
| 13391 | -c "Protocol is TLSv1.3" \ |
| 13392 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 13393 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 13394 | -c "NamedGroup: ffdhe8192 ( 104 )" \ |
| 13395 | -c "Verifying peer X.509 certificate... ok" \ |
| 13396 | -C "received HelloRetryRequest message" |
| 13397 | |
Ronald Cron | 8a74f07 | 2023-06-14 17:59:29 +0200 | [diff] [blame] | 13398 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 13399 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13400 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13401 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 13402 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 13403 | run_test "TLS 1.3: no HRR in case of PSK key exchange mode" \ |
Gilles Peskine | b387fcf | 2023-07-11 09:19:13 +0200 | [diff] [blame] | 13404 | "$P_SRV nbio=2 psk=010203 psk_identity=0a0b0c tls13_kex_modes=psk groups=none" \ |
Ronald Cron | 8a74f07 | 2023-06-14 17:59:29 +0200 | [diff] [blame] | 13405 | "$P_CLI nbio=2 debug_level=3 psk=010203 psk_identity=0a0b0c tls13_kex_modes=all" \ |
| 13406 | 0 \ |
| 13407 | -C "received HelloRetryRequest message" \ |
| 13408 | -c "Selected key exchange mode: psk$" \ |
| 13409 | -c "HTTP/1.0 200 OK" |
| 13410 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13411 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 13412 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13413 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 13414 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 13415 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 13416 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 13417 | run_tests_memory_after_hanshake |
| 13418 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 13419 | if [ "$LIST_TESTS" -eq 0 ]; then |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 13420 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 13421 | # Final report |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13422 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 13423 | echo "------------------------------------------------------------------------" |
| 13424 | |
| 13425 | if [ $FAILS = 0 ]; then |
| 13426 | printf "PASSED" |
| 13427 | else |
| 13428 | printf "FAILED" |
| 13429 | fi |
| 13430 | PASSES=$(( $TESTS - $FAILS )) |
| 13431 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
| 13432 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13433 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13434 | |
Tom Cosgrove | fc0e79e | 2023-01-13 12:13:41 +0000 | [diff] [blame] | 13435 | if [ $FAILS -gt 255 ]; then |
| 13436 | # Clamp at 255 as caller gets exit code & 0xFF |
| 13437 | # (so 256 would be 0, or success, etc) |
| 13438 | FAILS=255 |
| 13439 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 13440 | exit $FAILS |