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 | |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 32 | DATA_FILES_PATH=../framework/data_files |
| 33 | |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 34 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 35 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 36 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 37 | : ${P_PXY:=../programs/test/udp_proxy} |
Jerry Yu | d04fd35 | 2021-12-06 16:52:57 +0800 | [diff] [blame] | 38 | : ${P_QUERY:=../programs/test/query_compile_time_config} |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 39 | : ${OPENSSL:=openssl} |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 40 | : ${GNUTLS_CLI:=gnutls-cli} |
| 41 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 42 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 43 | |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 44 | # The OPENSSL variable used to be OPENSSL_CMD for historical reasons. |
| 45 | # To help the migration, error out if the old variable is set, |
| 46 | # but only if it has a different value than the new one. |
| 47 | if [ "${OPENSSL_CMD+set}" = set ]; then |
| 48 | # the variable is set, we can now check its value |
| 49 | if [ "$OPENSSL_CMD" != "$OPENSSL" ]; then |
| 50 | echo "Please use OPENSSL instead of OPENSSL_CMD." >&2 |
| 51 | exit 125 |
| 52 | fi |
| 53 | fi |
| 54 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 55 | guess_config_name() { |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 56 | 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] | 57 | echo "default" |
| 58 | else |
| 59 | echo "unknown" |
| 60 | fi |
| 61 | } |
| 62 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 63 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 64 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 65 | : ${EARLY_DATA_INPUT:="$DATA_FILES_PATH/tls13_early_data.txt"} |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 66 | |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 67 | O_SRV="$OPENSSL s_server -www -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 68 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL s_client" |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 69 | G_SRV="$GNUTLS_SERV --x509certfile $DATA_FILES_PATH/server5.crt --x509keyfile $DATA_FILES_PATH/server5.key" |
| 70 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt" |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 71 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 72 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 73 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 74 | |
Gilles Peskine | f9c798c | 2024-04-29 17:46:24 +0200 | [diff] [blame] | 75 | # If $OPENSSL is at least 1.1.1, use it as OPENSSL_NEXT as well. |
| 76 | if [ -z "${OPENSSL_NEXT:-}" ]; then |
| 77 | case $($OPENSSL version) in |
| 78 | OpenSSL\ 1.1.[1-9]*) OPENSSL_NEXT=$OPENSSL;; |
| 79 | OpenSSL\ [3-9]*) OPENSSL_NEXT=$OPENSSL;; |
| 80 | esac |
| 81 | fi |
| 82 | |
| 83 | # If $GNUTLS_CLI is at least 3.7, use it as GNUTLS_NEXT_CLI as well. |
| 84 | if [ -z "${GNUTLS_NEXT_CLI:-}" ]; then |
| 85 | case $($GNUTLS_CLI --version) in |
| 86 | gnutls-cli\ 3.[1-9][0-9]*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 87 | gnutls-cli\ 3.[7-9].*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 88 | gnutls-cli\ [4-9]*) GNUTLS_NEXT_CLI=$GNUTLS_CLI;; |
| 89 | esac |
| 90 | fi |
| 91 | |
| 92 | # If $GNUTLS_SERV is at least 3.7, use it as GNUTLS_NEXT_SERV as well. |
| 93 | if [ -z "${GNUTLS_NEXT_SERV:-}" ]; then |
| 94 | case $($GNUTLS_SERV --version) in |
| 95 | gnutls-cli\ 3.[1-9][0-9]*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 96 | gnutls-cli\ 3.[7-9].*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 97 | gnutls-cli\ [4-9]*) GNUTLS_NEXT_SERV=$GNUTLS_SERV;; |
| 98 | esac |
| 99 | fi |
| 100 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 101 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 102 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" |
| 103 | O_NEXT_SRV_EARLY_DATA="$OPENSSL_NEXT s_server -early_data -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 104 | O_NEXT_SRV_NO_CERT="$OPENSSL_NEXT s_server -www " |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 105 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client -CAfile $DATA_FILES_PATH/test-ca_cat12.crt" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 106 | 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] | 107 | else |
| 108 | O_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 109 | O_NEXT_SRV_NO_CERT=false |
Xiaokang Qian | b0c32d8 | 2022-11-02 10:51:13 +0000 | [diff] [blame] | 110 | O_NEXT_SRV_EARLY_DATA=false |
XiaokangQian | b1847a2 | 2022-06-08 07:49:31 +0000 | [diff] [blame] | 111 | O_NEXT_CLI_NO_CERT=false |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 112 | O_NEXT_CLI=false |
| 113 | fi |
| 114 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 115 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 116 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile $DATA_FILES_PATH/server5.crt --x509keyfile $DATA_FILES_PATH/server5.key" |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 117 | G_NEXT_SRV_NO_CERT="$GNUTLS_NEXT_SERV" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 118 | else |
| 119 | G_NEXT_SRV=false |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 120 | G_NEXT_SRV_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 121 | fi |
| 122 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 123 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 124 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt" |
XiaokangQian | d5d5b60 | 2022-05-23 09:16:20 +0000 | [diff] [blame] | 125 | 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] | 126 | else |
| 127 | G_NEXT_CLI=false |
XiaokangQian | fb1a3fe | 2022-06-09 06:37:33 +0000 | [diff] [blame] | 128 | G_NEXT_CLI_NO_CERT=false |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 129 | fi |
| 130 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 131 | TESTS=0 |
| 132 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 133 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 134 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 135 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 136 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 137 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 138 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 139 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 140 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 141 | SHOW_TEST_NUMBER=0 |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 142 | LIST_TESTS=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 143 | RUN_TEST_NUMBER='' |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 144 | RUN_TEST_SUITE='' |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 145 | |
Gilles Peskine | c75048c | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 146 | MIN_TESTS=1 |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 147 | PRESERVE_LOGS=0 |
| 148 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 149 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 150 | # port which is this plus 10000. Each port number may be independently |
| 151 | # overridden by a command line option. |
| 152 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 153 | PXY_PORT=$((SRV_PORT + 10000)) |
| 154 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 155 | print_usage() { |
| 156 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 157 | printf " -h|--help\tPrint this help.\n" |
| 158 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 159 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 160 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 161 | 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] | 162 | 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] | 163 | 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] | 164 | printf " --list-test-cases\tList all potential test cases (No Execution)\n" |
Gilles Peskine | c75048c | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 165 | printf " --min \tMinimum number of non-skipped tests (default 1)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 166 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 167 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 168 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 169 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 170 | printf " --seed \tInteger seed value to use for this test run\n" |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 171 | printf " --test-suite\tOnly matching test suites are executed\n" |
| 172 | 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] | 173 | } |
| 174 | |
| 175 | get_options() { |
| 176 | while [ $# -gt 0 ]; do |
| 177 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 178 | -f|--filter) |
| 179 | shift; FILTER=$1 |
| 180 | ;; |
| 181 | -e|--exclude) |
| 182 | shift; EXCLUDE=$1 |
| 183 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 184 | -m|--memcheck) |
| 185 | MEMCHECK=1 |
| 186 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 187 | -n|--number) |
| 188 | shift; RUN_TEST_NUMBER=$1 |
| 189 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 190 | -s|--show-numbers) |
| 191 | SHOW_TEST_NUMBER=1 |
| 192 | ;; |
Tomás González | 4a86da2 | 2023-09-01 17:41:16 +0100 | [diff] [blame] | 193 | -l|--list-test-cases) |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 194 | LIST_TESTS=1 |
| 195 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 196 | -p|--preserve-logs) |
| 197 | PRESERVE_LOGS=1 |
| 198 | ;; |
Gilles Peskine | c75048c | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 199 | --min) |
| 200 | shift; MIN_TESTS=$1 |
| 201 | ;; |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 202 | --outcome-file) |
| 203 | shift; MBEDTLS_TEST_OUTCOME_FILE=$1 |
| 204 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 205 | --port) |
| 206 | shift; SRV_PORT=$1 |
| 207 | ;; |
| 208 | --proxy-port) |
| 209 | shift; PXY_PORT=$1 |
| 210 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 211 | --seed) |
| 212 | shift; SEED="$1" |
| 213 | ;; |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 214 | --test-suite) |
| 215 | shift; RUN_TEST_SUITE="$1" |
| 216 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 217 | -h|--help) |
| 218 | print_usage |
| 219 | exit 0 |
| 220 | ;; |
| 221 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 222 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 223 | print_usage |
| 224 | exit 1 |
| 225 | ;; |
| 226 | esac |
| 227 | shift |
| 228 | done |
| 229 | } |
| 230 | |
Tomás González | 0e8a08a | 2023-08-23 15:29:57 +0100 | [diff] [blame] | 231 | get_options "$@" |
| 232 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 233 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 234 | # testing. Skip non-boolean options (with something other than spaces |
| 235 | # and a comment after "#define SYMBOL"). The variable contains a |
| 236 | # space-separated list of symbols. |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 237 | if [ "$LIST_TESTS" -eq 0 ];then |
| 238 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
| 239 | else |
Tomás González | be2c66e | 2023-09-01 10:34:49 +0100 | [diff] [blame] | 240 | P_QUERY=":" |
Tomás González | f162b4f | 2023-08-23 15:31:12 +0100 | [diff] [blame] | 241 | CONFIGS_ENABLED="" |
| 242 | fi |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 243 | # Skip next test; use this macro to skip tests which are legitimate |
| 244 | # in theory and expected to be re-introduced at some point, but |
| 245 | # aren't expected to succeed at the moment due to problems outside |
| 246 | # our control (such as bugs in other TLS implementations). |
| 247 | skip_next_test() { |
| 248 | SKIP_NEXT="YES" |
| 249 | } |
| 250 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 251 | # Check if the required configuration ($1) is enabled |
| 252 | is_config_enabled() |
| 253 | { |
| 254 | case $CONFIGS_ENABLED in |
| 255 | *" $1"[\ =]*) return 0;; |
| 256 | *) return 1;; |
| 257 | esac |
| 258 | } |
| 259 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 260 | # 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] | 261 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 262 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 263 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 264 | *) SKIP_NEXT="YES";; |
| 265 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 266 | } |
| 267 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 268 | # 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] | 269 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 270 | case $CONFIGS_ENABLED in |
Jerry Yu | 2e8b001 | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 271 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 272 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 273 | } |
| 274 | |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 275 | requires_all_configs_enabled() { |
Jerry Yu | 9dd0cc0 | 2023-10-18 11:25:30 +0800 | [diff] [blame] | 276 | if ! $P_QUERY -all $* 2>&1 > /dev/null |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 277 | then |
| 278 | SKIP_NEXT="YES" |
| 279 | fi |
| 280 | } |
| 281 | |
| 282 | requires_all_configs_disabled() { |
Jerry Yu | 9dd0cc0 | 2023-10-18 11:25:30 +0800 | [diff] [blame] | 283 | if $P_QUERY -any $* 2>&1 > /dev/null |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 284 | then |
| 285 | SKIP_NEXT="YES" |
| 286 | fi |
| 287 | } |
| 288 | |
| 289 | requires_any_configs_enabled() { |
Jerry Yu | 9dd0cc0 | 2023-10-18 11:25:30 +0800 | [diff] [blame] | 290 | if ! $P_QUERY -any $* 2>&1 > /dev/null |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 291 | then |
| 292 | SKIP_NEXT="YES" |
| 293 | fi |
| 294 | } |
| 295 | |
| 296 | requires_any_configs_disabled() { |
Jerry Yu | 9dd0cc0 | 2023-10-18 11:25:30 +0800 | [diff] [blame] | 297 | if $P_QUERY -all $* 2>&1 > /dev/null |
Jerry Yu | 2fcb056 | 2022-07-27 17:30:49 +0800 | [diff] [blame] | 298 | then |
| 299 | SKIP_NEXT="YES" |
| 300 | fi |
| 301 | } |
| 302 | |
Ronald Cron | 454eb91 | 2022-10-21 08:56:04 +0200 | [diff] [blame] | 303 | TLS1_2_KEY_EXCHANGES_WITH_CERT="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 304 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 305 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 306 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 307 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED \ |
| 308 | MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED \ |
| 309 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 310 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 311 | TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT="MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 312 | MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED" |
| 313 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 314 | TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH="MBEDTLS_KEY_EXCHANGE_RSA_ENABLED \ |
| 315 | MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED \ |
| 316 | MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED \ |
| 317 | MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED \ |
| 318 | MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED" |
| 319 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 320 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled() { |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 321 | if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_2 |
| 322 | then |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 323 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 324 | elif ! $P_QUERY -all MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 325 | then |
| 326 | SKIP_NEXT="YES" |
| 327 | fi |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 328 | } |
| 329 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 330 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 331 | # This function uses the query_config command line option to query the |
| 332 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 333 | # program. The command will always return a success value if the |
| 334 | # configuration is defined and the value will be printed to stdout. |
| 335 | # |
| 336 | # Note that if the configuration is not defined or is defined to nothing, |
| 337 | # the output of this function will be an empty string. |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 338 | if [ "$LIST_TESTS" -eq 0 ];then |
| 339 | ${P_SRV} "query_config=${1}" |
| 340 | else |
| 341 | echo "1" |
| 342 | fi |
| 343 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 344 | } |
| 345 | |
| 346 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 347 | VAL="$( get_config_value_or_default "$1" )" |
| 348 | if [ -z "$VAL" ]; then |
| 349 | # Should never happen |
| 350 | echo "Mbed TLS configuration $1 is not defined" |
| 351 | exit 1 |
| 352 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 353 | SKIP_NEXT="YES" |
| 354 | fi |
| 355 | } |
| 356 | |
| 357 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 358 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 359 | if [ -z "$VAL" ]; then |
| 360 | # Should never happen |
| 361 | echo "Mbed TLS configuration $1 is not defined" |
| 362 | exit 1 |
| 363 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 364 | SKIP_NEXT="YES" |
| 365 | fi |
| 366 | } |
| 367 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 368 | requires_config_value_equals() { |
| 369 | VAL=$( get_config_value_or_default "$1" ) |
| 370 | if [ -z "$VAL" ]; then |
| 371 | # Should never happen |
| 372 | echo "Mbed TLS configuration $1 is not defined" |
| 373 | exit 1 |
| 374 | elif [ "$VAL" -ne "$2" ]; then |
| 375 | SKIP_NEXT="YES" |
| 376 | fi |
| 377 | } |
| 378 | |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 379 | # Require Mbed TLS to support the given protocol version. |
| 380 | # |
| 381 | # Inputs: |
| 382 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 383 | requires_protocol_version() { |
| 384 | # Support for DTLS is detected separately in detect_dtls(). |
| 385 | case "$1" in |
| 386 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 387 | tls13|dtls13) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3;; |
| 388 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 389 | esac |
| 390 | } |
| 391 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 392 | # Space-separated list of ciphersuites supported by this build of |
| 393 | # Mbed TLS. |
Ronald Cron | 5b73de8 | 2023-11-28 15:49:25 +0100 | [diff] [blame] | 394 | P_CIPHERSUITES="" |
| 395 | if [ "$LIST_TESTS" -eq 0 ]; then |
| 396 | P_CIPHERSUITES=" $($P_CLI help_ciphersuites 2>/dev/null | |
| 397 | grep 'TLS-\|TLS1-3' | |
| 398 | tr -s ' \n' ' ')" |
| 399 | |
| 400 | if [ -z "${P_CIPHERSUITES# }" ]; then |
| 401 | echo >&2 "$0: fatal error: no cipher suites found!" |
| 402 | exit 125 |
| 403 | fi |
| 404 | fi |
| 405 | |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 406 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 407 | case $P_CIPHERSUITES in |
| 408 | *" $1 "*) :;; |
| 409 | *) SKIP_NEXT="YES";; |
| 410 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 411 | } |
| 412 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 413 | requires_cipher_enabled() { |
| 414 | KEY_TYPE=$1 |
| 415 | MODE=${2:-} |
| 416 | if is_config_enabled MBEDTLS_USE_PSA_CRYPTO; then |
| 417 | case "$KEY_TYPE" in |
| 418 | CHACHA20) |
| 419 | requires_config_enabled PSA_WANT_ALG_CHACHA20_POLY1305 |
| 420 | requires_config_enabled PSA_WANT_KEY_TYPE_CHACHA20 |
| 421 | ;; |
| 422 | *) |
| 423 | requires_config_enabled PSA_WANT_ALG_${MODE} |
| 424 | requires_config_enabled PSA_WANT_KEY_TYPE_${KEY_TYPE} |
| 425 | ;; |
| 426 | esac |
| 427 | else |
| 428 | case "$KEY_TYPE" in |
| 429 | CHACHA20) |
| 430 | requires_config_enabled MBEDTLS_CHACHA20_C |
| 431 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 432 | ;; |
| 433 | *) |
| 434 | requires_config_enabled MBEDTLS_${MODE}_C |
| 435 | requires_config_enabled MBEDTLS_${KEY_TYPE}_C |
| 436 | ;; |
| 437 | esac |
| 438 | fi |
| 439 | } |
| 440 | |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 441 | # Automatically detect required features based on command line parameters. |
| 442 | # Parameters are: |
| 443 | # - $1 = command line (call to a TLS client or server program) |
| 444 | # - $2 = client/server |
| 445 | # - $3 = TLS version (TLS12 or TLS13) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 446 | # - $4 = Use an external tool without ECDH support |
| 447 | # - $5 = run test options |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 448 | detect_required_features() { |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 449 | CMD_LINE=$1 |
| 450 | ROLE=$2 |
| 451 | TLS_VERSION=$3 |
| 452 | EXT_WO_ECDH=$4 |
| 453 | TEST_OPTIONS=${5:-} |
| 454 | |
| 455 | case "$CMD_LINE" in |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 456 | *\ force_version=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 457 | tmp="${CMD_LINE##*\ force_version=}" |
Gilles Peskine | c912673 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 458 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 459 | requires_protocol_version "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 460 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 461 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 462 | case "$CMD_LINE" in |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 463 | *\ force_ciphersuite=*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 464 | tmp="${CMD_LINE##*\ force_ciphersuite=}" |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 465 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 466 | requires_ciphersuite_enabled "$tmp";; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 467 | esac |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 468 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 469 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 470 | *[-_\ =]tickets=[^0]*) |
| 471 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 472 | esac |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 473 | case " $CMD_LINE " in |
Gilles Peskine | 740b734 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 474 | *[-_\ =]alpn=*) |
| 475 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 476 | esac |
| 477 | |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 478 | case "$CMD_LINE" in |
Gilles Peskine | 1bc28fe | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 479 | */server5*|\ |
| 480 | */server7*|\ |
| 481 | */dir-maxpath*) |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 482 | if [ "$TLS_VERSION" = "TLS13" ]; then |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 483 | # In case of TLS13 the support for ECDSA is enough |
| 484 | requires_pk_alg "ECDSA" |
| 485 | else |
| 486 | # For TLS12 requirements are different between server and client |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 487 | if [ "$ROLE" = "server" ]; then |
Valerio Setti | 194e2bd | 2023-03-02 17:18:10 +0100 | [diff] [blame] | 488 | # If the server uses "server5*" certificates, then an ECDSA based |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 489 | # key exchange is required. However gnutls also does not |
| 490 | # support ECDH, so this limit the choice to ECDHE-ECDSA |
| 491 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 492 | requires_any_configs_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 493 | else |
| 494 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_ECDSA_CERT |
| 495 | fi |
| 496 | elif [ "$ROLE" = "client" ]; then |
| 497 | # On the client side it is enough to have any certificate |
| 498 | # based authentication together with support for ECDSA. |
| 499 | # Of course the GnuTLS limitation mentioned above applies |
| 500 | # also here. |
| 501 | if [ "$EXT_WO_ECDH" = "yes" ]; then |
| 502 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT_WO_ECDH |
| 503 | else |
| 504 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 505 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 506 | requires_pk_alg "ECDSA" |
| 507 | fi |
| 508 | fi |
| 509 | ;; |
| 510 | esac |
| 511 | |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 512 | case "$CMD_LINE" in |
Gilles Peskine | 121a7bf | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 513 | */server1*|\ |
Gilles Peskine | 1bc28fe | 2024-04-26 21:28:49 +0200 | [diff] [blame] | 514 | */server2*|\ |
| 515 | */server7*) |
Gilles Peskine | 121a7bf | 2024-04-29 16:03:02 +0200 | [diff] [blame] | 516 | # Certificates with an RSA key. The algorithm requirement is |
| 517 | # some subset of {PKCS#1v1.5 encryption, PKCS#1v1.5 signature, |
| 518 | # PSS signature}. We can't easily tell which subset works, and |
| 519 | # we aren't currently running ssl-opt.sh in configurations |
| 520 | # where partial RSA support is a problem, so generically, we |
| 521 | # just require RSA and it works out for our tests so far. |
Valerio Setti | 4f577f3 | 2023-07-31 18:58:25 +0200 | [diff] [blame] | 522 | requires_config_enabled "MBEDTLS_RSA_C" |
| 523 | esac |
| 524 | |
Gilles Peskine | b898b3d | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 525 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 526 | } |
| 527 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 528 | requires_certificate_authentication () { |
| 529 | if [ "$PSK_ONLY" = "YES" ]; then |
| 530 | SKIP_NEXT="YES" |
| 531 | fi |
| 532 | } |
| 533 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 534 | adapt_cmd_for_psk () { |
| 535 | case "$2" in |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 536 | *openssl*s_server*) s='-psk 73776f726466697368 -nocert';; |
| 537 | *openssl*) s='-psk 73776f726466697368';; |
| 538 | *gnutls-*) s='--pskusername=Client_identity --pskkey=73776f726466697368';; |
| 539 | *) s='psk=73776f726466697368';; |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 540 | esac |
| 541 | eval $1='"$2 $s"' |
| 542 | unset s |
| 543 | } |
| 544 | |
| 545 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 546 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 547 | # |
| 548 | # If not running in a PSK-only build, do nothing. |
| 549 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 550 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 551 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 552 | # a pre-shared key, do nothing. |
| 553 | # |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 554 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 555 | # |
| 556 | # Inputs: |
| 557 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 558 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 559 | # * "$@": options passed to run_test. |
| 560 | # |
| 561 | # Outputs: |
| 562 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 563 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 564 | maybe_adapt_for_psk() { |
| 565 | if [ "$PSK_ONLY" != "YES" ]; then |
| 566 | return |
| 567 | fi |
| 568 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 569 | return |
| 570 | fi |
| 571 | case "$CLI_CMD $SRV_CMD" in |
| 572 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 573 | return;; |
| 574 | *force_ciphersuite*) |
| 575 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 576 | # PSK cipher suite could be substituted, but we're not ready for |
| 577 | # that yet. |
| 578 | SKIP_NEXT="YES" |
| 579 | return;; |
| 580 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 581 | # The test case involves certificates. PSK won't do. |
| 582 | SKIP_NEXT="YES" |
| 583 | return;; |
| 584 | esac |
| 585 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 586 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 587 | } |
| 588 | |
| 589 | case " $CONFIGS_ENABLED " in |
| 590 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 591 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 592 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 593 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 594 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 595 | *) PSK_ONLY="NO";; |
| 596 | esac |
| 597 | |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 598 | HAS_ALG_MD5="NO" |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 599 | HAS_ALG_SHA_1="NO" |
| 600 | HAS_ALG_SHA_224="NO" |
| 601 | HAS_ALG_SHA_256="NO" |
| 602 | HAS_ALG_SHA_384="NO" |
| 603 | HAS_ALG_SHA_512="NO" |
| 604 | |
| 605 | check_for_hash_alg() |
| 606 | { |
| 607 | CURR_ALG="INVALID"; |
| 608 | USE_PSA="NO" |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 609 | if is_config_enabled "MBEDTLS_USE_PSA_CRYPTO"; then |
| 610 | USE_PSA="YES"; |
| 611 | fi |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 612 | if [ $USE_PSA = "YES" ]; then |
| 613 | CURR_ALG=PSA_WANT_ALG_${1} |
| 614 | else |
| 615 | CURR_ALG=MBEDTLS_${1}_C |
| 616 | # Remove the second underscore to match MBEDTLS_* naming convention |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 617 | # MD5 is an exception to this convention |
| 618 | if [ "${1}" != "MD5" ]; then |
| 619 | CURR_ALG=$(echo "$CURR_ALG" | sed 's/_//2') |
| 620 | fi |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 621 | fi |
| 622 | |
| 623 | case $CONFIGS_ENABLED in |
| 624 | *" $CURR_ALG"[\ =]*) |
| 625 | return 0 |
| 626 | ;; |
| 627 | *) :;; |
| 628 | esac |
| 629 | return 1 |
| 630 | } |
| 631 | |
| 632 | populate_enabled_hash_algs() |
| 633 | { |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 634 | for hash_alg in SHA_1 SHA_224 SHA_256 SHA_384 SHA_512 MD5; do |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 635 | if check_for_hash_alg "$hash_alg"; then |
| 636 | hash_alg_variable=HAS_ALG_${hash_alg} |
| 637 | eval ${hash_alg_variable}=YES |
| 638 | fi |
Valerio Setti | e7f896d | 2023-03-13 13:55:28 +0100 | [diff] [blame] | 639 | done |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 640 | } |
| 641 | |
| 642 | # skip next test if the given hash alg is not supported |
| 643 | requires_hash_alg() { |
| 644 | HASH_DEFINE="Invalid" |
| 645 | HAS_HASH_ALG="NO" |
| 646 | case $1 in |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 647 | MD5):;; |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 648 | SHA_1):;; |
| 649 | SHA_224):;; |
| 650 | SHA_256):;; |
| 651 | SHA_384):;; |
| 652 | SHA_512):;; |
| 653 | *) |
| 654 | echo "Unsupported hash alg - $1" |
| 655 | exit 1 |
| 656 | ;; |
| 657 | esac |
| 658 | |
| 659 | HASH_DEFINE=HAS_ALG_${1} |
| 660 | eval "HAS_HASH_ALG=\${${HASH_DEFINE}}" |
| 661 | if [ "$HAS_HASH_ALG" = "NO" ] |
| 662 | then |
| 663 | SKIP_NEXT="YES" |
| 664 | fi |
| 665 | } |
| 666 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 667 | # Skip next test if the given pk alg is not enabled |
| 668 | requires_pk_alg() { |
| 669 | case $1 in |
| 670 | ECDSA) |
| 671 | if is_config_enabled MBEDTLS_USE_PSA_CRYPTO; then |
| 672 | requires_config_enabled PSA_WANT_ALG_ECDSA |
| 673 | else |
| 674 | requires_config_enabled MBEDTLS_ECDSA_C |
| 675 | fi |
| 676 | ;; |
| 677 | *) |
| 678 | echo "Unknown/unimplemented case $1 in requires_pk_alg" |
| 679 | exit 1 |
| 680 | ;; |
| 681 | esac |
| 682 | } |
| 683 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 684 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 685 | requires_openssl_with_fallback_scsv() { |
| 686 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
Manuel Pégourié-Gonnard | c572246 | 2022-12-19 11:42:12 +0100 | [diff] [blame] | 687 | 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] | 688 | then |
| 689 | OPENSSL_HAS_FBSCSV="YES" |
| 690 | else |
| 691 | OPENSSL_HAS_FBSCSV="NO" |
| 692 | fi |
| 693 | fi |
| 694 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 695 | SKIP_NEXT="YES" |
| 696 | fi |
| 697 | } |
| 698 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 699 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 700 | requires_max_content_len() { |
| 701 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 702 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 703 | } |
| 704 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 705 | # skip next test if GnuTLS isn't available |
| 706 | requires_gnutls() { |
| 707 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 708 | 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] | 709 | GNUTLS_AVAILABLE="YES" |
| 710 | else |
| 711 | GNUTLS_AVAILABLE="NO" |
| 712 | fi |
| 713 | fi |
| 714 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 715 | SKIP_NEXT="YES" |
| 716 | fi |
| 717 | } |
| 718 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 719 | # skip next test if GnuTLS-next isn't available |
| 720 | requires_gnutls_next() { |
| 721 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 722 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 723 | GNUTLS_NEXT_AVAILABLE="YES" |
| 724 | else |
| 725 | GNUTLS_NEXT_AVAILABLE="NO" |
| 726 | fi |
| 727 | fi |
| 728 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 729 | SKIP_NEXT="YES" |
| 730 | fi |
| 731 | } |
| 732 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 733 | requires_openssl_next() { |
| 734 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 735 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 736 | OPENSSL_NEXT_AVAILABLE="YES" |
| 737 | else |
| 738 | OPENSSL_NEXT_AVAILABLE="NO" |
| 739 | fi |
| 740 | fi |
| 741 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 742 | SKIP_NEXT="YES" |
| 743 | fi |
| 744 | } |
| 745 | |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 746 | # skip next test if openssl version is lower than 3.0 |
| 747 | requires_openssl_3_x() { |
| 748 | requires_openssl_next |
| 749 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 750 | OPENSSL_3_X_AVAILABLE="NO" |
| 751 | fi |
| 752 | if [ -z "${OPENSSL_3_X_AVAILABLE:-}" ]; then |
Przemek Stekiel | a53dca1 | 2023-06-14 20:53:09 +0200 | [diff] [blame] | 753 | if $OPENSSL_NEXT version 2>&1 | grep "OpenSSL 3." >/dev/null |
Przemek Stekiel | 422ab1f | 2023-06-14 11:04:28 +0200 | [diff] [blame] | 754 | then |
| 755 | OPENSSL_3_X_AVAILABLE="YES" |
| 756 | else |
| 757 | OPENSSL_3_X_AVAILABLE="NO" |
| 758 | fi |
| 759 | fi |
| 760 | if [ "$OPENSSL_3_X_AVAILABLE" = "NO" ]; then |
| 761 | SKIP_NEXT="YES" |
| 762 | fi |
| 763 | } |
| 764 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 765 | # skip next test if openssl does not support ffdh keys |
| 766 | requires_openssl_tls1_3_with_ffdh() { |
| 767 | requires_openssl_3_x |
| 768 | } |
| 769 | |
Przemek Stekiel | 7dda271 | 2023-06-27 14:43:33 +0200 | [diff] [blame] | 770 | # skip next test if openssl cannot handle ephemeral key exchange |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 771 | requires_openssl_tls1_3_with_compatible_ephemeral() { |
| 772 | requires_openssl_next |
| 773 | |
| 774 | if !(is_config_enabled "PSA_WANT_ALG_ECDH"); then |
| 775 | requires_openssl_tls1_3_with_ffdh |
| 776 | fi |
| 777 | } |
| 778 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 779 | # skip next test if tls1_3 is not available |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 780 | requires_openssl_tls1_3() { |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 781 | requires_openssl_next |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 782 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 783 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 784 | fi |
| 785 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 786 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 787 | then |
| 788 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 789 | else |
| 790 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 791 | fi |
| 792 | fi |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 793 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 794 | SKIP_NEXT="YES" |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 795 | fi |
| 796 | } |
| 797 | |
| 798 | # skip next test if tls1_3 is not available |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 799 | requires_gnutls_tls1_3() { |
| 800 | requires_gnutls_next |
| 801 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 802 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 803 | fi |
| 804 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 805 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 806 | then |
| 807 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 808 | else |
| 809 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 810 | fi |
| 811 | fi |
| 812 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 813 | SKIP_NEXT="YES" |
| 814 | fi |
| 815 | } |
| 816 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 817 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 818 | requires_gnutls_next_no_ticket() { |
| 819 | requires_gnutls_next |
| 820 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 821 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 822 | fi |
| 823 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 824 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 825 | then |
| 826 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 827 | else |
| 828 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 829 | fi |
| 830 | fi |
| 831 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 832 | SKIP_NEXT="YES" |
| 833 | fi |
| 834 | } |
| 835 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 836 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 837 | requires_gnutls_next_disable_tls13_compat() { |
| 838 | requires_gnutls_next |
| 839 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 840 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 841 | fi |
| 842 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 843 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 844 | then |
| 845 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 846 | else |
| 847 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 848 | fi |
| 849 | fi |
| 850 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 851 | SKIP_NEXT="YES" |
| 852 | fi |
| 853 | } |
| 854 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 855 | # skip next test if GnuTLS does not support the record size limit extension |
| 856 | requires_gnutls_record_size_limit() { |
| 857 | requires_gnutls_next |
| 858 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 859 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="NO" |
| 860 | else |
| 861 | GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE="YES" |
| 862 | fi |
| 863 | if [ "$GNUTLS_RECORD_SIZE_LIMIT_AVAILABLE" = "NO" ]; then |
| 864 | SKIP_NEXT="YES" |
| 865 | fi |
| 866 | } |
| 867 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 868 | # skip next test if IPv6 isn't available on this host |
| 869 | requires_ipv6() { |
| 870 | if [ -z "${HAS_IPV6:-}" ]; then |
| 871 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 872 | SRV_PID=$! |
| 873 | sleep 1 |
| 874 | kill $SRV_PID >/dev/null 2>&1 |
| 875 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 876 | HAS_IPV6="NO" |
| 877 | else |
| 878 | HAS_IPV6="YES" |
| 879 | fi |
| 880 | rm -r $SRV_OUT |
| 881 | fi |
| 882 | |
| 883 | if [ "$HAS_IPV6" = "NO" ]; then |
| 884 | SKIP_NEXT="YES" |
| 885 | fi |
| 886 | } |
| 887 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 888 | # skip next test if it's i686 or uname is not available |
| 889 | requires_not_i686() { |
| 890 | if [ -z "${IS_I686:-}" ]; then |
| 891 | IS_I686="YES" |
| 892 | if which "uname" >/dev/null 2>&1; then |
| 893 | if [ -z "$(uname -a | grep i686)" ]; then |
| 894 | IS_I686="NO" |
| 895 | fi |
| 896 | fi |
| 897 | fi |
| 898 | if [ "$IS_I686" = "YES" ]; then |
| 899 | SKIP_NEXT="YES" |
| 900 | fi |
| 901 | } |
| 902 | |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 903 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 904 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 905 | 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] | 906 | if [ "$LIST_TESTS" -eq 0 ];then |
| 907 | # Calculate the input & output maximum content lengths set in the config |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 908 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 909 | # Calculate the maximum content length that fits both |
| 910 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 911 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 912 | fi |
| 913 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 914 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 915 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 916 | fi |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 917 | # skip the next test if the SSL output buffer is less than 16KB |
| 918 | requires_full_size_output_buffer() { |
| 919 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 920 | SKIP_NEXT="YES" |
| 921 | fi |
| 922 | } |
| 923 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 924 | # skip the next test if valgrind is in use |
| 925 | not_with_valgrind() { |
| 926 | if [ "$MEMCHECK" -gt 0 ]; then |
| 927 | SKIP_NEXT="YES" |
| 928 | fi |
| 929 | } |
| 930 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 931 | # skip the next test if valgrind is NOT in use |
| 932 | only_with_valgrind() { |
| 933 | if [ "$MEMCHECK" -eq 0 ]; then |
| 934 | SKIP_NEXT="YES" |
| 935 | fi |
| 936 | } |
| 937 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 938 | # 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] | 939 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 940 | CLI_DELAY_FACTOR=$1 |
| 941 | } |
| 942 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 943 | # wait for the given seconds after the client finished in the next test |
| 944 | server_needs_more_time() { |
| 945 | SRV_DELAY_SECONDS=$1 |
| 946 | } |
| 947 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 948 | # print_name <name> |
| 949 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 950 | TESTS=$(( $TESTS + 1 )) |
| 951 | LINE="" |
| 952 | |
| 953 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 954 | LINE="$TESTS " |
| 955 | fi |
| 956 | |
| 957 | LINE="$LINE$1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 958 | |
Tomás González | 378e364 | 2023-09-04 10:41:37 +0100 | [diff] [blame] | 959 | printf "%s " "$LINE" |
| 960 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
| 961 | for i in `seq 1 $LEN`; do printf '.'; done |
| 962 | printf ' ' |
| 963 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 964 | } |
| 965 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 966 | # record_outcome <outcome> [<failure-reason>] |
| 967 | # The test name must be in $NAME. |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 968 | # Use $TEST_SUITE_NAME as the test suite name if set. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 969 | record_outcome() { |
| 970 | echo "$1" |
| 971 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 972 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 973 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
Jerry Yu | 9e47b26 | 2023-11-06 10:52:01 +0800 | [diff] [blame] | 974 | "${TEST_SUITE_NAME:-ssl-opt}" "$NAME" \ |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 975 | "$1" "${2-}" \ |
| 976 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 977 | fi |
| 978 | } |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 979 | unset TEST_SUITE_NAME |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 980 | |
Gilles Peskine | 788ad33 | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 981 | # True if the presence of the given pattern in a log definitely indicates |
| 982 | # that the test has failed. False if the presence is inconclusive. |
| 983 | # |
| 984 | # Inputs: |
| 985 | # * $1: pattern found in the logs |
| 986 | # * $TIMES_LEFT: >0 if retrying is an option |
| 987 | # |
| 988 | # Outputs: |
| 989 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 990 | # unchanged otherwise. |
| 991 | # * Return value: 1 if the pattern is inconclusive, |
| 992 | # 0 if the failure is definitive. |
| 993 | log_pattern_presence_is_conclusive() { |
| 994 | # If we've run out of attempts, then don't retry no matter what. |
| 995 | if [ $TIMES_LEFT -eq 0 ]; then |
| 996 | return 0 |
| 997 | fi |
| 998 | case $1 in |
| 999 | "resend") |
| 1000 | # An undesired resend may have been caused by the OS dropping or |
| 1001 | # delaying a packet at an inopportune time. |
| 1002 | outcome="RETRY(resend)" |
| 1003 | return 1;; |
| 1004 | esac |
| 1005 | } |
| 1006 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1007 | # fail <message> |
| 1008 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1009 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 1010 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1011 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 1012 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1013 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1014 | if [ -n "$PXY_CMD" ]; then |
| 1015 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1016 | fi |
| 1017 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 1018 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 1019 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1020 | echo " ! server output:" |
| 1021 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1022 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1023 | echo " ! client output:" |
| 1024 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1025 | if [ -n "$PXY_CMD" ]; then |
| 1026 | echo " ! ========================================================" |
| 1027 | echo " ! proxy output:" |
| 1028 | cat o-pxy-${TESTS}.log |
| 1029 | fi |
| 1030 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 1031 | fi |
| 1032 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 1033 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1034 | } |
| 1035 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1036 | # is_polar <cmd_line> |
| 1037 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1038 | case "$1" in |
| 1039 | *ssl_client2*) true;; |
| 1040 | *ssl_server2*) true;; |
| 1041 | *) false;; |
| 1042 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1043 | } |
| 1044 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1045 | # openssl s_server doesn't have -www with DTLS |
| 1046 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1047 | case "$SRV_CMD" in |
| 1048 | *s_server*-dtls*) |
| 1049 | NEEDS_INPUT=1 |
| 1050 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 1051 | *) NEEDS_INPUT=0;; |
| 1052 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 1053 | } |
| 1054 | |
| 1055 | # provide input to commands that need it |
| 1056 | provide_input() { |
| 1057 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 1058 | return |
| 1059 | fi |
| 1060 | |
| 1061 | while true; do |
| 1062 | echo "HTTP/1.0 200 OK" |
| 1063 | sleep 1 |
| 1064 | done |
| 1065 | } |
| 1066 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1067 | # has_mem_err <log_file_name> |
| 1068 | has_mem_err() { |
| 1069 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 1070 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 1071 | then |
| 1072 | return 1 # false: does not have errors |
| 1073 | else |
| 1074 | return 0 # true: has errors |
| 1075 | fi |
| 1076 | } |
| 1077 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1078 | # 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] | 1079 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1080 | wait_app_start() { |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1081 | newline=' |
| 1082 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1083 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1084 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1085 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1086 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1087 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1088 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1089 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 58ed8a7 | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 1090 | while true; do |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1091 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1092 | # When we use a proxy, it will be listening on the same port we |
| 1093 | # 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] | 1094 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 5bd0b51 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 1095 | *${newline}${2}${newline}*) break;; |
Paul Elliott | e05e126 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 1096 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1097 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1098 | echo "$3 START TIMEOUT" |
| 1099 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1100 | break |
| 1101 | fi |
| 1102 | # Linux and *BSD support decimal arguments to sleep. On other |
| 1103 | # OSes this may be a tight loop. |
| 1104 | sleep 0.1 2>/dev/null || true |
| 1105 | done |
| 1106 | } |
| 1107 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1108 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 1109 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1110 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 1111 | } |
| 1112 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1113 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 1114 | # Wait for server process $2 to be listening on port $1. |
| 1115 | wait_server_start() { |
| 1116 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 1117 | } |
| 1118 | |
| 1119 | # Wait for proxy process $2 to be listening on port $1. |
| 1120 | wait_proxy_start() { |
| 1121 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 1122 | } |
| 1123 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1124 | # 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] | 1125 | # 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] | 1126 | # acceptable bounds |
| 1127 | check_server_hello_time() { |
| 1128 | # 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] | 1129 | 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] | 1130 | # Get the Unix timestamp for now |
| 1131 | CUR_TIME=$(date +'%s') |
| 1132 | THRESHOLD_IN_SECS=300 |
| 1133 | |
| 1134 | # Check if the ServerHello time was printed |
| 1135 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 1136 | return 1 |
| 1137 | fi |
| 1138 | |
| 1139 | # Check the time in ServerHello is within acceptable bounds |
| 1140 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 1141 | # The time in ServerHello is at least 5 minutes before now |
| 1142 | return 1 |
| 1143 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 1144 | # 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] | 1145 | return 1 |
| 1146 | else |
| 1147 | return 0 |
| 1148 | fi |
| 1149 | } |
| 1150 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1151 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 1152 | handshake_memory_get() { |
| 1153 | OUTPUT_VARIABLE="$1" |
| 1154 | OUTPUT_FILE="$2" |
| 1155 | |
| 1156 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 1157 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 1158 | |
| 1159 | # Check if memory usage was read |
| 1160 | if [ -z "$MEM_USAGE" ]; then |
| 1161 | echo "Error: Can not read the value of handshake memory usage" |
| 1162 | return 1 |
| 1163 | else |
| 1164 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 1165 | return 0 |
| 1166 | fi |
| 1167 | } |
| 1168 | |
| 1169 | # Get handshake memory usage from server or client output and check if this value |
| 1170 | # is not higher than the maximum given by the first argument |
| 1171 | handshake_memory_check() { |
| 1172 | MAX_MEMORY="$1" |
| 1173 | OUTPUT_FILE="$2" |
| 1174 | |
| 1175 | # Get memory usage |
| 1176 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 1177 | return 1 |
| 1178 | fi |
| 1179 | |
| 1180 | # Check if memory usage is below max value |
| 1181 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 1182 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 1183 | "but should be below $MAX_MEMORY bytes" |
| 1184 | return 1 |
| 1185 | else |
| 1186 | return 0 |
| 1187 | fi |
| 1188 | } |
| 1189 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1190 | # wait for client to terminate and set CLI_EXIT |
| 1191 | # must be called right after starting the client |
| 1192 | wait_client_done() { |
| 1193 | CLI_PID=$! |
| 1194 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1195 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 1196 | CLI_DELAY_FACTOR=1 |
| 1197 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1198 | ( 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] | 1199 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1200 | |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1201 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
| 1202 | # To remove it from stdout, redirect stdout/stderr to CLI_OUT |
| 1203 | wait $CLI_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1204 | CLI_EXIT=$? |
| 1205 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1206 | kill $DOG_PID >/dev/null 2>&1 |
Jerry Yu | fe52e55 | 2022-07-09 04:23:43 +0000 | [diff] [blame] | 1207 | wait $DOG_PID >> $CLI_OUT 2>&1 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1208 | |
| 1209 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1210 | |
| 1211 | sleep $SRV_DELAY_SECONDS |
| 1212 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 1213 | } |
| 1214 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1215 | # check if the given command uses dtls and sets global variable DTLS |
| 1216 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1217 | case "$1" in |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 1218 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 1219 | *) DTLS=0;; |
| 1220 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1221 | } |
| 1222 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1223 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 1224 | is_gnutls() { |
| 1225 | case "$1" in |
| 1226 | *gnutls-cli*) |
| 1227 | CMD_IS_GNUTLS=1 |
| 1228 | ;; |
| 1229 | *gnutls-serv*) |
| 1230 | CMD_IS_GNUTLS=1 |
| 1231 | ;; |
| 1232 | *) |
| 1233 | CMD_IS_GNUTLS=0 |
| 1234 | ;; |
| 1235 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1236 | } |
| 1237 | |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 1238 | # Some external tools (gnutls or openssl) might not have support for static ECDH |
| 1239 | # 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] | 1240 | # and client command lines, given as input, to verify if the current test |
| 1241 | # is using one of these tools. |
| 1242 | use_ext_tool_without_ecdh_support() { |
| 1243 | case "$1" in |
| 1244 | *$GNUTLS_SERV*|\ |
| 1245 | *${GNUTLS_NEXT_SERV:-"gnutls-serv-dummy"}*|\ |
| 1246 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1247 | echo "yes" |
| 1248 | return;; |
| 1249 | esac |
| 1250 | case "$2" in |
| 1251 | *$GNUTLS_CLI*|\ |
| 1252 | *${GNUTLS_NEXT_CLI:-"gnutls-cli-dummy"}*|\ |
| 1253 | *${OPENSSL_NEXT:-"openssl-dummy"}*) |
| 1254 | echo "yes" |
| 1255 | return;; |
| 1256 | esac |
| 1257 | echo "no" |
| 1258 | } |
| 1259 | |
Jerry Yu | f467d46 | 2022-11-07 13:12:44 +0800 | [diff] [blame] | 1260 | # Generate random psk_list argument for ssl_server2 |
| 1261 | get_srv_psk_list () |
| 1262 | { |
| 1263 | case $(( TESTS % 3 )) in |
| 1264 | 0) echo "psk_list=abc,dead,def,beef,Client_identity,6162636465666768696a6b6c6d6e6f70";; |
| 1265 | 1) echo "psk_list=abc,dead,Client_identity,6162636465666768696a6b6c6d6e6f70,def,beef";; |
| 1266 | 2) echo "psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70,abc,dead,def,beef";; |
| 1267 | esac |
| 1268 | } |
| 1269 | |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1270 | # Determine what calc_verify trace is to be expected, if any. |
| 1271 | # |
| 1272 | # calc_verify is only called for two things: to calculate the |
| 1273 | # extended master secret, and to process client authentication. |
| 1274 | # |
| 1275 | # Warning: the current implementation assumes that extended_ms is not |
| 1276 | # disabled on the client or on the server. |
| 1277 | # |
| 1278 | # Inputs: |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1279 | # * $1: the value of the server auth_mode parameter. |
| 1280 | # 'required' if client authentication is expected, |
| 1281 | # 'none' or absent if not. |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1282 | # * $CONFIGS_ENABLED |
| 1283 | # |
| 1284 | # Outputs: |
| 1285 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 1286 | set_maybe_calc_verify() { |
| 1287 | maybe_calc_verify= |
| 1288 | case $CONFIGS_ENABLED in |
| 1289 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 1290 | *) |
| 1291 | case ${1-} in |
Gilles Peskine | c8d242f | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 1292 | ''|none) return;; |
| 1293 | required) :;; |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1294 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 1295 | esac |
| 1296 | esac |
| 1297 | case $CONFIGS_ENABLED in |
| 1298 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 1299 | *) maybe_calc_verify="<= calc verify";; |
| 1300 | esac |
| 1301 | } |
| 1302 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1303 | # Compare file content |
| 1304 | # Usage: find_in_both pattern file1 file2 |
| 1305 | # extract from file1 the first line matching the pattern |
| 1306 | # check in file2 that the same line can be found |
| 1307 | find_in_both() { |
| 1308 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 1309 | if [ -z "$srv_pattern" ]; then |
| 1310 | return 1; |
| 1311 | fi |
| 1312 | |
| 1313 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 1314 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1315 | else |
| 1316 | return 1; |
| 1317 | fi |
| 1318 | } |
| 1319 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1320 | SKIP_HANDSHAKE_CHECK="NO" |
| 1321 | skip_handshake_stage_check() { |
| 1322 | SKIP_HANDSHAKE_CHECK="YES" |
| 1323 | } |
| 1324 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1325 | # Analyze the commands that will be used in a test. |
| 1326 | # |
| 1327 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 1328 | # extra arguments or go through wrappers. |
Gilles Peskine | 59601d7 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 1329 | # |
| 1330 | # Inputs: |
| 1331 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 1332 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 1333 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 1334 | # |
| 1335 | # Outputs: |
| 1336 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1337 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1338 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 1339 | # 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] | 1340 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1341 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 1342 | case " $SRV_CMD " in |
| 1343 | *' server_addr=::1 '*) |
| 1344 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 1345 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 1346 | fi |
| 1347 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 1348 | # update CMD_IS_GNUTLS variable |
| 1349 | is_gnutls "$SRV_CMD" |
| 1350 | |
| 1351 | # if the server uses gnutls but doesn't set priority, explicitly |
| 1352 | # set the default priority |
| 1353 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1354 | case "$SRV_CMD" in |
| 1355 | *--priority*) :;; |
| 1356 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 1357 | esac |
| 1358 | fi |
| 1359 | |
| 1360 | # update CMD_IS_GNUTLS variable |
| 1361 | is_gnutls "$CLI_CMD" |
| 1362 | |
| 1363 | # if the client uses gnutls but doesn't set priority, explicitly |
| 1364 | # set the default priority |
| 1365 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 1366 | case "$CLI_CMD" in |
| 1367 | *--priority*) :;; |
| 1368 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 1369 | esac |
| 1370 | fi |
| 1371 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1372 | # fix client port |
| 1373 | if [ -n "$PXY_CMD" ]; then |
| 1374 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 1375 | else |
| 1376 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 1377 | fi |
| 1378 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1379 | # prepend valgrind to our commands if active |
| 1380 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1381 | if is_polar "$SRV_CMD"; then |
| 1382 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 1383 | fi |
| 1384 | if is_polar "$CLI_CMD"; then |
| 1385 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 1386 | fi |
| 1387 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1388 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1389 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1390 | # Check for failure conditions after a test case. |
| 1391 | # |
| 1392 | # Inputs from run_test: |
| 1393 | # * positional parameters: test options (see run_test documentation) |
| 1394 | # * $CLI_EXIT: client return code |
| 1395 | # * $CLI_EXPECT: expected client return code |
| 1396 | # * $SRV_RET: server return code |
| 1397 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1398 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1399 | # |
| 1400 | # Outputs: |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1401 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1402 | check_test_failure() { |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1403 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1404 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1405 | if [ $TIMES_LEFT -gt 0 ] && |
| 1406 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 1407 | then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1408 | outcome="RETRY(client-timeout)" |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1409 | return |
| 1410 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 1411 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1412 | # 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] | 1413 | # (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] | 1414 | # expected client exit to incorrectly succeed in case of catastrophic |
| 1415 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1416 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 1417 | then |
| 1418 | if is_polar "$SRV_CMD"; then |
| 1419 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 1420 | else |
| 1421 | fail "server or client failed to reach handshake stage" |
| 1422 | return |
| 1423 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1424 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1425 | if is_polar "$CLI_CMD"; then |
| 1426 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 1427 | else |
| 1428 | fail "server or client failed to reach handshake stage" |
| 1429 | return |
| 1430 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 1431 | fi |
| 1432 | fi |
| 1433 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 1434 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1435 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1436 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1437 | # care anyway), in case e.g. the server reports a memory leak. |
| 1438 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1439 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1440 | return |
| 1441 | fi |
| 1442 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1443 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1444 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1445 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1446 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1447 | 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] | 1448 | return |
| 1449 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1450 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1451 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1452 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1453 | # 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] | 1454 | while [ $# -gt 0 ] |
| 1455 | do |
| 1456 | case $1 in |
| 1457 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1458 | 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] | 1459 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1460 | return |
| 1461 | fi |
| 1462 | ;; |
| 1463 | |
| 1464 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1465 | 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] | 1466 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1467 | return |
| 1468 | fi |
| 1469 | ;; |
| 1470 | |
| 1471 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1472 | 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] | 1473 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1474 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1475 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1476 | return |
| 1477 | fi |
| 1478 | ;; |
| 1479 | |
| 1480 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1481 | 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] | 1482 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1483 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1484 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1485 | return |
| 1486 | fi |
| 1487 | ;; |
| 1488 | |
| 1489 | # The filtering in the following two options (-u and -U) do the following |
| 1490 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1491 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1492 | # - keep one of each non-unique line |
| 1493 | # - count how many lines remain |
| 1494 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1495 | # if there were no duplicates. |
| 1496 | "-U") |
| 1497 | 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 |
| 1498 | fail "lines following pattern '$2' must be unique in Server output" |
| 1499 | return |
| 1500 | fi |
| 1501 | ;; |
| 1502 | |
| 1503 | "-u") |
| 1504 | 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 |
| 1505 | 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] | 1506 | return |
| 1507 | fi |
| 1508 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1509 | "-F") |
| 1510 | if ! $2 "$SRV_OUT"; then |
| 1511 | fail "function call to '$2' failed on Server output" |
| 1512 | return |
| 1513 | fi |
| 1514 | ;; |
| 1515 | "-f") |
| 1516 | if ! $2 "$CLI_OUT"; then |
| 1517 | fail "function call to '$2' failed on Client output" |
| 1518 | return |
| 1519 | fi |
| 1520 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1521 | "-g") |
| 1522 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1523 | fail "function call to '$2' failed on Server and Client output" |
| 1524 | return |
| 1525 | fi |
| 1526 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1527 | |
| 1528 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1529 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1530 | exit 1 |
| 1531 | esac |
| 1532 | shift 2 |
| 1533 | done |
| 1534 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1535 | # check valgrind's results |
| 1536 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1537 | 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] | 1538 | fail "Server has memory errors" |
| 1539 | return |
| 1540 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1541 | 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] | 1542 | fail "Client has memory errors" |
| 1543 | return |
| 1544 | fi |
| 1545 | fi |
| 1546 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1547 | # if we're here, everything is ok |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1548 | outcome=PASS |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1549 | } |
| 1550 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1551 | # Run the current test case: start the server and if applicable the proxy, run |
| 1552 | # the client, wait for all processes to finish or time out. |
| 1553 | # |
| 1554 | # Inputs: |
| 1555 | # * $NAME: test case name |
| 1556 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1557 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1558 | # |
| 1559 | # Outputs: |
| 1560 | # * $CLI_EXIT: client return code |
| 1561 | # * $SRV_RET: server return code |
| 1562 | do_run_test_once() { |
| 1563 | # run the commands |
| 1564 | if [ -n "$PXY_CMD" ]; then |
| 1565 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1566 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1567 | PXY_PID=$! |
| 1568 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1569 | fi |
| 1570 | |
| 1571 | check_osrv_dtls |
| 1572 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1573 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1574 | SRV_PID=$! |
| 1575 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1576 | |
| 1577 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | 140b589 | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1578 | # The client must be a subprocess of the script in order for killing it to |
| 1579 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1580 | # not at the end of the line: the latter approach will spawn eval as a |
| 1581 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1582 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1583 | wait_client_done |
| 1584 | |
| 1585 | sleep 0.05 |
| 1586 | |
| 1587 | # terminate the server (and the proxy) |
| 1588 | kill $SRV_PID |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1589 | # For Ubuntu 22.04, `Terminated` message is outputed by wait command. |
Jerry Yu | 27d8092 | 2022-08-02 21:28:55 +0800 | [diff] [blame] | 1590 | # To remove it from stdout, redirect stdout/stderr to SRV_OUT |
Jerry Yu | d2d4110 | 2022-07-26 17:34:42 +0800 | [diff] [blame] | 1591 | wait $SRV_PID >> $SRV_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1592 | SRV_RET=$? |
| 1593 | |
| 1594 | if [ -n "$PXY_CMD" ]; then |
| 1595 | kill $PXY_PID >/dev/null 2>&1 |
Jerry Yu | 6969eee | 2022-10-10 10:25:26 +0800 | [diff] [blame] | 1596 | wait $PXY_PID >> $PXY_OUT 2>&1 |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1597 | fi |
| 1598 | } |
| 1599 | |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1600 | # 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] | 1601 | # $1 and $2 contain the server and client command lines, respectively. |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1602 | # |
| 1603 | # Note: this function only provides some guess about TLS version by simply |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1604 | # looking at the server/client command lines. Even though this works |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1605 | # for the sake of tests' filtering (especially in conjunction with the |
| 1606 | # detect_required_features() function), it does NOT guarantee that the |
| 1607 | # result is accurate. It does not check other conditions, such as: |
Valerio Setti | 213c4ea | 2023-03-07 19:29:57 +0100 | [diff] [blame] | 1608 | # - we can force a ciphersuite which contains "WITH" in its name, meaning |
| 1609 | # that we are going to use TLS 1.2 |
| 1610 | # - etc etc |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1611 | get_tls_version() { |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1612 | # First check if the version is forced on an Mbed TLS peer |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1613 | case $1 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1614 | *tls12*) |
| 1615 | echo "TLS12" |
| 1616 | return;; |
| 1617 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1618 | echo "TLS13" |
| 1619 | return;; |
| 1620 | esac |
| 1621 | case $2 in |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1622 | *tls12*) |
| 1623 | echo "TLS12" |
| 1624 | return;; |
| 1625 | *tls13*) |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1626 | echo "TLS13" |
| 1627 | return;; |
| 1628 | esac |
Ronald Cron | 097ba14 | 2023-03-08 16:18:00 +0100 | [diff] [blame] | 1629 | # Second check if the version is forced on an OpenSSL or GnuTLS peer |
| 1630 | case $1 in |
| 1631 | tls1_2*) |
| 1632 | echo "TLS12" |
| 1633 | return;; |
| 1634 | *tls1_3) |
| 1635 | echo "TLS13" |
| 1636 | return;; |
| 1637 | esac |
| 1638 | case $2 in |
| 1639 | *tls1_2) |
| 1640 | echo "TLS12" |
| 1641 | return;; |
| 1642 | *tls1_3) |
| 1643 | echo "TLS13" |
| 1644 | return;; |
| 1645 | esac |
| 1646 | # Third if the version is not forced, if TLS 1.3 is enabled then the test |
| 1647 | # is aimed to run a TLS 1.3 handshake. |
| 1648 | if $P_QUERY -all MBEDTLS_SSL_PROTO_TLS1_3 |
| 1649 | then |
| 1650 | echo "TLS13" |
| 1651 | else |
| 1652 | echo "TLS12" |
| 1653 | fi |
Valerio Setti | 1af76d1 | 2023-02-23 15:55:10 +0100 | [diff] [blame] | 1654 | } |
| 1655 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1656 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1657 | # Options: -s pattern pattern that must be present in server output |
| 1658 | # -c pattern pattern that must be present in client output |
| 1659 | # -u pattern lines after pattern must be unique in client output |
| 1660 | # -f call shell function on client output |
| 1661 | # -S pattern pattern that must be absent in server output |
| 1662 | # -C pattern pattern that must be absent in client output |
| 1663 | # -U pattern lines after pattern must be unique in server output |
| 1664 | # -F call shell function on server output |
| 1665 | # -g call shell function on server and client output |
| 1666 | run_test() { |
| 1667 | NAME="$1" |
| 1668 | shift 1 |
| 1669 | |
Tomás González | 787428a | 2023-08-23 15:27:19 +0100 | [diff] [blame] | 1670 | if is_excluded "$NAME"; then |
| 1671 | SKIP_NEXT="NO" |
| 1672 | # There was no request to run the test, so don't record its outcome. |
| 1673 | return |
| 1674 | fi |
| 1675 | |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1676 | if [ "$LIST_TESTS" -gt 0 ]; then |
Pengyu Lv | 3c170d3 | 2023-11-29 13:53:34 +0800 | [diff] [blame] | 1677 | printf "%s\n" "${TEST_SUITE_NAME:-ssl-opt};$NAME" |
Tomás González | 37a8739 | 2023-09-01 11:25:44 +0100 | [diff] [blame] | 1678 | return |
| 1679 | fi |
| 1680 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 1681 | # Use ssl-opt as default test suite name. Also see record_outcome function |
| 1682 | if is_excluded_test_suite "${TEST_SUITE_NAME:-ssl-opt}"; then |
| 1683 | # Do not skip next test and skip current test. |
| 1684 | SKIP_NEXT="NO" |
| 1685 | return |
| 1686 | fi |
| 1687 | |
Tomás González | 51cb704 | 2023-09-07 10:21:19 +0100 | [diff] [blame] | 1688 | print_name "$NAME" |
| 1689 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1690 | # Do we only run numbered tests? |
| 1691 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1692 | case ",$RUN_TEST_NUMBER," in |
| 1693 | *",$TESTS,"*) :;; |
| 1694 | *) SKIP_NEXT="YES";; |
| 1695 | esac |
| 1696 | fi |
| 1697 | |
| 1698 | # does this test use a proxy? |
| 1699 | if [ "X$1" = "X-p" ]; then |
| 1700 | PXY_CMD="$2" |
| 1701 | shift 2 |
| 1702 | else |
| 1703 | PXY_CMD="" |
| 1704 | fi |
| 1705 | |
| 1706 | # get commands and client output |
| 1707 | SRV_CMD="$1" |
| 1708 | CLI_CMD="$2" |
| 1709 | CLI_EXPECT="$3" |
| 1710 | shift 3 |
| 1711 | |
| 1712 | # Check if test uses files |
| 1713 | case "$SRV_CMD $CLI_CMD" in |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1714 | *$DATA_FILES_PATH/*) |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1715 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1716 | esac |
| 1717 | |
Gilles Peskine | 82a4ab2 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1718 | # Check if the test uses DTLS. |
| 1719 | detect_dtls "$SRV_CMD" |
| 1720 | if [ "$DTLS" -eq 1 ]; then |
| 1721 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1722 | fi |
| 1723 | |
Yanray Wang | 7b320fa | 2023-11-08 10:33:30 +0800 | [diff] [blame] | 1724 | # Check if we are trying to use an external tool which does not support ECDH |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1725 | EXT_WO_ECDH=$(use_ext_tool_without_ecdh_support "$SRV_CMD" "$CLI_CMD") |
| 1726 | |
Valerio Setti | 726ffbf | 2023-08-02 20:02:44 +0200 | [diff] [blame] | 1727 | # Guess the TLS version which is going to be used |
| 1728 | if [ "$EXT_WO_ECDH" = "no" ]; then |
| 1729 | TLS_VERSION=$(get_tls_version "$SRV_CMD" "$CLI_CMD") |
| 1730 | else |
| 1731 | TLS_VERSION="TLS12" |
| 1732 | fi |
| 1733 | |
| 1734 | # 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] | 1735 | # from their command-line arguments, check whether they're enabled. |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 1736 | detect_required_features "$SRV_CMD" "server" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
| 1737 | detect_required_features "$CLI_CMD" "client" "$TLS_VERSION" "$EXT_WO_ECDH" "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1738 | |
Gilles Peskine | 6e86e54 | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1739 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1740 | maybe_adapt_for_psk "$@" |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1741 | |
| 1742 | # should we skip? |
| 1743 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1744 | SKIP_NEXT="NO" |
| 1745 | record_outcome "SKIP" |
| 1746 | SKIPS=$(( $SKIPS + 1 )) |
| 1747 | return |
| 1748 | fi |
| 1749 | |
| 1750 | analyze_test_commands "$@" |
| 1751 | |
Andrzej Kurek | 8db7c0e | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1752 | # One regular run and two retries |
| 1753 | TIMES_LEFT=3 |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1754 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1755 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1756 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1757 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1758 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1759 | check_test_failure "$@" |
| 1760 | case $outcome in |
| 1761 | PASS) break;; |
Gilles Peskine | f11d30e | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1762 | RETRY*) printf "$outcome ";; |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1763 | FAIL) return;; |
| 1764 | esac |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1765 | done |
| 1766 | |
Gilles Peskine | 0e3534c | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1767 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1768 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1769 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1770 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1771 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1772 | if [ -n "$PXY_CMD" ]; then |
| 1773 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1774 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1775 | fi |
| 1776 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1777 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1778 | } |
| 1779 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1780 | run_test_psa() { |
| 1781 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1782 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1783 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1784 | "$P_SRV debug_level=3 force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1785 | "$P_CLI debug_level=3 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1786 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1787 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1788 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1789 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1790 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1791 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1792 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1793 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1794 | -S "error" \ |
| 1795 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1796 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1797 | } |
| 1798 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1799 | run_test_psa_force_curve() { |
| 1800 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1801 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1802 | run_test "PSA - ECDH with $1" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 1803 | "$P_SRV debug_level=4 force_version=tls12 groups=$1" \ |
| 1804 | "$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] | 1805 | 0 \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1806 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1807 | -c "calc PSA finished" \ |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1808 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1809 | -s "calc PSA finished" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1810 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1811 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1812 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1813 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1814 | -C "error" |
Gilles Peskine | 309ca65 | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1815 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1816 | } |
| 1817 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1818 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1819 | # a maximum fragment length. |
| 1820 | # first argument ($1) is MFL for SSL client |
| 1821 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1822 | run_test_memory_after_handshake_with_mfl() |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1823 | { |
| 1824 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1825 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1826 | |
| 1827 | # Leave some margin for robustness |
| 1828 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1829 | |
| 1830 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1831 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1832 | "$P_CLI debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1833 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1834 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1835 | 0 \ |
| 1836 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1837 | } |
| 1838 | |
| 1839 | |
| 1840 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1841 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1842 | run_tests_memory_after_handshake() |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1843 | { |
| 1844 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1845 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1846 | |
| 1847 | # first test with default MFU is to get reference memory usage |
| 1848 | MEMORY_USAGE_MFL_16K=0 |
| 1849 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1850 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 1851 | "$P_CLI debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 1852 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1853 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1854 | 0 \ |
| 1855 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1856 | |
| 1857 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1858 | run_test_memory_after_handshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1859 | |
| 1860 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1861 | run_test_memory_after_handshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1862 | |
| 1863 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1864 | run_test_memory_after_handshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1865 | |
| 1866 | SKIP_NEXT="$SKIP_THIS_TESTS" |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 1867 | run_test_memory_after_handshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1868 | } |
| 1869 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1870 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1871 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1872 | rm -f context_srv.txt |
| 1873 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1874 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1875 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1876 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1877 | 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] | 1878 | exit 1 |
| 1879 | } |
| 1880 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1881 | # |
| 1882 | # MAIN |
| 1883 | # |
| 1884 | |
Yanray Wang | 5b33f64 | 2023-02-28 11:56:59 +0800 | [diff] [blame] | 1885 | # Make the outcome file path relative to the original directory, not |
| 1886 | # to .../tests |
| 1887 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 1888 | [!/]*) |
| 1889 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 1890 | ;; |
| 1891 | esac |
| 1892 | |
Andrzej Kurek | 9c061a2 | 2022-09-05 10:51:19 -0400 | [diff] [blame] | 1893 | populate_enabled_hash_algs |
| 1894 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1895 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1896 | # patterns rather than regular expressions, use a case statement instead |
| 1897 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1898 | # detects simple cases: plain substring, everything, nothing. |
| 1899 | # |
| 1900 | # As an exception, the character '.' is treated as an ordinary character |
| 1901 | # if it is the only special character in the string. This is because it's |
| 1902 | # rare to need "any one character", but needing a literal '.' is common |
| 1903 | # (e.g. '-f "DTLS 1.2"'). |
| 1904 | need_grep= |
| 1905 | case "$FILTER" in |
| 1906 | '^$') simple_filter=;; |
| 1907 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1908 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1909 | need_grep=1;; |
| 1910 | *) # No regexp or shell-pattern special character |
| 1911 | simple_filter="*$FILTER*";; |
| 1912 | esac |
| 1913 | case "$EXCLUDE" in |
| 1914 | '^$') simple_exclude=;; |
| 1915 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1916 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1917 | need_grep=1;; |
| 1918 | *) # No regexp or shell-pattern special character |
| 1919 | simple_exclude="*$EXCLUDE*";; |
| 1920 | esac |
| 1921 | if [ -n "$need_grep" ]; then |
| 1922 | is_excluded () { |
| 1923 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1924 | } |
| 1925 | else |
| 1926 | is_excluded () { |
| 1927 | case "$1" in |
| 1928 | $simple_exclude) true;; |
| 1929 | $simple_filter) false;; |
| 1930 | *) true;; |
| 1931 | esac |
| 1932 | } |
| 1933 | fi |
| 1934 | |
Jerry Yu | 50d07bd | 2023-11-06 10:49:01 +0800 | [diff] [blame] | 1935 | # Filter tests according to TEST_SUITE_NAME |
| 1936 | is_excluded_test_suite () { |
| 1937 | if [ -n "$RUN_TEST_SUITE" ] |
| 1938 | then |
| 1939 | case ",$RUN_TEST_SUITE," in |
| 1940 | *",$1,"*) false;; |
| 1941 | *) true;; |
| 1942 | esac |
| 1943 | else |
| 1944 | false |
| 1945 | fi |
| 1946 | |
| 1947 | } |
| 1948 | |
| 1949 | |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 1950 | if [ "$LIST_TESTS" -eq 0 ];then |
| 1951 | |
| 1952 | # sanity checks, avoid an avalanche of errors |
| 1953 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1954 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1955 | P_PXY_BIN="${P_PXY%%[ ]*}" |
| 1956 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1957 | echo "Command '$P_SRV_BIN' is not an executable file" |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1958 | exit 1 |
| 1959 | fi |
Tomás González | 06956a1 | 2023-08-23 15:46:20 +0100 | [diff] [blame] | 1960 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1961 | echo "Command '$P_CLI_BIN' is not an executable file" |
| 1962 | exit 1 |
| 1963 | fi |
| 1964 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1965 | echo "Command '$P_PXY_BIN' is not an executable file" |
| 1966 | exit 1 |
| 1967 | fi |
| 1968 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1969 | if which valgrind >/dev/null 2>&1; then :; else |
| 1970 | echo "Memcheck not possible. Valgrind not found" |
| 1971 | exit 1 |
| 1972 | fi |
| 1973 | fi |
| 1974 | if which $OPENSSL >/dev/null 2>&1; then :; else |
| 1975 | echo "Command '$OPENSSL' not found" |
| 1976 | exit 1 |
| 1977 | fi |
| 1978 | |
| 1979 | # used by watchdog |
| 1980 | MAIN_PID="$$" |
| 1981 | |
| 1982 | # We use somewhat arbitrary delays for tests: |
| 1983 | # - how long do we wait for the server to start (when lsof not available)? |
| 1984 | # - how long do we allow for the client to finish? |
| 1985 | # (not to check performance, just to avoid waiting indefinitely) |
| 1986 | # Things are slower with valgrind, so give extra time here. |
| 1987 | # |
| 1988 | # Note: without lsof, there is a trade-off between the running time of this |
| 1989 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1990 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1991 | # the script, only the case where a client or server gets stuck. |
| 1992 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1993 | START_DELAY=6 |
| 1994 | DOG_DELAY=60 |
| 1995 | else |
| 1996 | START_DELAY=2 |
| 1997 | DOG_DELAY=20 |
| 1998 | fi |
| 1999 | |
| 2000 | # some particular tests need more time: |
| 2001 | # - for the client, we multiply the usual watchdog limit by a factor |
| 2002 | # - for the server, we sleep for a number of seconds after the client exits |
| 2003 | # see client_need_more_time() and server_needs_more_time() |
| 2004 | CLI_DELAY_FACTOR=1 |
| 2005 | SRV_DELAY_SECONDS=0 |
| 2006 | |
| 2007 | # fix commands to use this port, force IPv4 while at it |
| 2008 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
| 2009 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 2010 | # machines that will resolve to ::1, and we don't want ipv6 here. |
| 2011 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 2012 | P_CLI="$P_CLI server_addr=127.0.0.1 server_port=+SRV_PORT" |
| 2013 | 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"}" |
| 2014 | O_SRV="$O_SRV -accept $SRV_PORT" |
| 2015 | O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2016 | G_SRV="$G_SRV -p $SRV_PORT" |
| 2017 | G_CLI="$G_CLI -p +SRV_PORT" |
| 2018 | |
| 2019 | # Newer versions of OpenSSL have a syntax to enable all "ciphers", even |
| 2020 | # low-security ones. This covers not just cipher suites but also protocol |
| 2021 | # versions. It is necessary, for example, to use (D)TLS 1.0/1.1 on |
| 2022 | # OpenSSL 1.1.1f from Ubuntu 20.04. The syntax was only introduced in |
| 2023 | # OpenSSL 1.1.0 (21e0c1d23afff48601eb93135defddae51f7e2e3) and I can't find |
| 2024 | # a way to discover it from -help, so check the openssl version. |
| 2025 | case $($OPENSSL version) in |
| 2026 | "OpenSSL 0"*|"OpenSSL 1.0"*) :;; |
| 2027 | *) |
| 2028 | O_CLI="$O_CLI -cipher ALL@SECLEVEL=0" |
| 2029 | O_SRV="$O_SRV -cipher ALL@SECLEVEL=0" |
| 2030 | ;; |
| 2031 | esac |
| 2032 | |
| 2033 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 2034 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
| 2035 | O_NEXT_SRV_NO_CERT="$O_NEXT_SRV_NO_CERT -accept $SRV_PORT" |
| 2036 | O_NEXT_SRV_EARLY_DATA="$O_NEXT_SRV_EARLY_DATA -accept $SRV_PORT" |
| 2037 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
| 2038 | O_NEXT_CLI_NO_CERT="$O_NEXT_CLI_NO_CERT -connect 127.0.0.1:+SRV_PORT" |
| 2039 | fi |
| 2040 | |
| 2041 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
| 2042 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 2043 | G_NEXT_SRV_NO_CERT="$G_NEXT_SRV_NO_CERT -p $SRV_PORT" |
| 2044 | fi |
| 2045 | |
| 2046 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
| 2047 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
| 2048 | G_NEXT_CLI_NO_CERT="$G_NEXT_CLI_NO_CERT -p +SRV_PORT localhost" |
| 2049 | fi |
| 2050 | |
| 2051 | # Allow SHA-1, because many of our test certificates use it |
| 2052 | P_SRV="$P_SRV allow_sha1=1" |
| 2053 | P_CLI="$P_CLI allow_sha1=1" |
| 2054 | |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 2055 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2056 | # Also pick a unique name for intermediate files |
| 2057 | SRV_OUT="srv_out.$$" |
| 2058 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 2059 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2060 | SESSION="session.$$" |
| 2061 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 2062 | SKIP_NEXT="NO" |
| 2063 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 2064 | trap cleanup INT TERM HUP |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 2065 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2066 | # Basic test |
| 2067 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2068 | # Checks that: |
| 2069 | # - 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] | 2070 | # - the expected parameters are selected |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2071 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2072 | requires_hash_alg SHA_512 # "signature_algorithm ext: 6" |
Valerio Setti | 482a0b9 | 2023-08-18 15:55:10 +0200 | [diff] [blame] | 2073 | requires_any_configs_enabled "MBEDTLS_ECP_DP_CURVE25519_ENABLED \ |
| 2074 | PSA_WANT_ECC_MONTGOMERY_255" |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2075 | run_test "Default, TLS 1.2" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2076 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2077 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2078 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2079 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2080 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2081 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 2082 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 2083 | -S "error" \ |
| 2084 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 2085 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2086 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 3561526 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 2087 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2088 | run_test "Default, DTLS" \ |
| 2089 | "$P_SRV dtls=1" \ |
| 2090 | "$P_CLI dtls=1" \ |
| 2091 | 0 \ |
| 2092 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 2093 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 2094 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 2095 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 2096 | run_test "TLS client auth: required" \ |
| 2097 | "$P_SRV auth_mode=required" \ |
| 2098 | "$P_CLI" \ |
| 2099 | 0 \ |
| 2100 | -s "Verifying peer X.509 certificate... ok" |
| 2101 | |
Glenn Strauss | 6eef563 | 2022-01-23 08:37:02 -0500 | [diff] [blame] | 2102 | run_test "key size: TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2103 | "$P_SRV" \ |
| 2104 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2105 | 0 \ |
| 2106 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2107 | -c "Key size is 256" |
| 2108 | |
| 2109 | run_test "key size: TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2110 | "$P_SRV" \ |
| 2111 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2112 | 0 \ |
| 2113 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2114 | -c "Key size is 128" |
| 2115 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2116 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2117 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2118 | # module does not support PSA dispatching so we need builtin support. |
| 2119 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2120 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2121 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2122 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2123 | run_test "TLS: password protected client key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2124 | "$P_SRV force_version=tls12 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2125 | "$P_CLI crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key.enc key_pwd=PolarSSLTest" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2126 | 0 |
| 2127 | |
| 2128 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2129 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2130 | # module does not support PSA dispatching so we need builtin support. |
| 2131 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2132 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2133 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2134 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2135 | run_test "TLS: password protected server key" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2136 | "$P_SRV crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key.enc key_pwd=PolarSSLTest" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2137 | "$P_CLI force_version=tls12" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2138 | 0 |
| 2139 | |
| 2140 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2141 | requires_config_enabled MBEDTLS_RSA_C |
Valerio Setti | dd43d7b | 2023-11-09 14:10:51 +0100 | [diff] [blame] | 2142 | # server5.key.enc is in PEM format and AES-256-CBC crypted. Unfortunately PEM |
| 2143 | # module does not support PSA dispatching so we need builtin support. |
| 2144 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 2145 | requires_config_enabled MBEDTLS_AES_C |
Sam Berry | 06b91be | 2024-06-19 11:43:03 +0100 | [diff] [blame] | 2146 | requires_hash_alg MD5 |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2147 | requires_hash_alg SHA_256 |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2148 | run_test "TLS: password protected server key, two certificates" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2149 | "$P_SRV force_version=tls12\ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2150 | key_file=$DATA_FILES_PATH/server5.key.enc key_pwd=PolarSSLTest crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2151 | key_file2=$DATA_FILES_PATH/server2.key.enc key_pwd2=PolarSSLTest crt_file2=$DATA_FILES_PATH/server2.crt" \ |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 2152 | "$P_CLI" \ |
| 2153 | 0 |
| 2154 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2155 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2156 | run_test "CA callback on client" \ |
| 2157 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2158 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 " \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2159 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2160 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2161 | -S "error" \ |
| 2162 | -C "error" |
| 2163 | |
| 2164 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 2165 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2166 | requires_hash_alg SHA_256 |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2167 | run_test "CA callback on server" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2168 | "$P_SRV force_version=tls12 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2169 | "$P_CLI ca_callback=1 debug_level=3 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2170 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2171 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 2172 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 2173 | -s "Verifying peer X.509 certificate... ok" \ |
| 2174 | -S "error" \ |
| 2175 | -C "error" |
| 2176 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2177 | # Test using an EC opaque private key for client authentication |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2178 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2179 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2180 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2181 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2182 | run_test "Opaque key for client authentication: ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2183 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2184 | key_file=$DATA_FILES_PATH/server5.key" \ |
| 2185 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2186 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2187 | 0 \ |
| 2188 | -c "key type: Opaque" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2189 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2190 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2191 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 2192 | -S "error" \ |
| 2193 | -C "error" |
| 2194 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2195 | # Test using a RSA opaque private key for client authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2196 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2197 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2198 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2199 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2200 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2201 | run_test "Opaque key for client authentication: ECDHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2202 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2203 | key_file=$DATA_FILES_PATH/server2.key" \ |
| 2204 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2205 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2206 | 0 \ |
| 2207 | -c "key type: Opaque" \ |
| 2208 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2209 | -s "Verifying peer X.509 certificate... ok" \ |
| 2210 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2211 | -S "error" \ |
| 2212 | -C "error" |
| 2213 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2214 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2215 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2216 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2217 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2218 | run_test "Opaque key for client authentication: DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2219 | "$P_SRV force_version=tls12 auth_mode=required crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2220 | key_file=$DATA_FILES_PATH/server2.key" \ |
| 2221 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2222 | key_file=$DATA_FILES_PATH/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2223 | key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2224 | 0 \ |
| 2225 | -c "key type: Opaque" \ |
| 2226 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2227 | -s "Verifying peer X.509 certificate... ok" \ |
| 2228 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2229 | -S "error" \ |
| 2230 | -C "error" |
| 2231 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2232 | # Test using an EC opaque private key for server authentication |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2233 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2234 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2235 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2236 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2237 | run_test "Opaque key for server authentication: ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2238 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2239 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2240 | "$P_CLI force_version=tls12" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2241 | 0 \ |
| 2242 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2243 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2244 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2245 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame] | 2246 | -S "error" \ |
| 2247 | -C "error" |
| 2248 | |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2249 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2250 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2251 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2252 | run_test "Opaque key for server authentication: ECDH-" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2253 | "$P_SRV auth_mode=required key_opaque=1\ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2254 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt\ |
| 2255 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdh,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2256 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 023bf8d | 2022-03-23 14:04:04 +0100 | [diff] [blame] | 2257 | 0 \ |
| 2258 | -c "Verifying peer X.509 certificate... ok" \ |
| 2259 | -c "Ciphersuite is TLS-ECDH-" \ |
| 2260 | -s "key types: Opaque, none" \ |
| 2261 | -s "Ciphersuite is TLS-ECDH-" \ |
| 2262 | -S "error" \ |
| 2263 | -C "error" |
| 2264 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2265 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2266 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2267 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2268 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2269 | run_test "Opaque key for server authentication: invalid key: decrypt with ECC key, no async" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2270 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2271 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=rsa-decrypt,none \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2272 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2273 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2274 | 1 \ |
| 2275 | -s "key types: Opaque, none" \ |
| 2276 | -s "error" \ |
| 2277 | -c "error" \ |
| 2278 | -c "Public key type mismatch" |
| 2279 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2280 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2281 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2282 | requires_config_enabled MBEDTLS_ECDSA_C |
| 2283 | requires_config_enabled MBEDTLS_RSA_C |
| 2284 | requires_config_disabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2285 | requires_hash_alg SHA_256 |
| 2286 | run_test "Opaque key for server authentication: invalid key: ecdh with RSA key, no async" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2287 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2288 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=ecdh,none \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2289 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2290 | "$P_CLI force_version=tls12" \ |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2291 | 1 \ |
| 2292 | -s "key types: Opaque, none" \ |
| 2293 | -s "error" \ |
| 2294 | -c "error" \ |
| 2295 | -c "Public key type mismatch" |
| 2296 | |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2297 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2298 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2299 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 2300 | requires_hash_alg SHA_256 |
| 2301 | run_test "Opaque key for server authentication: invalid alg: decrypt with ECC key, async" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2302 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2303 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=rsa-decrypt,none \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2304 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2305 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2306 | 1 \ |
| 2307 | -s "key types: Opaque, none" \ |
| 2308 | -s "got ciphersuites in common, but none of them usable" \ |
| 2309 | -s "error" \ |
| 2310 | -c "error" |
| 2311 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2312 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2313 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2314 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2315 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2316 | requires_hash_alg SHA_256 |
Andrzej Kurek | d681746 | 2022-09-06 14:32:00 -0400 | [diff] [blame] | 2317 | run_test "Opaque key for server authentication: invalid alg: ecdh with RSA key, async" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2318 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2319 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2320 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2321 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2322 | 1 \ |
| 2323 | -s "key types: Opaque, none" \ |
| 2324 | -s "got ciphersuites in common, but none of them usable" \ |
| 2325 | -s "error" \ |
| 2326 | -c "error" |
| 2327 | |
Neil Armstrong | eb4390b | 2022-05-27 10:26:02 +0200 | [diff] [blame] | 2328 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2329 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2330 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2331 | run_test "Opaque key for server authentication: invalid alg: ECDHE-ECDSA with ecdh" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2332 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2333 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdh,none \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2334 | debug_level=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2335 | "$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] | 2336 | 1 \ |
| 2337 | -s "key types: Opaque, none" \ |
| 2338 | -s "got ciphersuites in common, but none of them usable" \ |
| 2339 | -s "error" \ |
| 2340 | -c "error" |
| 2341 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2342 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2343 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2344 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2345 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2346 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2347 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2348 | "$P_SRV force_version=tls12 key_opaque=1 crt_file=$DATA_FILES_PATH/server7.crt \ |
| 2349 | key_file=$DATA_FILES_PATH/server7.key key_opaque_algs=ecdh,none \ |
| 2350 | crt_file2=$DATA_FILES_PATH/server5.crt key_file2=$DATA_FILES_PATH/server5.key \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2351 | key_opaque_algs2=ecdsa-sign,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2352 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2353 | 0 \ |
| 2354 | -c "Verifying peer X.509 certificate... ok" \ |
| 2355 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2356 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2357 | -s "key types: Opaque, Opaque" \ |
| 2358 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2359 | -S "error" \ |
| 2360 | -C "error" |
| 2361 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2362 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2363 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2364 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2365 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2366 | run_test "Opaque keys for server authentication: EC keys with different algs, force ECDH-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2367 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server7.crt \ |
| 2368 | key_file=$DATA_FILES_PATH/server7.key key_opaque_algs=ecdsa-sign,none \ |
| 2369 | crt_file2=$DATA_FILES_PATH/server5.crt key_file2=$DATA_FILES_PATH/server5.key \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2370 | key_opaque_algs2=ecdh,none debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2371 | "$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] | 2372 | 0 \ |
| 2373 | -c "Verifying peer X.509 certificate... ok" \ |
| 2374 | -c "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2375 | -c "CN=Polarssl Test EC CA" \ |
| 2376 | -s "key types: Opaque, Opaque" \ |
| 2377 | -s "Ciphersuite is TLS-ECDH-ECDSA" \ |
| 2378 | -S "error" \ |
| 2379 | -C "error" |
| 2380 | |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2381 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2382 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2383 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2384 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2385 | run_test "Opaque keys for server authentication: EC + RSA, force ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2386 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2387 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2388 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2389 | key_file2=$DATA_FILES_PATH/server2.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2390 | "$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] | 2391 | 0 \ |
| 2392 | -c "Verifying peer X.509 certificate... ok" \ |
| 2393 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2394 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2395 | -s "key types: Opaque, Opaque" \ |
| 2396 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
| 2397 | -S "error" \ |
| 2398 | -C "error" |
| 2399 | |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2400 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2401 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2402 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2403 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2404 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2405 | run_test "TLS 1.3 opaque key: no suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2406 | "$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] | 2407 | "$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] | 2408 | 1 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2409 | -c "key type: Opaque" \ |
| 2410 | -s "key types: Opaque, Opaque" \ |
| 2411 | -c "error" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 2412 | -s "no suitable signature algorithm" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2413 | |
| 2414 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2415 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2416 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2417 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2418 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2419 | run_test "TLS 1.3 opaque key: suitable algorithm found" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 2420 | "$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] | 2421 | "$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] | 2422 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2423 | -c "key type: Opaque" \ |
| 2424 | -s "key types: Opaque, Opaque" \ |
| 2425 | -C "error" \ |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2426 | -S "error" |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2427 | |
| 2428 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2429 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2430 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2431 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2432 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2433 | 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] | 2434 | "$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] | 2435 | "$P_CLI debug_level=4 sig_algs=rsa_pss_rsae_sha256,rsa_pss_rsae_sha512" \ |
| 2436 | 0 \ |
Ronald Cron | 50969e3 | 2022-09-16 15:54:33 +0200 | [diff] [blame] | 2437 | -s "key types: Opaque, Opaque" \ |
| 2438 | -s "CertificateVerify signature failed with rsa_pss_rsae_sha256" \ |
| 2439 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 2440 | -C "error" \ |
| 2441 | -S "error" \ |
| 2442 | |
| 2443 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 2444 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2445 | requires_config_enabled MBEDTLS_RSA_C |
Jerry Yu | ddda050 | 2022-12-01 19:43:12 +0800 | [diff] [blame] | 2446 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 2447 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 6ec2123 | 2022-09-16 16:41:53 +0200 | [diff] [blame] | 2448 | 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] | 2449 | "$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] | 2450 | "$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] | 2451 | 0 \ |
Przemek Stekiel | c454aba | 2022-07-07 09:56:13 +0200 | [diff] [blame] | 2452 | -c "key type: Opaque" \ |
| 2453 | -s "key types: Opaque, Opaque" \ |
| 2454 | -C "error" \ |
| 2455 | -S "error" \ |
| 2456 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2457 | # Test using a RSA opaque private key for server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2458 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2459 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2460 | requires_config_enabled MBEDTLS_RSA_C |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2461 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2462 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2463 | run_test "Opaque key for server authentication: ECDHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2464 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2465 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2466 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2467 | 0 \ |
| 2468 | -c "Verifying peer X.509 certificate... ok" \ |
| 2469 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2470 | -s "key types: Opaque, none" \ |
| 2471 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2472 | -S "error" \ |
| 2473 | -C "error" |
| 2474 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2475 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2476 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2477 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2478 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2479 | run_test "Opaque key for server authentication: DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2480 | "$P_SRV key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2481 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2482 | "$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] | 2483 | 0 \ |
| 2484 | -c "Verifying peer X.509 certificate... ok" \ |
| 2485 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2486 | -s "key types: Opaque, none" \ |
| 2487 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2488 | -S "error" \ |
| 2489 | -C "error" |
| 2490 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2491 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2492 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2493 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2494 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2495 | run_test "Opaque key for server authentication: RSA-PSK" \ |
| 2496 | "$P_SRV debug_level=1 key_opaque=1 key_opaque_algs=rsa-decrypt,none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 2497 | psk=73776f726466697368 psk_identity=foo" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2498 | "$P_CLI force_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 2499 | psk=73776f726466697368 psk_identity=foo" \ |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2500 | 0 \ |
| 2501 | -c "Verifying peer X.509 certificate... ok" \ |
| 2502 | -c "Ciphersuite is TLS-RSA-PSK-" \ |
| 2503 | -s "key types: Opaque, Opaque" \ |
| 2504 | -s "Ciphersuite is TLS-RSA-PSK-" \ |
| 2505 | -S "error" \ |
| 2506 | -C "error" |
| 2507 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2508 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2509 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 2510 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2511 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2512 | run_test "Opaque key for server authentication: RSA-" \ |
| 2513 | "$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] | 2514 | "$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] | 2515 | 0 \ |
| 2516 | -c "Verifying peer X.509 certificate... ok" \ |
| 2517 | -c "Ciphersuite is TLS-RSA-" \ |
| 2518 | -s "key types: Opaque, Opaque" \ |
| 2519 | -s "Ciphersuite is TLS-RSA-" \ |
| 2520 | -S "error" \ |
| 2521 | -C "error" |
| 2522 | |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2523 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2524 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2525 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2526 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2527 | run_test "Opaque key for server authentication: DHE-RSA, PSS instead of PKCS1" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2528 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2529 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pss,none debug_level=1" \ |
| 2530 | "$P_CLI crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2531 | key_file=$DATA_FILES_PATH/server2.key force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2532 | 1 \ |
| 2533 | -s "key types: Opaque, none" \ |
| 2534 | -s "got ciphersuites in common, but none of them usable" \ |
| 2535 | -s "error" \ |
| 2536 | -c "error" |
| 2537 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2538 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2539 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2540 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2541 | requires_hash_alg SHA_256 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2542 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2543 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2544 | run_test "Opaque keys for server authentication: RSA keys with different algs" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2545 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2546 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pss,none \ |
| 2547 | crt_file2=$DATA_FILES_PATH/server4.crt \ |
| 2548 | key_file2=$DATA_FILES_PATH/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2549 | "$P_CLI force_version=tls12" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2550 | 0 \ |
| 2551 | -c "Verifying peer X.509 certificate... ok" \ |
| 2552 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2553 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2554 | -s "key types: Opaque, Opaque" \ |
| 2555 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2556 | -S "error" \ |
| 2557 | -C "error" |
| 2558 | |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2559 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2560 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2561 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2562 | requires_hash_alg SHA_384 |
Neil Armstrong | c67e6e9 | 2022-07-01 15:48:10 +0200 | [diff] [blame] | 2563 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2564 | run_test "Opaque keys for server authentication: EC + RSA, force DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2565 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2566 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none \ |
| 2567 | crt_file2=$DATA_FILES_PATH/server4.crt \ |
| 2568 | key_file2=$DATA_FILES_PATH/server4.key key_opaque_algs2=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2569 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2570 | 0 \ |
| 2571 | -c "Verifying peer X.509 certificate... ok" \ |
| 2572 | -c "Ciphersuite is TLS-DHE-RSA" \ |
Neil Armstrong | 4b10209 | 2022-07-01 09:42:29 +0200 | [diff] [blame] | 2573 | -c "CN=Polarssl Test EC CA" \ |
Neil Armstrong | 167d82c | 2022-06-30 11:32:00 +0200 | [diff] [blame] | 2574 | -s "key types: Opaque, Opaque" \ |
| 2575 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2576 | -S "error" \ |
| 2577 | -C "error" |
| 2578 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2579 | # Test using an EC opaque private key for client/server authentication |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2580 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2581 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2582 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2583 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2584 | run_test "Opaque key for client/server authentication: ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2585 | "$P_SRV force_version=tls12 auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2586 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
| 2587 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 2588 | key_file=$DATA_FILES_PATH/server5.key key_opaque_algs=ecdsa-sign,none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2589 | 0 \ |
| 2590 | -c "key type: Opaque" \ |
| 2591 | -c "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2592 | -c "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Gilles Peskine | 05bf89d | 2022-01-25 17:50:25 +0100 | [diff] [blame] | 2593 | -s "key types: Opaque, none" \ |
Przemyslaw Stekiel | 575f23c | 2021-10-06 11:31:49 +0200 | [diff] [blame] | 2594 | -s "Verifying peer X.509 certificate... ok" \ |
Przemyslaw Stekiel | bb5d483 | 2021-10-26 12:25:27 +0200 | [diff] [blame] | 2595 | -s "Ciphersuite is TLS-ECDHE-ECDSA" \ |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 2596 | -S "error" \ |
| 2597 | -C "error" |
| 2598 | |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2599 | # Test using a RSA opaque private key for client/server authentication |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2600 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2601 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2602 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2603 | requires_hash_alg SHA_256 |
valerio | f27472b | 2023-03-09 16:19:35 +0100 | [diff] [blame] | 2604 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2605 | run_test "Opaque key for client/server authentication: ECDHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2606 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2607 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
| 2608 | "$P_CLI force_version=tls12 key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2609 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
Neil Armstrong | 3e9a142 | 2022-03-21 10:03:46 +0100 | [diff] [blame] | 2610 | 0 \ |
| 2611 | -c "key type: Opaque" \ |
| 2612 | -c "Verifying peer X.509 certificate... ok" \ |
| 2613 | -c "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2614 | -s "key types: Opaque, none" \ |
| 2615 | -s "Verifying peer X.509 certificate... ok" \ |
| 2616 | -s "Ciphersuite is TLS-ECDHE-RSA" \ |
| 2617 | -S "error" \ |
| 2618 | -C "error" |
| 2619 | |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2620 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 2621 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2622 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 2623 | requires_hash_alg SHA_256 |
Neil Armstrong | 1948a20 | 2022-06-30 18:05:57 +0200 | [diff] [blame] | 2624 | run_test "Opaque key for client/server authentication: DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2625 | "$P_SRV auth_mode=required key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2626 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none" \ |
| 2627 | "$P_CLI key_opaque=1 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 2628 | key_file=$DATA_FILES_PATH/server2.key key_opaque_algs=rsa-sign-pkcs1,none \ |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2629 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
Neil Armstrong | a4dbfdd | 2022-03-21 10:11:07 +0100 | [diff] [blame] | 2630 | 0 \ |
| 2631 | -c "key type: Opaque" \ |
| 2632 | -c "Verifying peer X.509 certificate... ok" \ |
| 2633 | -c "Ciphersuite is TLS-DHE-RSA" \ |
| 2634 | -s "key types: Opaque, none" \ |
| 2635 | -s "Verifying peer X.509 certificate... ok" \ |
| 2636 | -s "Ciphersuite is TLS-DHE-RSA" \ |
| 2637 | -S "error" \ |
| 2638 | -C "error" |
| 2639 | |
Neil Armstrong | 36b0223 | 2022-06-30 11:16:53 +0200 | [diff] [blame] | 2640 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 2641 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 2642 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 2643 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 2644 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 2645 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 2646 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 2647 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 2648 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 2649 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 2650 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 2651 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 2652 | |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2653 | requires_config_enabled PSA_WANT_ECC_SECP_R1_521 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2654 | run_test_psa_force_curve "secp521r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2655 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_512 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2656 | run_test_psa_force_curve "brainpoolP512r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2657 | requires_config_enabled PSA_WANT_ECC_SECP_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2658 | run_test_psa_force_curve "secp384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2659 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_384 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2660 | run_test_psa_force_curve "brainpoolP384r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2661 | requires_config_enabled PSA_WANT_ECC_SECP_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2662 | run_test_psa_force_curve "secp256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2663 | requires_config_enabled PSA_WANT_ECC_SECP_K1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2664 | run_test_psa_force_curve "secp256k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2665 | requires_config_enabled PSA_WANT_ECC_BRAINPOOL_P_R1_256 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2666 | run_test_psa_force_curve "brainpoolP256r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2667 | requires_config_enabled PSA_WANT_ECC_SECP_R1_224 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2668 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2669 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 017a199 | 2022-03-31 14:07:01 +0100 | [diff] [blame] | 2670 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2671 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 2672 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 2673 | ## 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] | 2674 | #requires_config_enabled PSA_WANT_ECC_SECP_K1_224 |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 2675 | #run_test_psa_force_curve "secp224k1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2676 | requires_config_enabled PSA_WANT_ECC_SECP_R1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2677 | run_test_psa_force_curve "secp192r1" |
Manuel Pégourié-Gonnard | 22334a2 | 2023-10-19 11:27:33 +0200 | [diff] [blame] | 2678 | requires_config_enabled PSA_WANT_ECC_SECP_K1_192 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 2679 | run_test_psa_force_curve "secp192k1" |
| 2680 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2681 | # Test current time in ServerHello |
| 2682 | requires_config_enabled MBEDTLS_HAVE_TIME |
| 2683 | run_test "ServerHello contains gmt_unix_time" \ |
| 2684 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2685 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2686 | 0 \ |
| 2687 | -f "check_server_hello_time" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2688 | -F "check_server_hello_time" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 2689 | |
| 2690 | # Test for uniqueness of IVs in AEAD ciphersuites |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2691 | run_test "Unique IV in GCM" \ |
| 2692 | "$P_SRV exchanges=20 debug_level=4" \ |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 2693 | "$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] | 2694 | 0 \ |
| 2695 | -u "IV used" \ |
| 2696 | -U "IV used" |
| 2697 | |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2698 | # Test for correctness of sent single supported algorithm |
Valerio Setti | 482a0b9 | 2023-08-18 15:55:10 +0200 | [diff] [blame] | 2699 | requires_any_configs_enabled "MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2700 | PSA_WANT_ECC_SECP_R1_256" |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2701 | requires_config_enabled MBEDTLS_DEBUG_C |
| 2702 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Paul Elliott | 3b4ceda | 2022-11-17 12:47:10 +0000 | [diff] [blame] | 2703 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 2704 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 2705 | requires_pk_alg "ECDSA" |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2706 | requires_hash_alg SHA_256 |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2707 | run_test "Single supported algorithm sending: mbedtls client" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 2708 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2709 | "$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] | 2710 | 0 \ |
| 2711 | -c "Supported Signature Algorithm found: 04 03" |
| 2712 | |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 2714 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Valerio Setti | 482a0b9 | 2023-08-18 15:55:10 +0200 | [diff] [blame] | 2715 | requires_any_configs_enabled "MBEDTLS_ECP_DP_SECP256R1_ENABLED \ |
| 2716 | PSA_WANT_ECC_SECP_R1_256" |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2717 | requires_hash_alg SHA_256 |
| 2718 | run_test "Single supported algorithm sending: openssl client" \ |
| 2719 | "$P_SRV sig_algs=ecdsa_secp256r1_sha256 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2720 | "$O_CLI -cert $DATA_FILES_PATH/server6.crt \ |
| 2721 | -key $DATA_FILES_PATH/server6.key" \ |
Paul Elliott | f6e342c | 2022-11-17 12:50:29 +0000 | [diff] [blame] | 2722 | 0 |
| 2723 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2724 | # Tests for certificate verification callback |
| 2725 | run_test "Configuration-specific CRT verification callback" \ |
| 2726 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2727 | "$P_CLI force_version=tls12 context_crt_cb=0 debug_level=3" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2728 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2729 | -S "error" \ |
| 2730 | -c "Verify requested for " \ |
| 2731 | -c "Use configuration-specific verification callback" \ |
| 2732 | -C "Use context-specific verification callback" \ |
| 2733 | -C "error" |
| 2734 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2735 | run_test "Context-specific CRT verification callback" \ |
| 2736 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 2737 | "$P_CLI force_version=tls12 context_crt_cb=1 debug_level=3" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2738 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2739 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 2740 | -c "Verify requested for " \ |
| 2741 | -c "Use context-specific verification callback" \ |
| 2742 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 2743 | -C "error" |
| 2744 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2745 | # Tests for SHA-1 support |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2746 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2747 | run_test "SHA-1 forbidden by default in server certificate" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2748 | "$P_SRV key_file=$DATA_FILES_PATH/server2.key crt_file=$DATA_FILES_PATH/server2.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2749 | "$P_CLI debug_level=2 force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2750 | 1 \ |
| 2751 | -c "The certificate is signed with an unacceptable hash" |
| 2752 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2753 | requires_hash_alg SHA_1 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2754 | run_test "SHA-1 explicitly allowed in server certificate" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2755 | "$P_SRV key_file=$DATA_FILES_PATH/server2.key crt_file=$DATA_FILES_PATH/server2.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2756 | "$P_CLI force_version=tls12 allow_sha1=1" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2757 | 0 |
| 2758 | |
| 2759 | run_test "SHA-256 allowed by default in server certificate" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2760 | "$P_SRV key_file=$DATA_FILES_PATH/server2.key crt_file=$DATA_FILES_PATH/server2-sha256.crt" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2761 | "$P_CLI force_version=tls12 allow_sha1=0" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2762 | 0 |
| 2763 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2764 | requires_hash_alg SHA_1 |
| 2765 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2766 | run_test "SHA-1 forbidden by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2767 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2768 | "$P_CLI key_file=$DATA_FILES_PATH/cli-rsa.key crt_file=$DATA_FILES_PATH/cli-rsa-sha1.crt" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2769 | 1 \ |
| 2770 | -s "The certificate is signed with an unacceptable hash" |
| 2771 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2772 | requires_hash_alg SHA_1 |
| 2773 | requires_config_enabled MBEDTLS_RSA_C |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2774 | run_test "SHA-1 explicitly allowed in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2775 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=1" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2776 | "$P_CLI key_file=$DATA_FILES_PATH/cli-rsa.key crt_file=$DATA_FILES_PATH/cli-rsa-sha1.crt" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2777 | 0 |
| 2778 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 2779 | requires_config_enabled MBEDTLS_RSA_C |
| 2780 | requires_hash_alg SHA_256 |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2781 | run_test "SHA-256 allowed by default in client certificate" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 2782 | "$P_SRV force_version=tls12 auth_mode=required allow_sha1=0" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 2783 | "$P_CLI key_file=$DATA_FILES_PATH/cli-rsa.key crt_file=$DATA_FILES_PATH/cli-rsa-sha256.crt" \ |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 2784 | 0 |
| 2785 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2786 | # Tests for datagram packing |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2787 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2788 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 2789 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2790 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2791 | 0 \ |
| 2792 | -c "next record in same datagram" \ |
| 2793 | -s "next record in same datagram" |
| 2794 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2795 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2796 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 2797 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2798 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 2799 | 0 \ |
| 2800 | -s "next record in same datagram" \ |
| 2801 | -C "next record in same datagram" |
| 2802 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2803 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2804 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 2805 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 2806 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2807 | 0 \ |
| 2808 | -S "next record in same datagram" \ |
| 2809 | -c "next record in same datagram" |
| 2810 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2811 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 2812 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 2813 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 2814 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 2815 | 0 \ |
| 2816 | -S "next record in same datagram" \ |
| 2817 | -C "next record in same datagram" |
| 2818 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2819 | # Tests for Context serialization |
| 2820 | |
| 2821 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2822 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2823 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2824 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2825 | 0 \ |
| 2826 | -c "Deserializing connection..." \ |
| 2827 | -S "Deserializing connection..." |
| 2828 | |
| 2829 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2830 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 2831 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2832 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2833 | 0 \ |
| 2834 | -c "Deserializing connection..." \ |
| 2835 | -S "Deserializing connection..." |
| 2836 | |
| 2837 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2838 | run_test "Context serialization, client serializes, GCM" \ |
| 2839 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2840 | "$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] | 2841 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2842 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2843 | -S "Deserializing connection..." |
| 2844 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2845 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2846 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2847 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2848 | run_test "Context serialization, client serializes, with CID" \ |
| 2849 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2850 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2851 | 0 \ |
| 2852 | -c "Deserializing connection..." \ |
| 2853 | -S "Deserializing connection..." |
| 2854 | |
| 2855 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2856 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2857 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2858 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2859 | 0 \ |
| 2860 | -C "Deserializing connection..." \ |
| 2861 | -s "Deserializing connection..." |
| 2862 | |
| 2863 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2864 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2865 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2866 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2867 | 0 \ |
| 2868 | -C "Deserializing connection..." \ |
| 2869 | -s "Deserializing connection..." |
| 2870 | |
| 2871 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2872 | run_test "Context serialization, server serializes, GCM" \ |
| 2873 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2874 | "$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] | 2875 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2876 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2877 | -s "Deserializing connection..." |
| 2878 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2879 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2880 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2881 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2882 | run_test "Context serialization, server serializes, with CID" \ |
| 2883 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2884 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2885 | 0 \ |
| 2886 | -C "Deserializing connection..." \ |
| 2887 | -s "Deserializing connection..." |
| 2888 | |
| 2889 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2890 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2891 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2892 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2893 | 0 \ |
| 2894 | -c "Deserializing connection..." \ |
| 2895 | -s "Deserializing connection..." |
| 2896 | |
| 2897 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2898 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2899 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2900 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2901 | 0 \ |
| 2902 | -c "Deserializing connection..." \ |
| 2903 | -s "Deserializing connection..." |
| 2904 | |
| 2905 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2906 | run_test "Context serialization, both serialize, GCM" \ |
| 2907 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2908 | "$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] | 2909 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2910 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2911 | -s "Deserializing connection..." |
| 2912 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2913 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2914 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2915 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2916 | run_test "Context serialization, both serialize, with CID" \ |
| 2917 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2918 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2919 | 0 \ |
| 2920 | -c "Deserializing connection..." \ |
| 2921 | -s "Deserializing connection..." |
| 2922 | |
| 2923 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2924 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2925 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2926 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2927 | 0 \ |
| 2928 | -c "Deserializing connection..." \ |
| 2929 | -S "Deserializing connection..." |
| 2930 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2931 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2932 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2933 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2934 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2935 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2936 | 0 \ |
| 2937 | -c "Deserializing connection..." \ |
| 2938 | -S "Deserializing connection..." |
| 2939 | |
| 2940 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2941 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2942 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2943 | "$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] | 2944 | 0 \ |
| 2945 | -c "Deserializing connection..." \ |
| 2946 | -S "Deserializing connection..." |
| 2947 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 2948 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2949 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2950 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2951 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2952 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2953 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2954 | 0 \ |
| 2955 | -c "Deserializing connection..." \ |
| 2956 | -S "Deserializing connection..." |
| 2957 | |
| 2958 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2959 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2960 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2961 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2962 | 0 \ |
| 2963 | -C "Deserializing connection..." \ |
| 2964 | -s "Deserializing connection..." |
| 2965 | |
| 2966 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2967 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2968 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2969 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2970 | 0 \ |
| 2971 | -C "Deserializing connection..." \ |
| 2972 | -s "Deserializing connection..." |
| 2973 | |
| 2974 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2975 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2976 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2977 | "$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] | 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 |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2983 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2984 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2985 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2986 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2987 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2988 | 0 \ |
| 2989 | -C "Deserializing connection..." \ |
| 2990 | -s "Deserializing connection..." |
| 2991 | |
| 2992 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2993 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2994 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2995 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2996 | 0 \ |
| 2997 | -c "Deserializing connection..." \ |
| 2998 | -s "Deserializing connection..." |
| 2999 | |
| 3000 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3001 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 3002 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3003 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 3004 | 0 \ |
| 3005 | -c "Deserializing connection..." \ |
| 3006 | -s "Deserializing connection..." |
| 3007 | |
| 3008 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3009 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 3010 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 3011 | "$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] | 3012 | 0 \ |
| 3013 | -c "Deserializing connection..." \ |
| 3014 | -s "Deserializing connection..." |
| 3015 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 3017 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3018 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3019 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 3020 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 3021 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 3022 | 0 \ |
| 3023 | -c "Deserializing connection..." \ |
| 3024 | -s "Deserializing connection..." |
| 3025 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3026 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 3027 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 3028 | run_test "Saving the serialized context to a file" \ |
| 3029 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 3030 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 3031 | 0 \ |
| 3032 | -s "Save serialized context to a file... ok" \ |
| 3033 | -c "Save serialized context to a file... ok" |
| 3034 | rm -f context_srv.txt |
| 3035 | rm -f context_cli.txt |
| 3036 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3037 | # Tests for DTLS Connection ID extension |
| 3038 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3039 | # So far, the CID API isn't implemented, so we can't |
| 3040 | # grep for output witnessing its use. This needs to be |
| 3041 | # changed once the CID extension is implemented. |
| 3042 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3043 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3044 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3045 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3046 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 3047 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3048 | 0 \ |
| 3049 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3050 | -s "found CID extension" \ |
| 3051 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3052 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3053 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3054 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3055 | -C "found CID extension" \ |
| 3056 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3057 | -C "Copy CIDs into SSL transform" \ |
| 3058 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3059 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3060 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3061 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3062 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3063 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3064 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 3065 | 0 \ |
| 3066 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3067 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3068 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3069 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3070 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3071 | -C "found CID extension" \ |
| 3072 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3073 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 3074 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3075 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3076 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3077 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3078 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3079 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3080 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 3081 | 0 \ |
| 3082 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3083 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3084 | -c "client hello, adding CID extension" \ |
| 3085 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3086 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3087 | -s "server hello, adding CID extension" \ |
| 3088 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3089 | -c "Use of CID extension negotiated" \ |
| 3090 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3091 | -c "Copy CIDs into SSL transform" \ |
| 3092 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3093 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3094 | -s "Use of Connection ID has been negotiated" \ |
| 3095 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3096 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3098 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3099 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3100 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3101 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 3102 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 3103 | 0 \ |
| 3104 | -c "Enable use of CID extension." \ |
| 3105 | -s "Enable use of CID extension." \ |
| 3106 | -c "client hello, adding CID extension" \ |
| 3107 | -s "found CID extension" \ |
| 3108 | -s "Use of CID extension negotiated" \ |
| 3109 | -s "server hello, adding CID extension" \ |
| 3110 | -c "found CID extension" \ |
| 3111 | -c "Use of CID extension negotiated" \ |
| 3112 | -s "Copy CIDs into SSL transform" \ |
| 3113 | -c "Copy CIDs into SSL transform" \ |
| 3114 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3115 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3116 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3117 | -c "Use of Connection ID has been negotiated" \ |
| 3118 | -c "ignoring unexpected CID" \ |
| 3119 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3120 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3121 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3122 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3123 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 3124 | -p "$P_PXY mtu=800" \ |
| 3125 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3126 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3127 | 0 \ |
| 3128 | -c "Enable use of CID extension." \ |
| 3129 | -s "Enable use of CID extension." \ |
| 3130 | -c "client hello, adding CID extension" \ |
| 3131 | -s "found CID extension" \ |
| 3132 | -s "Use of CID extension negotiated" \ |
| 3133 | -s "server hello, adding CID extension" \ |
| 3134 | -c "found CID extension" \ |
| 3135 | -c "Use of CID extension negotiated" \ |
| 3136 | -s "Copy CIDs into SSL transform" \ |
| 3137 | -c "Copy CIDs into SSL transform" \ |
| 3138 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3139 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3140 | -s "Use of Connection ID has been negotiated" \ |
| 3141 | -c "Use of Connection ID has been negotiated" |
| 3142 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3143 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3144 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3145 | 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] | 3146 | -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] | 3147 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 3148 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 3149 | 0 \ |
| 3150 | -c "Enable use of CID extension." \ |
| 3151 | -s "Enable use of CID extension." \ |
| 3152 | -c "client hello, adding CID extension" \ |
| 3153 | -s "found CID extension" \ |
| 3154 | -s "Use of CID extension negotiated" \ |
| 3155 | -s "server hello, adding CID extension" \ |
| 3156 | -c "found CID extension" \ |
| 3157 | -c "Use of CID extension negotiated" \ |
| 3158 | -s "Copy CIDs into SSL transform" \ |
| 3159 | -c "Copy CIDs into SSL transform" \ |
| 3160 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3161 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3162 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3163 | -c "Use of Connection ID has been negotiated" \ |
| 3164 | -c "ignoring unexpected CID" \ |
| 3165 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3166 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3167 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3168 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3169 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3170 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3171 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3172 | 0 \ |
| 3173 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3174 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3175 | -c "client hello, adding CID extension" \ |
| 3176 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3177 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3178 | -s "server hello, adding CID extension" \ |
| 3179 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3180 | -c "Use of CID extension negotiated" \ |
| 3181 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3182 | -c "Copy CIDs into SSL transform" \ |
| 3183 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3184 | -s "Peer CID (length 0 Bytes):" \ |
| 3185 | -s "Use of Connection ID has been negotiated" \ |
| 3186 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3187 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3188 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3189 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3190 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3191 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3192 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3193 | 0 \ |
| 3194 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3195 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3196 | -c "client hello, adding CID extension" \ |
| 3197 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3198 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3199 | -s "server hello, adding CID extension" \ |
| 3200 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3201 | -c "Use of CID extension negotiated" \ |
| 3202 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3203 | -c "Copy CIDs into SSL transform" \ |
| 3204 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3205 | -c "Peer CID (length 0 Bytes):" \ |
| 3206 | -s "Use of Connection ID has been negotiated" \ |
| 3207 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3208 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3209 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3210 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3211 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3212 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3213 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 3214 | 0 \ |
| 3215 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3216 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3217 | -c "client hello, adding CID extension" \ |
| 3218 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3219 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3220 | -s "server hello, adding CID extension" \ |
| 3221 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3222 | -c "Use of CID extension negotiated" \ |
| 3223 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3224 | -c "Copy CIDs into SSL transform" \ |
| 3225 | -S "Use of Connection ID has been negotiated" \ |
| 3226 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3227 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3228 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3229 | 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] | 3230 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3231 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3232 | 0 \ |
| 3233 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3234 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3235 | -c "client hello, adding CID extension" \ |
| 3236 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3237 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3238 | -s "server hello, adding CID extension" \ |
| 3239 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3240 | -c "Use of CID extension negotiated" \ |
| 3241 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3242 | -c "Copy CIDs into SSL transform" \ |
| 3243 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3244 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3245 | -s "Use of Connection ID has been negotiated" \ |
| 3246 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3247 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3248 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3249 | 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] | 3250 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3251 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3252 | 0 \ |
| 3253 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3254 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3255 | -c "client hello, adding CID extension" \ |
| 3256 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3257 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3258 | -s "server hello, adding CID extension" \ |
| 3259 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3260 | -c "Use of CID extension negotiated" \ |
| 3261 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3262 | -c "Copy CIDs into SSL transform" \ |
| 3263 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3264 | -s "Peer CID (length 0 Bytes):" \ |
| 3265 | -s "Use of Connection ID has been negotiated" \ |
| 3266 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3267 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3268 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3269 | 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] | 3270 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3271 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3272 | 0 \ |
| 3273 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3274 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3275 | -c "client hello, adding CID extension" \ |
| 3276 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3277 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3278 | -s "server hello, adding CID extension" \ |
| 3279 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3280 | -c "Use of CID extension negotiated" \ |
| 3281 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3282 | -c "Copy CIDs into SSL transform" \ |
| 3283 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3284 | -c "Peer CID (length 0 Bytes):" \ |
| 3285 | -s "Use of Connection ID has been negotiated" \ |
| 3286 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3287 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3288 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3289 | 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] | 3290 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3291 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 3292 | 0 \ |
| 3293 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3294 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3295 | -c "client hello, adding CID extension" \ |
| 3296 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3297 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3298 | -s "server hello, adding CID extension" \ |
| 3299 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3300 | -c "Use of CID extension negotiated" \ |
| 3301 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3302 | -c "Copy CIDs into SSL transform" \ |
| 3303 | -S "Use of Connection ID has been negotiated" \ |
| 3304 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3305 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3306 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3307 | 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] | 3308 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 3309 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3310 | 0 \ |
| 3311 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3312 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3313 | -c "client hello, adding CID extension" \ |
| 3314 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3315 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3316 | -s "server hello, adding CID extension" \ |
| 3317 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3318 | -c "Use of CID extension negotiated" \ |
| 3319 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3320 | -c "Copy CIDs into SSL transform" \ |
| 3321 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 3322 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 3323 | -s "Use of Connection ID has been negotiated" \ |
| 3324 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3325 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3326 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3327 | 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] | 3328 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 3329 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3330 | 0 \ |
| 3331 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3332 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3333 | -c "client hello, adding CID extension" \ |
| 3334 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3335 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3336 | -s "server hello, adding CID extension" \ |
| 3337 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3338 | -c "Use of CID extension negotiated" \ |
| 3339 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3340 | -c "Copy CIDs into SSL transform" \ |
| 3341 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3342 | -s "Peer CID (length 0 Bytes):" \ |
| 3343 | -s "Use of Connection ID has been negotiated" \ |
| 3344 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3345 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3346 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3347 | 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] | 3348 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3349 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3350 | 0 \ |
| 3351 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3352 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3353 | -c "client hello, adding CID extension" \ |
| 3354 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3355 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3356 | -s "server hello, adding CID extension" \ |
| 3357 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3358 | -c "Use of CID extension negotiated" \ |
| 3359 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 3360 | -c "Copy CIDs into SSL transform" \ |
| 3361 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 3362 | -c "Peer CID (length 0 Bytes):" \ |
| 3363 | -s "Use of Connection ID has been negotiated" \ |
| 3364 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3365 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3366 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3367 | 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] | 3368 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 3369 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 3370 | 0 \ |
| 3371 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 3372 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 3373 | -c "client hello, adding CID extension" \ |
| 3374 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 3375 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 3376 | -s "server hello, adding CID extension" \ |
| 3377 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 3378 | -c "Use of CID extension negotiated" \ |
| 3379 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 3380 | -c "Copy CIDs into SSL transform" \ |
| 3381 | -S "Use of Connection ID has been negotiated" \ |
| 3382 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3383 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3384 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3385 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 3386 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3387 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 3388 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3389 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3390 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3391 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3392 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3393 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3394 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3395 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3396 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3397 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3398 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3399 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3400 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3401 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3402 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3403 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3404 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3405 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3406 | 0 \ |
| 3407 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3408 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3409 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3410 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3411 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3412 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3413 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3414 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3415 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3416 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3417 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3418 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3419 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 3420 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3421 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3422 | 0 \ |
| 3423 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3424 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3425 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3426 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3427 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3428 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3429 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3430 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 3431 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3432 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3433 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3434 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3435 | 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] | 3436 | -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] | 3437 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 3438 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 3439 | 0 \ |
| 3440 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3441 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3442 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3443 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3444 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3445 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3446 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3447 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3448 | -c "ignoring unexpected CID" \ |
| 3449 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3450 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3451 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3452 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3453 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3454 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3455 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3456 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3457 | 0 \ |
| 3458 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3459 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3460 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3461 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3462 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3463 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3464 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3465 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3466 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3468 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3469 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3470 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 3471 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3472 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3473 | 0 \ |
| 3474 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3475 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3476 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3477 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3478 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3479 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3480 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3481 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 3482 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3483 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3484 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3485 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3486 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3487 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3488 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3489 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3490 | 0 \ |
| 3491 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3492 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3493 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3494 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3495 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3496 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3497 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3498 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3499 | -c "ignoring unexpected CID" \ |
| 3500 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3501 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3502 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3503 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3504 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3505 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3506 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3507 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3508 | 0 \ |
| 3509 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3510 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3511 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3512 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3513 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3514 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3515 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3516 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3517 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3518 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3519 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 3520 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3521 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 3522 | 0 \ |
| 3523 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3524 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3525 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3526 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3527 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3528 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 3529 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3530 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3531 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 3532 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3533 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3534 | -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] | 3535 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 3536 | "$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" \ |
| 3537 | 0 \ |
| 3538 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3539 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3540 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3541 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3542 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3543 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3544 | -c "ignoring unexpected CID" \ |
| 3545 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3546 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3547 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3548 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3549 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3550 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3551 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3552 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3553 | 0 \ |
| 3554 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3555 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3556 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3557 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3558 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3559 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3560 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3561 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3562 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 3563 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3565 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3566 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3567 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3568 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3569 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 3570 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 3571 | 0 \ |
| 3572 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3573 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3574 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3575 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3576 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3577 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3578 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3579 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3580 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 3581 | -c "ignoring unexpected CID" \ |
| 3582 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3583 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3584 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3585 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3586 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3587 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 3588 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3589 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3590 | 0 \ |
| 3591 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3592 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3593 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3594 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3595 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3596 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3597 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3598 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3599 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 3600 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3601 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 3602 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 3603 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 3604 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3605 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 3606 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 3607 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 3608 | 0 \ |
| 3609 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3610 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3611 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3612 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3613 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 3614 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 3615 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 3616 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 3617 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 3618 | -c "ignoring unexpected CID" \ |
| 3619 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 3620 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 3621 | # 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] | 3622 | # tests check that the buffer contents are reallocated when the message is |
| 3623 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3624 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3625 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3626 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3627 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 3628 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3629 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 3630 | 0 \ |
| 3631 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3632 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3633 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3634 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3635 | -s "Reallocating in_buf" \ |
| 3636 | -s "Reallocating out_buf" |
| 3637 | |
| 3638 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 3639 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 3640 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 3641 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 3642 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 3643 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 3644 | 0 \ |
| 3645 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 3646 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 3647 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3648 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 3649 | -s "Reallocating in_buf" \ |
| 3650 | -s "Reallocating out_buf" |
| 3651 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3652 | # Tests for Encrypt-then-MAC extension |
| 3653 | |
| 3654 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3655 | "$P_SRV debug_level=3 \ |
| 3656 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3657 | "$P_CLI debug_level=3" \ |
| 3658 | 0 \ |
| 3659 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3660 | -s "found encrypt then mac extension" \ |
| 3661 | -s "server hello, adding encrypt then mac extension" \ |
| 3662 | -c "found encrypt_then_mac extension" \ |
| 3663 | -c "using encrypt then mac" \ |
| 3664 | -s "using encrypt then mac" |
| 3665 | |
| 3666 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3667 | "$P_SRV debug_level=3 etm=0 \ |
| 3668 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3669 | "$P_CLI debug_level=3 etm=1" \ |
| 3670 | 0 \ |
| 3671 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3672 | -s "found encrypt then mac extension" \ |
| 3673 | -S "server hello, adding encrypt then mac extension" \ |
| 3674 | -C "found encrypt_then_mac extension" \ |
| 3675 | -C "using encrypt then mac" \ |
| 3676 | -S "using encrypt then mac" |
| 3677 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 3678 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 3679 | "$P_SRV debug_level=3 etm=1 \ |
| 3680 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 3681 | "$P_CLI debug_level=3 etm=1" \ |
| 3682 | 0 \ |
| 3683 | -c "client hello, adding encrypt_then_mac extension" \ |
| 3684 | -s "found encrypt then mac extension" \ |
| 3685 | -S "server hello, adding encrypt then mac extension" \ |
| 3686 | -C "found encrypt_then_mac extension" \ |
| 3687 | -C "using encrypt then mac" \ |
| 3688 | -S "using encrypt then mac" |
| 3689 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3690 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 3691 | "$P_SRV debug_level=3 etm=1 \ |
| 3692 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 3693 | "$P_CLI debug_level=3 etm=0" \ |
| 3694 | 0 \ |
| 3695 | -C "client hello, adding encrypt_then_mac extension" \ |
| 3696 | -S "found encrypt then mac extension" \ |
| 3697 | -S "server hello, adding encrypt then mac extension" \ |
| 3698 | -C "found encrypt_then_mac extension" \ |
| 3699 | -C "using encrypt then mac" \ |
| 3700 | -S "using encrypt then mac" |
| 3701 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3702 | # Tests for Extended Master Secret extension |
| 3703 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3704 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3705 | run_test "Extended Master Secret: default" \ |
| 3706 | "$P_SRV debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3707 | "$P_CLI force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3708 | 0 \ |
| 3709 | -c "client hello, adding extended_master_secret extension" \ |
| 3710 | -s "found extended master secret extension" \ |
| 3711 | -s "server hello, adding extended master secret extension" \ |
| 3712 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3713 | -c "session hash for extended master secret" \ |
| 3714 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3715 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3716 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3717 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 3718 | "$P_SRV debug_level=3 extended_ms=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3719 | "$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] | 3720 | 0 \ |
| 3721 | -c "client hello, adding extended_master_secret extension" \ |
| 3722 | -s "found extended master secret extension" \ |
| 3723 | -S "server hello, adding extended master secret extension" \ |
| 3724 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3725 | -C "session hash for extended master secret" \ |
| 3726 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3727 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3728 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3729 | run_test "Extended Master Secret: client disabled, server enabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3730 | "$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] | 3731 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 3732 | 0 \ |
| 3733 | -C "client hello, adding extended_master_secret extension" \ |
| 3734 | -S "found extended master secret extension" \ |
| 3735 | -S "server hello, adding extended master secret extension" \ |
| 3736 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 3737 | -C "session hash for extended master secret" \ |
| 3738 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 3739 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3740 | # Test sending and receiving empty application data records |
| 3741 | |
| 3742 | run_test "Encrypt then MAC: empty application data record" \ |
| 3743 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 3744 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 3745 | 0 \ |
| 3746 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3747 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3748 | -c "0 bytes written in 1 fragments" |
| 3749 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3750 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3751 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3752 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 3753 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 3754 | 0 \ |
| 3755 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3756 | -c "0 bytes written in 1 fragments" |
| 3757 | |
| 3758 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3759 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3760 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3761 | 0 \ |
| 3762 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3763 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3764 | -c "0 bytes written in 1 fragments" |
| 3765 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3766 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3767 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3768 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3769 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3770 | 0 \ |
| 3771 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3772 | -c "0 bytes written in 1 fragments" |
| 3773 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3774 | # Tests for CBC 1/n-1 record splitting |
| 3775 | |
| 3776 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3777 | "$P_SRV force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3778 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 3779 | request_size=123" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3780 | 0 \ |
| 3781 | -s "Read from client: 123 bytes read" \ |
| 3782 | -S "Read from client: 1 bytes read" \ |
| 3783 | -S "122 bytes read" |
| 3784 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3785 | # Tests for Session Tickets |
| 3786 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3787 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3788 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3789 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3790 | "$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] | 3791 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3792 | -c "client hello, adding session ticket extension" \ |
| 3793 | -s "found session ticket extension" \ |
| 3794 | -s "server hello, adding session ticket extension" \ |
| 3795 | -c "found session_ticket extension" \ |
| 3796 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3797 | -S "session successfully restored from cache" \ |
| 3798 | -s "session successfully restored from ticket" \ |
| 3799 | -s "a session has been resumed" \ |
| 3800 | -c "a session has been resumed" |
| 3801 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3802 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3803 | run_test "Session resume using tickets: manual rotation" \ |
| 3804 | "$P_SRV debug_level=3 tickets=1 ticket_rotate=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3805 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Glenn Strauss | e328245 | 2022-02-03 17:23:24 -0500 | [diff] [blame] | 3806 | 0 \ |
| 3807 | -c "client hello, adding session ticket extension" \ |
| 3808 | -s "found session ticket extension" \ |
| 3809 | -s "server hello, adding session ticket extension" \ |
| 3810 | -c "found session_ticket extension" \ |
| 3811 | -c "parse new session ticket" \ |
| 3812 | -S "session successfully restored from cache" \ |
| 3813 | -s "session successfully restored from ticket" \ |
| 3814 | -s "a session has been resumed" \ |
| 3815 | -c "a session has been resumed" |
| 3816 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3817 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3818 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3819 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3820 | "$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] | 3821 | 0 \ |
| 3822 | -c "client hello, adding session ticket extension" \ |
| 3823 | -s "found session ticket extension" \ |
| 3824 | -s "server hello, adding session ticket extension" \ |
| 3825 | -c "found session_ticket extension" \ |
| 3826 | -c "parse new session ticket" \ |
| 3827 | -S "session successfully restored from cache" \ |
| 3828 | -s "session successfully restored from ticket" \ |
| 3829 | -s "a session has been resumed" \ |
| 3830 | -c "a session has been resumed" |
| 3831 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3832 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3833 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3834 | "$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] | 3835 | "$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] | 3836 | 0 \ |
| 3837 | -c "client hello, adding session ticket extension" \ |
| 3838 | -s "found session ticket extension" \ |
| 3839 | -s "server hello, adding session ticket extension" \ |
| 3840 | -c "found session_ticket extension" \ |
| 3841 | -c "parse new session ticket" \ |
| 3842 | -S "session successfully restored from cache" \ |
| 3843 | -S "session successfully restored from ticket" \ |
| 3844 | -S "a session has been resumed" \ |
| 3845 | -C "a session has been resumed" |
| 3846 | |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3847 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3848 | run_test "Session resume using tickets: session copy" \ |
| 3849 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3850 | "$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] | 3851 | 0 \ |
| 3852 | -c "client hello, adding session ticket extension" \ |
| 3853 | -s "found session ticket extension" \ |
| 3854 | -s "server hello, adding session ticket extension" \ |
| 3855 | -c "found session_ticket extension" \ |
| 3856 | -c "parse new session ticket" \ |
| 3857 | -S "session successfully restored from cache" \ |
| 3858 | -s "session successfully restored from ticket" \ |
| 3859 | -s "a session has been resumed" \ |
| 3860 | -c "a session has been resumed" |
| 3861 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3862 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3863 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3864 | run_test "Session resume using tickets: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 3865 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3866 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3867 | 0 \ |
| 3868 | -c "client hello, adding session ticket extension" \ |
| 3869 | -c "found session_ticket extension" \ |
| 3870 | -c "parse new session ticket" \ |
| 3871 | -c "a session has been resumed" |
| 3872 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 3873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3874 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3875 | run_test "Session resume using tickets: openssl client" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 3876 | "$P_SRV force_version=tls12 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3877 | "( $O_CLI -sess_out $SESSION; \ |
| 3878 | $O_CLI -sess_in $SESSION; \ |
| 3879 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3880 | 0 \ |
| 3881 | -s "found session ticket extension" \ |
| 3882 | -s "server hello, adding session ticket extension" \ |
| 3883 | -S "session successfully restored from cache" \ |
| 3884 | -s "session successfully restored from ticket" \ |
| 3885 | -s "a session has been resumed" |
| 3886 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3887 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3888 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3889 | run_test "Session resume using tickets: AES-128-GCM" \ |
| 3890 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3891 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3892 | 0 \ |
| 3893 | -c "client hello, adding session ticket extension" \ |
| 3894 | -s "found session ticket extension" \ |
| 3895 | -s "server hello, adding session ticket extension" \ |
| 3896 | -c "found session_ticket extension" \ |
| 3897 | -c "parse new session ticket" \ |
| 3898 | -S "session successfully restored from cache" \ |
| 3899 | -s "session successfully restored from ticket" \ |
| 3900 | -s "a session has been resumed" \ |
| 3901 | -c "a session has been resumed" |
| 3902 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3903 | requires_cipher_enabled "AES" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3904 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3905 | run_test "Session resume using tickets: AES-192-GCM" \ |
| 3906 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3907 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3908 | 0 \ |
| 3909 | -c "client hello, adding session ticket extension" \ |
| 3910 | -s "found session ticket extension" \ |
| 3911 | -s "server hello, adding session ticket extension" \ |
| 3912 | -c "found session_ticket extension" \ |
| 3913 | -c "parse new session ticket" \ |
| 3914 | -S "session successfully restored from cache" \ |
| 3915 | -s "session successfully restored from ticket" \ |
| 3916 | -s "a session has been resumed" \ |
| 3917 | -c "a session has been resumed" |
| 3918 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3919 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3920 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3921 | run_test "Session resume using tickets: AES-128-CCM" \ |
| 3922 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3923 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3924 | 0 \ |
| 3925 | -c "client hello, adding session ticket extension" \ |
| 3926 | -s "found session ticket extension" \ |
| 3927 | -s "server hello, adding session ticket extension" \ |
| 3928 | -c "found session_ticket extension" \ |
| 3929 | -c "parse new session ticket" \ |
| 3930 | -S "session successfully restored from cache" \ |
| 3931 | -s "session successfully restored from ticket" \ |
| 3932 | -s "a session has been resumed" \ |
| 3933 | -c "a session has been resumed" |
| 3934 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3935 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3936 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3937 | run_test "Session resume using tickets: AES-192-CCM" \ |
| 3938 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3939 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3940 | 0 \ |
| 3941 | -c "client hello, adding session ticket extension" \ |
| 3942 | -s "found session ticket extension" \ |
| 3943 | -s "server hello, adding session ticket extension" \ |
| 3944 | -c "found session_ticket extension" \ |
| 3945 | -c "parse new session ticket" \ |
| 3946 | -S "session successfully restored from cache" \ |
| 3947 | -s "session successfully restored from ticket" \ |
| 3948 | -s "a session has been resumed" \ |
| 3949 | -c "a session has been resumed" |
| 3950 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3951 | requires_cipher_enabled "AES" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3952 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3953 | run_test "Session resume using tickets: AES-256-CCM" \ |
| 3954 | "$P_SRV debug_level=3 tickets=1 ticket_aead=AES-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3955 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3956 | 0 \ |
| 3957 | -c "client hello, adding session ticket extension" \ |
| 3958 | -s "found session ticket extension" \ |
| 3959 | -s "server hello, adding session ticket extension" \ |
| 3960 | -c "found session_ticket extension" \ |
| 3961 | -c "parse new session ticket" \ |
| 3962 | -S "session successfully restored from cache" \ |
| 3963 | -s "session successfully restored from ticket" \ |
| 3964 | -s "a session has been resumed" \ |
| 3965 | -c "a session has been resumed" |
| 3966 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3967 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3968 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3969 | run_test "Session resume using tickets: CAMELLIA-128-CCM" \ |
| 3970 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3971 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3972 | 0 \ |
| 3973 | -c "client hello, adding session ticket extension" \ |
| 3974 | -s "found session ticket extension" \ |
| 3975 | -s "server hello, adding session ticket extension" \ |
| 3976 | -c "found session_ticket extension" \ |
| 3977 | -c "parse new session ticket" \ |
| 3978 | -S "session successfully restored from cache" \ |
| 3979 | -s "session successfully restored from ticket" \ |
| 3980 | -s "a session has been resumed" \ |
| 3981 | -c "a session has been resumed" |
| 3982 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3983 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 3984 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3985 | run_test "Session resume using tickets: CAMELLIA-192-CCM" \ |
| 3986 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 3987 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 3988 | 0 \ |
| 3989 | -c "client hello, adding session ticket extension" \ |
| 3990 | -s "found session ticket extension" \ |
| 3991 | -s "server hello, adding session ticket extension" \ |
| 3992 | -c "found session_ticket extension" \ |
| 3993 | -c "parse new session ticket" \ |
| 3994 | -S "session successfully restored from cache" \ |
| 3995 | -s "session successfully restored from ticket" \ |
| 3996 | -s "a session has been resumed" \ |
| 3997 | -c "a session has been resumed" |
| 3998 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 3999 | requires_cipher_enabled "CAMELLIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4000 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4001 | run_test "Session resume using tickets: CAMELLIA-256-CCM" \ |
| 4002 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CAMELLIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4003 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4004 | 0 \ |
| 4005 | -c "client hello, adding session ticket extension" \ |
| 4006 | -s "found session ticket extension" \ |
| 4007 | -s "server hello, adding session ticket extension" \ |
| 4008 | -c "found session_ticket extension" \ |
| 4009 | -c "parse new session ticket" \ |
| 4010 | -S "session successfully restored from cache" \ |
| 4011 | -s "session successfully restored from ticket" \ |
| 4012 | -s "a session has been resumed" \ |
| 4013 | -c "a session has been resumed" |
| 4014 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4015 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4016 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4017 | run_test "Session resume using tickets: ARIA-128-GCM" \ |
| 4018 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4019 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4020 | 0 \ |
| 4021 | -c "client hello, adding session ticket extension" \ |
| 4022 | -s "found session ticket extension" \ |
| 4023 | -s "server hello, adding session ticket extension" \ |
| 4024 | -c "found session_ticket extension" \ |
| 4025 | -c "parse new session ticket" \ |
| 4026 | -S "session successfully restored from cache" \ |
| 4027 | -s "session successfully restored from ticket" \ |
| 4028 | -s "a session has been resumed" \ |
| 4029 | -c "a session has been resumed" |
| 4030 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4031 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4032 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4033 | run_test "Session resume using tickets: ARIA-192-GCM" \ |
| 4034 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4035 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4036 | 0 \ |
| 4037 | -c "client hello, adding session ticket extension" \ |
| 4038 | -s "found session ticket extension" \ |
| 4039 | -s "server hello, adding session ticket extension" \ |
| 4040 | -c "found session_ticket extension" \ |
| 4041 | -c "parse new session ticket" \ |
| 4042 | -S "session successfully restored from cache" \ |
| 4043 | -s "session successfully restored from ticket" \ |
| 4044 | -s "a session has been resumed" \ |
| 4045 | -c "a session has been resumed" |
| 4046 | |
Valerio Setti | 04c85e1 | 2023-11-13 10:54:05 +0100 | [diff] [blame] | 4047 | requires_cipher_enabled "ARIA" "GCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4048 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4049 | run_test "Session resume using tickets: ARIA-256-GCM" \ |
| 4050 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-GCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4051 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +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 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4063 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4064 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4065 | run_test "Session resume using tickets: ARIA-128-CCM" \ |
| 4066 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-128-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4067 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4068 | 0 \ |
| 4069 | -c "client hello, adding session ticket extension" \ |
| 4070 | -s "found session ticket extension" \ |
| 4071 | -s "server hello, adding session ticket extension" \ |
| 4072 | -c "found session_ticket extension" \ |
| 4073 | -c "parse new session ticket" \ |
| 4074 | -S "session successfully restored from cache" \ |
| 4075 | -s "session successfully restored from ticket" \ |
| 4076 | -s "a session has been resumed" \ |
| 4077 | -c "a session has been resumed" |
| 4078 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4079 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4080 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4081 | run_test "Session resume using tickets: ARIA-192-CCM" \ |
| 4082 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-192-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4083 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4084 | 0 \ |
| 4085 | -c "client hello, adding session ticket extension" \ |
| 4086 | -s "found session ticket extension" \ |
| 4087 | -s "server hello, adding session ticket extension" \ |
| 4088 | -c "found session_ticket extension" \ |
| 4089 | -c "parse new session ticket" \ |
| 4090 | -S "session successfully restored from cache" \ |
| 4091 | -s "session successfully restored from ticket" \ |
| 4092 | -s "a session has been resumed" \ |
| 4093 | -c "a session has been resumed" |
| 4094 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4095 | requires_cipher_enabled "ARIA" "CCM" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4096 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4097 | run_test "Session resume using tickets: ARIA-256-CCM" \ |
| 4098 | "$P_SRV debug_level=3 tickets=1 ticket_aead=ARIA-256-CCM" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4099 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 6e5aae6 | 2022-01-12 16:29:58 +0100 | [diff] [blame] | 4100 | 0 \ |
| 4101 | -c "client hello, adding session ticket extension" \ |
| 4102 | -s "found session ticket extension" \ |
| 4103 | -s "server hello, adding session ticket extension" \ |
| 4104 | -c "found session_ticket extension" \ |
| 4105 | -c "parse new session ticket" \ |
| 4106 | -S "session successfully restored from cache" \ |
| 4107 | -s "session successfully restored from ticket" \ |
| 4108 | -s "a session has been resumed" \ |
| 4109 | -c "a session has been resumed" |
| 4110 | |
Valerio Setti | 73d0531 | 2023-11-09 16:53:59 +0100 | [diff] [blame] | 4111 | requires_cipher_enabled "CHACHA20" |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4112 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4113 | run_test "Session resume using tickets: CHACHA20-POLY1305" \ |
| 4114 | "$P_SRV debug_level=3 tickets=1 ticket_aead=CHACHA20-POLY1305" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4115 | "$P_CLI force_version=tls12 debug_level=3 tickets=1 reconnect=1" \ |
Gabor Mezei | 49c8eb3 | 2022-03-10 16:13:17 +0100 | [diff] [blame] | 4116 | 0 \ |
| 4117 | -c "client hello, adding session ticket extension" \ |
| 4118 | -s "found session ticket extension" \ |
| 4119 | -s "server hello, adding session ticket extension" \ |
| 4120 | -c "found session_ticket extension" \ |
| 4121 | -c "parse new session ticket" \ |
| 4122 | -S "session successfully restored from cache" \ |
| 4123 | -s "session successfully restored from ticket" \ |
| 4124 | -s "a session has been resumed" \ |
| 4125 | -c "a session has been resumed" |
| 4126 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4127 | # Tests for Session Tickets with DTLS |
| 4128 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4129 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4130 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4131 | run_test "Session resume using tickets, DTLS: basic" \ |
| 4132 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4133 | "$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] | 4134 | 0 \ |
| 4135 | -c "client hello, adding session ticket extension" \ |
| 4136 | -s "found session ticket extension" \ |
| 4137 | -s "server hello, adding session ticket extension" \ |
| 4138 | -c "found session_ticket extension" \ |
| 4139 | -c "parse new session ticket" \ |
| 4140 | -S "session successfully restored from cache" \ |
| 4141 | -s "session successfully restored from ticket" \ |
| 4142 | -s "a session has been resumed" \ |
| 4143 | -c "a session has been resumed" |
| 4144 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4145 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4146 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4147 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 4148 | "$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] | 4149 | "$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] | 4150 | 0 \ |
| 4151 | -c "client hello, adding session ticket extension" \ |
| 4152 | -s "found session ticket extension" \ |
| 4153 | -s "server hello, adding session ticket extension" \ |
| 4154 | -c "found session_ticket extension" \ |
| 4155 | -c "parse new session ticket" \ |
| 4156 | -S "session successfully restored from cache" \ |
| 4157 | -s "session successfully restored from ticket" \ |
| 4158 | -s "a session has been resumed" \ |
| 4159 | -c "a session has been resumed" |
| 4160 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4161 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4162 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4163 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 4164 | "$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] | 4165 | "$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] | 4166 | 0 \ |
| 4167 | -c "client hello, adding session ticket extension" \ |
| 4168 | -s "found session ticket extension" \ |
| 4169 | -s "server hello, adding session ticket extension" \ |
| 4170 | -c "found session_ticket extension" \ |
| 4171 | -c "parse new session ticket" \ |
| 4172 | -S "session successfully restored from cache" \ |
| 4173 | -S "session successfully restored from ticket" \ |
| 4174 | -S "a session has been resumed" \ |
| 4175 | -C "a session has been resumed" |
| 4176 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4177 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4178 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4179 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 4180 | "$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] | 4181 | "$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] | 4182 | 0 \ |
| 4183 | -c "client hello, adding session ticket extension" \ |
| 4184 | -s "found session ticket extension" \ |
| 4185 | -s "server hello, adding session ticket extension" \ |
| 4186 | -c "found session_ticket extension" \ |
| 4187 | -c "parse new session ticket" \ |
| 4188 | -S "session successfully restored from cache" \ |
| 4189 | -s "session successfully restored from ticket" \ |
| 4190 | -s "a session has been resumed" \ |
| 4191 | -c "a session has been resumed" |
| 4192 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4193 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4194 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4195 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 4196 | "$O_SRV -dtls" \ |
| 4197 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 4198 | 0 \ |
| 4199 | -c "client hello, adding session ticket extension" \ |
| 4200 | -c "found session_ticket extension" \ |
| 4201 | -c "parse new session ticket" \ |
| 4202 | -c "a session has been resumed" |
| 4203 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4204 | # 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] | 4205 | # 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] | 4206 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4207 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4208 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4209 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 4210 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4211 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4212 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4213 | rm -f $SESSION )" \ |
| 4214 | 0 \ |
| 4215 | -s "found session ticket extension" \ |
| 4216 | -s "server hello, adding session ticket extension" \ |
| 4217 | -S "session successfully restored from cache" \ |
| 4218 | -s "session successfully restored from ticket" \ |
| 4219 | -s "a session has been resumed" |
| 4220 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4221 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4222 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4223 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4224 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4225 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4226 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4227 | "$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] | 4228 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4229 | -c "client hello, adding session ticket extension" \ |
| 4230 | -s "found session ticket extension" \ |
| 4231 | -S "server hello, adding session ticket extension" \ |
| 4232 | -C "found session_ticket extension" \ |
| 4233 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4234 | -s "session successfully restored from cache" \ |
| 4235 | -S "session successfully restored from ticket" \ |
| 4236 | -s "a session has been resumed" \ |
| 4237 | -c "a session has been resumed" |
| 4238 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4239 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4240 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4241 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4242 | "$P_SRV debug_level=3 tickets=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4243 | "$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] | 4244 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4245 | -C "client hello, adding session ticket extension" \ |
| 4246 | -S "found session ticket extension" \ |
| 4247 | -S "server hello, adding session ticket extension" \ |
| 4248 | -C "found session_ticket extension" \ |
| 4249 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 4250 | -s "session successfully restored from cache" \ |
| 4251 | -S "session successfully restored from ticket" \ |
| 4252 | -s "a session has been resumed" \ |
| 4253 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4254 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4255 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4256 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4257 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4258 | "$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] | 4259 | 0 \ |
| 4260 | -S "session successfully restored from cache" \ |
| 4261 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 4262 | -S "a session has been resumed" \ |
| 4263 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 4264 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4265 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4266 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4267 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4268 | "$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] | 4269 | 0 \ |
| 4270 | -s "session successfully restored from cache" \ |
| 4271 | -S "session successfully restored from ticket" \ |
| 4272 | -s "a session has been resumed" \ |
| 4273 | -c "a session has been resumed" |
| 4274 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4275 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4276 | run_test "Session resume using cache: cache removed" \ |
| 4277 | "$P_SRV debug_level=3 tickets=0 cache_remove=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4278 | "$P_CLI force_version=tls12 debug_level=3 tickets=0 reconnect=1" \ |
Pengyu Lv | 62ed1aa | 2023-03-07 14:52:47 +0800 | [diff] [blame] | 4279 | 0 \ |
| 4280 | -C "client hello, adding session ticket extension" \ |
| 4281 | -S "found session ticket extension" \ |
| 4282 | -S "server hello, adding session ticket extension" \ |
| 4283 | -C "found session_ticket extension" \ |
| 4284 | -C "parse new session ticket" \ |
| 4285 | -S "session successfully restored from cache" \ |
| 4286 | -S "session successfully restored from ticket" \ |
| 4287 | -S "a session has been resumed" \ |
| 4288 | -C "a session has been resumed" |
| 4289 | |
| 4290 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4291 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 4292 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4293 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4294 | "$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] | 4295 | 0 \ |
| 4296 | -s "session successfully restored from cache" \ |
| 4297 | -S "session successfully restored from ticket" \ |
| 4298 | -s "a session has been resumed" \ |
| 4299 | -c "a session has been resumed" |
| 4300 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4301 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4302 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4303 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4304 | "$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] | 4305 | 0 \ |
| 4306 | -S "session successfully restored from cache" \ |
| 4307 | -S "session successfully restored from ticket" \ |
| 4308 | -S "a session has been resumed" \ |
| 4309 | -C "a session has been resumed" |
| 4310 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4311 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4312 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4313 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4314 | "$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] | 4315 | 0 \ |
| 4316 | -s "session successfully restored from cache" \ |
| 4317 | -S "session successfully restored from ticket" \ |
| 4318 | -s "a session has been resumed" \ |
| 4319 | -c "a session has been resumed" |
| 4320 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4321 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4322 | run_test "Session resume using cache: session copy" \ |
| 4323 | "$P_SRV debug_level=3 tickets=0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4324 | "$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] | 4325 | 0 \ |
| 4326 | -s "session successfully restored from cache" \ |
| 4327 | -S "session successfully restored from ticket" \ |
| 4328 | -s "a session has been resumed" \ |
| 4329 | -c "a session has been resumed" |
| 4330 | |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4331 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4332 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4333 | run_test "Session resume using cache: openssl client" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 4334 | "$P_SRV force_version=tls12 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 4335 | "( $O_CLI -sess_out $SESSION; \ |
| 4336 | $O_CLI -sess_in $SESSION; \ |
| 4337 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4338 | 0 \ |
| 4339 | -s "found session ticket extension" \ |
| 4340 | -S "server hello, adding session ticket extension" \ |
| 4341 | -s "session successfully restored from cache" \ |
| 4342 | -S "session successfully restored from ticket" \ |
| 4343 | -s "a session has been resumed" |
| 4344 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4345 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4346 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4347 | run_test "Session resume using cache: openssl server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4348 | "$O_SRV -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4349 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 4350 | 0 \ |
| 4351 | -C "found session_ticket extension" \ |
| 4352 | -C "parse new session ticket" \ |
| 4353 | -c "a session has been resumed" |
| 4354 | |
Andrzej Kurek | 7cf8725 | 2022-06-14 07:12:33 -0400 | [diff] [blame] | 4355 | # Tests for Session resume and extensions |
| 4356 | |
| 4357 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4358 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 4359 | run_test "Session resume and connection ID" \ |
| 4360 | "$P_SRV debug_level=3 cid=1 cid_val=dead dtls=1 tickets=0" \ |
| 4361 | "$P_CLI debug_level=3 cid=1 cid_val=beef dtls=1 tickets=0 reconnect=1" \ |
| 4362 | 0 \ |
| 4363 | -c "Enable use of CID extension." \ |
| 4364 | -s "Enable use of CID extension." \ |
| 4365 | -c "client hello, adding CID extension" \ |
| 4366 | -s "found CID extension" \ |
| 4367 | -s "Use of CID extension negotiated" \ |
| 4368 | -s "server hello, adding CID extension" \ |
| 4369 | -c "found CID extension" \ |
| 4370 | -c "Use of CID extension negotiated" \ |
| 4371 | -s "Copy CIDs into SSL transform" \ |
| 4372 | -c "Copy CIDs into SSL transform" \ |
| 4373 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 4374 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 4375 | -s "Use of Connection ID has been negotiated" \ |
| 4376 | -c "Use of Connection ID has been negotiated" |
| 4377 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4378 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 4379 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4380 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4381 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4382 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4383 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 4384 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4385 | "$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] | 4386 | 0 \ |
| 4387 | -c "client hello, adding session ticket extension" \ |
| 4388 | -s "found session ticket extension" \ |
| 4389 | -S "server hello, adding session ticket extension" \ |
| 4390 | -C "found session_ticket extension" \ |
| 4391 | -C "parse new session ticket" \ |
| 4392 | -s "session successfully restored from cache" \ |
| 4393 | -S "session successfully restored from ticket" \ |
| 4394 | -s "a session has been resumed" \ |
| 4395 | -c "a session has been resumed" |
| 4396 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4397 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4398 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4399 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4400 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 4401 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4402 | "$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] | 4403 | 0 \ |
| 4404 | -C "client hello, adding session ticket extension" \ |
| 4405 | -S "found session ticket extension" \ |
| 4406 | -S "server hello, adding session ticket extension" \ |
| 4407 | -C "found session_ticket extension" \ |
| 4408 | -C "parse new session ticket" \ |
| 4409 | -s "session successfully restored from cache" \ |
| 4410 | -S "session successfully restored from ticket" \ |
| 4411 | -s "a session has been resumed" \ |
| 4412 | -c "a session has been resumed" |
| 4413 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4414 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4415 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4416 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 4417 | "$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] | 4418 | "$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] | 4419 | 0 \ |
| 4420 | -S "session successfully restored from cache" \ |
| 4421 | -S "session successfully restored from ticket" \ |
| 4422 | -S "a session has been resumed" \ |
| 4423 | -C "a session has been resumed" |
| 4424 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4425 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4426 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4427 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 4428 | "$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] | 4429 | "$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] | 4430 | 0 \ |
| 4431 | -s "session successfully restored from cache" \ |
| 4432 | -S "session successfully restored from ticket" \ |
| 4433 | -s "a session has been resumed" \ |
| 4434 | -c "a session has been resumed" |
| 4435 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4436 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4437 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4438 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 4439 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4440 | "$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] | 4441 | 0 \ |
| 4442 | -s "session successfully restored from cache" \ |
| 4443 | -S "session successfully restored from ticket" \ |
| 4444 | -s "a session has been resumed" \ |
| 4445 | -c "a session has been resumed" |
| 4446 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4447 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4448 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4449 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 4450 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4451 | "$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] | 4452 | 0 \ |
| 4453 | -S "session successfully restored from cache" \ |
| 4454 | -S "session successfully restored from ticket" \ |
| 4455 | -S "a session has been resumed" \ |
| 4456 | -C "a session has been resumed" |
| 4457 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4458 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4459 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 4460 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 4461 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 4462 | "$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] | 4463 | 0 \ |
| 4464 | -s "session successfully restored from cache" \ |
| 4465 | -S "session successfully restored from ticket" \ |
| 4466 | -s "a session has been resumed" \ |
| 4467 | -c "a session has been resumed" |
| 4468 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4469 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4470 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 4471 | run_test "Session resume using cache, DTLS: session copy" \ |
| 4472 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 4473 | "$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] | 4474 | 0 \ |
| 4475 | -s "session successfully restored from cache" \ |
| 4476 | -S "session successfully restored from ticket" \ |
| 4477 | -s "a session has been resumed" \ |
| 4478 | -c "a session has been resumed" |
| 4479 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4480 | # 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] | 4481 | # 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] | 4482 | requires_openssl_next |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4483 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4484 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 4485 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4486 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 4487 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 4488 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 4489 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4490 | rm -f $SESSION )" \ |
| 4491 | 0 \ |
| 4492 | -s "found session ticket extension" \ |
| 4493 | -S "server hello, adding session ticket extension" \ |
| 4494 | -s "session successfully restored from cache" \ |
| 4495 | -S "session successfully restored from ticket" \ |
| 4496 | -s "a session has been resumed" |
| 4497 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4498 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 4499 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 4500 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 4501 | "$O_SRV -dtls" \ |
| 4502 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 4503 | 0 \ |
| 4504 | -C "found session_ticket extension" \ |
| 4505 | -C "parse new session ticket" \ |
| 4506 | -c "a session has been resumed" |
| 4507 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4508 | # Tests for Max Fragment Length extension |
| 4509 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4510 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4511 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4512 | run_test "Max fragment length: enabled, default" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4513 | "$P_SRV debug_level=3 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4514 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4515 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4516 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4517 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4518 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4519 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4520 | -C "client hello, adding max_fragment_length extension" \ |
| 4521 | -S "found max fragment length extension" \ |
| 4522 | -S "server hello, max_fragment_length extension" \ |
| 4523 | -C "found max_fragment_length extension" |
| 4524 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4525 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4527 | run_test "Max fragment length: enabled, default, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4528 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4529 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4530 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4531 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4532 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4533 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4534 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4535 | -C "client hello, adding max_fragment_length extension" \ |
| 4536 | -S "found max fragment length extension" \ |
| 4537 | -S "server hello, max_fragment_length extension" \ |
| 4538 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4539 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4540 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4541 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4542 | |
| 4543 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4545 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 4546 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4547 | "$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] | 4548 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4549 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4550 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4551 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4552 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4553 | -C "client hello, adding max_fragment_length extension" \ |
| 4554 | -S "found max fragment length extension" \ |
| 4555 | -S "server hello, max_fragment_length extension" \ |
| 4556 | -C "found max_fragment_length extension" \ |
| 4557 | -c "fragment larger than.*maximum " |
| 4558 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4559 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 4560 | # (session fragment length will be 16384 regardless of mbedtls |
| 4561 | # content length configuration.) |
| 4562 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4563 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4564 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4565 | run_test "Max fragment length: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4566 | "$P_SRV debug_level=3 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4567 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4568 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4569 | -C "Maximum incoming record payload length is 16384" \ |
| 4570 | -C "Maximum outgoing record payload length is 16384" \ |
| 4571 | -S "Maximum incoming record payload length is 16384" \ |
| 4572 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4573 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 4574 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 4575 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4576 | |
| 4577 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4578 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 4579 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Waleed Elmelegy | 3d46b7f | 2024-01-01 20:50:53 +0000 | [diff] [blame] | 4580 | "$P_SRV debug_level=3 dtls=1 force_version=tls12" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4581 | "$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] | 4582 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4583 | -C "Maximum incoming record payload length is 16384" \ |
| 4584 | -C "Maximum outgoing record payload length is 16384" \ |
| 4585 | -S "Maximum incoming record payload length is 16384" \ |
| 4586 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4587 | -c "fragment larger than.*maximum " |
| 4588 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4589 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 4590 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4591 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4592 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4593 | "$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] | 4594 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4595 | -c "Maximum incoming record payload length is 4096" \ |
| 4596 | -c "Maximum outgoing record payload length is 4096" \ |
| 4597 | -s "Maximum incoming record payload length is 4096" \ |
| 4598 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4599 | -c "client hello, adding max_fragment_length extension" \ |
| 4600 | -s "found max fragment length extension" \ |
| 4601 | -s "server hello, max_fragment_length extension" \ |
| 4602 | -c "found max_fragment_length extension" |
| 4603 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4604 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4605 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4606 | run_test "Max fragment length: client 512, server 1024" \ |
| 4607 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4608 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4609 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4610 | -c "Maximum incoming record payload length is 512" \ |
| 4611 | -c "Maximum outgoing record payload length is 512" \ |
| 4612 | -s "Maximum incoming record payload length is 512" \ |
| 4613 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4614 | -c "client hello, adding max_fragment_length extension" \ |
| 4615 | -s "found max fragment length extension" \ |
| 4616 | -s "server hello, max_fragment_length extension" \ |
| 4617 | -c "found max_fragment_length extension" |
| 4618 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4619 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4620 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4621 | run_test "Max fragment length: client 512, server 2048" \ |
| 4622 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4623 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4624 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4625 | -c "Maximum incoming record payload length is 512" \ |
| 4626 | -c "Maximum outgoing record payload length is 512" \ |
| 4627 | -s "Maximum incoming record payload length is 512" \ |
| 4628 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4629 | -c "client hello, adding max_fragment_length extension" \ |
| 4630 | -s "found max fragment length extension" \ |
| 4631 | -s "server hello, max_fragment_length extension" \ |
| 4632 | -c "found max_fragment_length extension" |
| 4633 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4634 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4635 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4636 | run_test "Max fragment length: client 512, server 4096" \ |
| 4637 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4638 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4639 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4640 | -c "Maximum incoming record payload length is 512" \ |
| 4641 | -c "Maximum outgoing record payload length is 512" \ |
| 4642 | -s "Maximum incoming record payload length is 512" \ |
| 4643 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4644 | -c "client hello, adding max_fragment_length extension" \ |
| 4645 | -s "found max fragment length extension" \ |
| 4646 | -s "server hello, max_fragment_length extension" \ |
| 4647 | -c "found max_fragment_length extension" |
| 4648 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4649 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4650 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4651 | run_test "Max fragment length: client 1024, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4652 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4653 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 4654 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4655 | -c "Maximum incoming record payload length is 1024" \ |
| 4656 | -c "Maximum outgoing record payload length is 1024" \ |
| 4657 | -s "Maximum incoming record payload length is 1024" \ |
| 4658 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4659 | -c "client hello, adding max_fragment_length extension" \ |
| 4660 | -s "found max fragment length extension" \ |
| 4661 | -s "server hello, max_fragment_length extension" \ |
| 4662 | -c "found max_fragment_length extension" |
| 4663 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4664 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4665 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4666 | run_test "Max fragment length: client 1024, server 2048" \ |
| 4667 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4668 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4669 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4670 | -c "Maximum incoming record payload length is 1024" \ |
| 4671 | -c "Maximum outgoing record payload length is 1024" \ |
| 4672 | -s "Maximum incoming record payload length is 1024" \ |
| 4673 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4674 | -c "client hello, adding max_fragment_length extension" \ |
| 4675 | -s "found max fragment length extension" \ |
| 4676 | -s "server hello, max_fragment_length extension" \ |
| 4677 | -c "found max_fragment_length extension" |
| 4678 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4679 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4680 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4681 | run_test "Max fragment length: client 1024, server 4096" \ |
| 4682 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4683 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4684 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4685 | -c "Maximum incoming record payload length is 1024" \ |
| 4686 | -c "Maximum outgoing record payload length is 1024" \ |
| 4687 | -s "Maximum incoming record payload length is 1024" \ |
| 4688 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4689 | -c "client hello, adding max_fragment_length extension" \ |
| 4690 | -s "found max fragment length extension" \ |
| 4691 | -s "server hello, max_fragment_length extension" \ |
| 4692 | -c "found max_fragment_length extension" |
| 4693 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4694 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4695 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4696 | run_test "Max fragment length: client 2048, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4697 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4698 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4699 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4700 | -c "Maximum incoming record payload length is 2048" \ |
| 4701 | -c "Maximum outgoing record payload length is 2048" \ |
| 4702 | -s "Maximum incoming record payload length is 2048" \ |
| 4703 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4704 | -c "client hello, adding max_fragment_length extension" \ |
| 4705 | -s "found max fragment length extension" \ |
| 4706 | -s "server hello, max_fragment_length extension" \ |
| 4707 | -c "found max_fragment_length extension" |
| 4708 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4709 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4710 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4711 | run_test "Max fragment length: client 2048, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4712 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4713 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 4714 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4715 | -c "Maximum incoming record payload length is 2048" \ |
| 4716 | -c "Maximum outgoing record payload length is 2048" \ |
| 4717 | -s "Maximum incoming record payload length is 2048" \ |
| 4718 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4719 | -c "client hello, adding max_fragment_length extension" \ |
| 4720 | -s "found max fragment length extension" \ |
| 4721 | -s "server hello, max_fragment_length extension" \ |
| 4722 | -c "found max_fragment_length extension" |
| 4723 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4724 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4725 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4726 | run_test "Max fragment length: client 2048, server 4096" \ |
| 4727 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4728 | "$P_CLI force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4729 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4730 | -c "Maximum incoming record payload length is 2048" \ |
| 4731 | -c "Maximum outgoing record payload length is 2048" \ |
| 4732 | -s "Maximum incoming record payload length is 2048" \ |
| 4733 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4734 | -c "client hello, adding max_fragment_length extension" \ |
| 4735 | -s "found max fragment length extension" \ |
| 4736 | -s "server hello, max_fragment_length extension" \ |
| 4737 | -c "found max_fragment_length extension" |
| 4738 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4739 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4740 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4741 | run_test "Max fragment length: client 4096, server 512" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4742 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4743 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4744 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4745 | -c "Maximum incoming record payload length is 4096" \ |
| 4746 | -c "Maximum outgoing record payload length is 4096" \ |
| 4747 | -s "Maximum incoming record payload length is 4096" \ |
| 4748 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4749 | -c "client hello, adding max_fragment_length extension" \ |
| 4750 | -s "found max fragment length extension" \ |
| 4751 | -s "server hello, max_fragment_length extension" \ |
| 4752 | -c "found max_fragment_length extension" |
| 4753 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4754 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4755 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4756 | run_test "Max fragment length: client 4096, server 1024" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4757 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4758 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4759 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4760 | -c "Maximum incoming record payload length is 4096" \ |
| 4761 | -c "Maximum outgoing record payload length is 4096" \ |
| 4762 | -s "Maximum incoming record payload length is 4096" \ |
| 4763 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4764 | -c "client hello, adding max_fragment_length extension" \ |
| 4765 | -s "found max fragment length extension" \ |
| 4766 | -s "server hello, max_fragment_length extension" \ |
| 4767 | -c "found max_fragment_length extension" |
| 4768 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4769 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4770 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 4771 | run_test "Max fragment length: client 4096, server 2048" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4772 | "$P_SRV force_version=tls12 debug_level=3 max_frag_len=2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 4773 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 4774 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4775 | -c "Maximum incoming record payload length is 4096" \ |
| 4776 | -c "Maximum outgoing record payload length is 4096" \ |
| 4777 | -s "Maximum incoming record payload length is 4096" \ |
| 4778 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4779 | -c "client hello, adding max_fragment_length extension" \ |
| 4780 | -s "found max fragment length extension" \ |
| 4781 | -s "server hello, max_fragment_length extension" \ |
| 4782 | -c "found max_fragment_length extension" |
| 4783 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4784 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4785 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4786 | run_test "Max fragment length: used by server" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4787 | "$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] | 4788 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4789 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4790 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4791 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 4792 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 4793 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 4794 | -C "client hello, adding max_fragment_length extension" \ |
| 4795 | -S "found max fragment length extension" \ |
| 4796 | -S "server hello, max_fragment_length extension" \ |
| 4797 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 4798 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4799 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4800 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4801 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4802 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4803 | run_test "Max fragment length: gnutls server" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 4804 | "$G_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4805 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4806 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4807 | -c "Maximum incoming record payload length is 4096" \ |
| 4808 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 4809 | -c "client hello, adding max_fragment_length extension" \ |
| 4810 | -c "found max_fragment_length extension" |
| 4811 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4812 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4813 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4814 | run_test "Max fragment length: client, message just fits" \ |
| 4815 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4816 | "$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] | 4817 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4818 | -c "Maximum incoming record payload length is 2048" \ |
| 4819 | -c "Maximum outgoing record payload length is 2048" \ |
| 4820 | -s "Maximum incoming record payload length is 2048" \ |
| 4821 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4822 | -c "client hello, adding max_fragment_length extension" \ |
| 4823 | -s "found max fragment length extension" \ |
| 4824 | -s "server hello, max_fragment_length extension" \ |
| 4825 | -c "found max_fragment_length extension" \ |
| 4826 | -c "2048 bytes written in 1 fragments" \ |
| 4827 | -s "2048 bytes read" |
| 4828 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4829 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4830 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4831 | run_test "Max fragment length: client, larger message" \ |
| 4832 | "$P_SRV debug_level=3" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 4833 | "$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] | 4834 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4835 | -c "Maximum incoming record payload length is 2048" \ |
| 4836 | -c "Maximum outgoing record payload length is 2048" \ |
| 4837 | -s "Maximum incoming record payload length is 2048" \ |
| 4838 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4839 | -c "client hello, adding max_fragment_length extension" \ |
| 4840 | -s "found max fragment length extension" \ |
| 4841 | -s "server hello, max_fragment_length extension" \ |
| 4842 | -c "found max_fragment_length extension" \ |
| 4843 | -c "2345 bytes written in 2 fragments" \ |
| 4844 | -s "2048 bytes read" \ |
| 4845 | -s "297 bytes read" |
| 4846 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 4847 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 4848 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 4849 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 4850 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4851 | "$P_SRV debug_level=3 dtls=1" \ |
| 4852 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 4853 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 4854 | -c "Maximum incoming record payload length is 2048" \ |
| 4855 | -c "Maximum outgoing record payload length is 2048" \ |
| 4856 | -s "Maximum incoming record payload length is 2048" \ |
| 4857 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 4858 | -c "client hello, adding max_fragment_length extension" \ |
| 4859 | -s "found max fragment length extension" \ |
| 4860 | -s "server hello, max_fragment_length extension" \ |
| 4861 | -c "found max_fragment_length extension" \ |
| 4862 | -c "fragment larger than.*maximum" |
| 4863 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4864 | # Tests for Record Size Limit extension |
| 4865 | |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4866 | requires_gnutls_tls1_3 |
| 4867 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4868 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4869 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4870 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4871 | run_test "Record Size Limit: TLS 1.3: Server-side parsing and debug output" \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4872 | "$P_SRV debug_level=3 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4873 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4874 | 0 \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4875 | -s "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4876 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4877 | -s "Maximum outgoing record payload length is 16383" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4878 | -s "bytes written in 1 fragments" |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4879 | |
| 4880 | requires_gnutls_tls1_3 |
| 4881 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4882 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4883 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4884 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4885 | run_test "Record Size Limit: TLS 1.3: Client-side parsing and debug output" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4886 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL --disable-client-cert -d 4" \ |
Jan Bruckner | 151f642 | 2023-02-10 12:45:19 +0100 | [diff] [blame] | 4887 | "$P_CLI debug_level=4 force_version=tls13" \ |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 4888 | 0 \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4889 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4890 | -c "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 4891 | -c "EncryptedExtensions: record_size_limit(28) extension received." \ |
Yanray Wang | 42017cd | 2023-11-08 11:15:23 +0800 | [diff] [blame] | 4892 | -c "RecordSizeLimit: 16385 Bytes" \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4893 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 4894 | # In the following tests, --recordsize is the value used by the G_NEXT_CLI (3.7.2) to configure the |
| 4895 | # maximum record size using gnutls_record_set_max_size() |
| 4896 | # (https://gnutls.org/reference/gnutls-gnutls.html#gnutls-record-set-max-size). |
| 4897 | # There is currently a lower limit of 512, caused by gnutls_record_set_max_size() |
| 4898 | # not respecting the "%ALLOW_SMALL_RECORDS" priority string and not using the |
| 4899 | # more recent function gnutls_record_set_max_recv_size() |
| 4900 | # (https://gnutls.org/reference/gnutls-gnutls.html#gnutls-record-set-max-recv-size). |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4901 | # There is currently an upper limit of 4096, caused by the cli arg parser: |
| 4902 | # https://gitlab.com/gnutls/gnutls/-/blob/3.7.2/src/cli-args.def#L395. |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 4903 | # Thus, these tests are currently limited to the value range 512-4096. |
| 4904 | # Also, the value sent in the extension will be one larger than the value |
| 4905 | # set at the command line: |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4906 | # https://gitlab.com/gnutls/gnutls/-/blob/3.7.2/lib/ext/record_size_limit.c#L142 |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4907 | |
| 4908 | # Currently test certificates being used do not fit in 513 record size limit |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4909 | # so for 513 record size limit tests we use preshared key to avoid sending |
| 4910 | # the certificate. |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4911 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4912 | requires_gnutls_tls1_3 |
| 4913 | requires_gnutls_record_size_limit |
| 4914 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
| 4915 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4916 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4917 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 1 fragment" \ |
| 4918 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4919 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4920 | response_size=256" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4921 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4922 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4923 | 0 \ |
| 4924 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4925 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4926 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4927 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4928 | -s "Maximum outgoing record payload length is 511" \ |
| 4929 | -s "256 bytes written in 1 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4930 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4931 | requires_gnutls_tls1_3 |
| 4932 | requires_gnutls_record_size_limit |
| 4933 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
| 4934 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4935 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4936 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 2 fragments" \ |
| 4937 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4938 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4939 | response_size=768" \ |
| 4940 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4941 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 4942 | 0 \ |
| 4943 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4944 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4945 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4946 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4947 | -s "Maximum outgoing record payload length is 511" \ |
| 4948 | -s "768 bytes written in 2 fragments" |
Waleed Elmelegy | 9aec1c7 | 2023-12-05 20:08:51 +0000 | [diff] [blame] | 4949 | |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4950 | requires_gnutls_tls1_3 |
| 4951 | requires_gnutls_record_size_limit |
| 4952 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
| 4953 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 4954 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 4955 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (513), 3 fragments" \ |
| 4956 | "$P_SRV debug_level=3 force_version=tls13 tls13_kex_modes=psk \ |
| 4957 | psk_list=Client_identity,6162636465666768696a6b6c6d6e6f70 \ |
| 4958 | response_size=1280" \ |
| 4959 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK --recordsize 512 \ |
| 4960 | --pskusername Client_identity --pskkey=6162636465666768696a6b6c6d6e6f70" \ |
| 4961 | 0 \ |
| 4962 | -s "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 9457e67 | 2024-01-08 15:40:12 +0000 | [diff] [blame] | 4963 | -s "ClientHello: record_size_limit(28) extension exists." \ |
| 4964 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4965 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 87a373e | 2023-12-28 17:49:36 +0000 | [diff] [blame] | 4966 | -s "Maximum outgoing record payload length is 511" \ |
| 4967 | -s "1280 bytes written in 3 fragments" |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4968 | |
| 4969 | requires_gnutls_tls1_3 |
| 4970 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4971 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4972 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4973 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4974 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 1 fragment" \ |
| 4975 | "$P_SRV debug_level=3 force_version=tls13 response_size=512" \ |
| 4976 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 4977 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4978 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 4979 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 4980 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4981 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4982 | -s "Maximum outgoing record payload length is 1023" \ |
| 4983 | -s "512 bytes written in 1 fragments" |
| 4984 | |
| 4985 | requires_gnutls_tls1_3 |
| 4986 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4987 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4988 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 4989 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4990 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 2 fragments" \ |
| 4991 | "$P_SRV debug_level=3 force_version=tls13 response_size=1536" \ |
| 4992 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 4993 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4994 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 4995 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 4996 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 4997 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 4998 | -s "Maximum outgoing record payload length is 1023" \ |
| 4999 | -s "1536 bytes written in 2 fragments" |
| 5000 | |
| 5001 | requires_gnutls_tls1_3 |
| 5002 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5003 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5004 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5005 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5006 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (1024), 3 fragments" \ |
| 5007 | "$P_SRV debug_level=3 force_version=tls13 response_size=2560" \ |
| 5008 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 1023" \ |
| 5009 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5010 | -s "RecordSizeLimit: 1024 Bytes" \ |
| 5011 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5012 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5013 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5014 | -s "Maximum outgoing record payload length is 1023" \ |
| 5015 | -s "2560 bytes written in 3 fragments" |
| 5016 | |
| 5017 | requires_gnutls_tls1_3 |
| 5018 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5019 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5020 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5021 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5022 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 1 fragment" \ |
| 5023 | "$P_SRV debug_level=3 force_version=tls13 response_size=2048" \ |
| 5024 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5025 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5026 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5027 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5028 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5029 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5030 | -s "Maximum outgoing record payload length is 4095" \ |
| 5031 | -s "2048 bytes written in 1 fragments" |
| 5032 | |
| 5033 | requires_gnutls_tls1_3 |
| 5034 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5035 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5036 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5037 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5038 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 2 fragments" \ |
| 5039 | "$P_SRV debug_level=3 force_version=tls13 response_size=6144" \ |
| 5040 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5041 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5042 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5043 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 47d2946 | 2024-01-03 17:31:52 +0000 | [diff] [blame] | 5044 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5045 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5046 | -s "Maximum outgoing record payload length is 4095" \ |
| 5047 | -s "6144 bytes written in 2 fragments" |
| 5048 | |
| 5049 | requires_gnutls_tls1_3 |
| 5050 | requires_gnutls_record_size_limit |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5051 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5052 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 60f0f72 | 2024-01-04 14:57:31 +0000 | [diff] [blame] | 5053 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5054 | run_test "Record Size Limit: TLS 1.3: Server complies with record size limit (4096), 3 fragments" \ |
| 5055 | "$P_SRV debug_level=3 force_version=tls13 response_size=10240" \ |
| 5056 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 -V -d 4 --recordsize 4095" \ |
| 5057 | 0 \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5058 | -s "RecordSizeLimit: 4096 Bytes" \ |
| 5059 | -s "ClientHello: record_size_limit(28) extension exists." \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5060 | -s "Sent RecordSizeLimit: 16384 Bytes" \ |
| 5061 | -s "EncryptedExtensions: record_size_limit(28) extension exists." \ |
Jan Bruckner | f482dcc | 2023-03-15 09:09:06 +0100 | [diff] [blame] | 5062 | -s "Maximum outgoing record payload length is 4095" \ |
| 5063 | -s "10240 bytes written in 3 fragments" |
Jan Bruckner | aa31b19 | 2023-02-06 12:54:29 +0100 | [diff] [blame] | 5064 | |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5065 | requires_gnutls_tls1_3 |
| 5066 | requires_gnutls_record_size_limit |
| 5067 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5068 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5069 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5070 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 1 fragment" \ |
| 5071 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5072 | "$P_CLI debug_level=4 force_version=tls13 request_size=256" \ |
| 5073 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5074 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5075 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5076 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5077 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5078 | -c "Maximum outgoing record payload length is 511" \ |
| 5079 | -c "256 bytes written in 1 fragments" |
| 5080 | |
| 5081 | requires_gnutls_tls1_3 |
| 5082 | requires_gnutls_record_size_limit |
| 5083 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5084 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5085 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5086 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 2 fragments" \ |
| 5087 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5088 | "$P_CLI debug_level=4 force_version=tls13 request_size=768" \ |
| 5089 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5090 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5091 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5092 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5093 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5094 | -c "Maximum outgoing record payload length is 511" \ |
| 5095 | -c "768 bytes written in 2 fragments" |
| 5096 | |
| 5097 | requires_gnutls_tls1_3 |
| 5098 | requires_gnutls_record_size_limit |
| 5099 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5100 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5101 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5102 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (513), 3 fragments" \ |
| 5103 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --disable-client-cert --recordsize 512" \ |
| 5104 | "$P_CLI debug_level=4 force_version=tls13 request_size=1280" \ |
| 5105 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5106 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5107 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5108 | -c "RecordSizeLimit: 513 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5109 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5110 | -c "Maximum outgoing record payload length is 511" \ |
| 5111 | -c "1280 bytes written in 3 fragments" |
| 5112 | |
| 5113 | requires_gnutls_tls1_3 |
| 5114 | requires_gnutls_record_size_limit |
| 5115 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5116 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5117 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5118 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 1 fragment" \ |
| 5119 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5120 | "$P_CLI debug_level=4 force_version=tls13 request_size=512" \ |
| 5121 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5122 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5123 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5124 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5125 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5126 | -c "Maximum outgoing record payload length is 1023" \ |
| 5127 | -c "512 bytes written in 1 fragments" |
| 5128 | |
| 5129 | requires_gnutls_tls1_3 |
| 5130 | requires_gnutls_record_size_limit |
| 5131 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5132 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5133 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5134 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 2 fragments" \ |
| 5135 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5136 | "$P_CLI debug_level=4 force_version=tls13 request_size=1536" \ |
| 5137 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5138 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5139 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5140 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5141 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5142 | -c "Maximum outgoing record payload length is 1023" \ |
| 5143 | -c "1536 bytes written in 2 fragments" |
| 5144 | |
| 5145 | requires_gnutls_tls1_3 |
| 5146 | requires_gnutls_record_size_limit |
| 5147 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5148 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5149 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5150 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (1024), 3 fragments" \ |
| 5151 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 1023" \ |
| 5152 | "$P_CLI debug_level=4 force_version=tls13 request_size=2560" \ |
| 5153 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5154 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5155 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5156 | -c "RecordSizeLimit: 1024 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5157 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5158 | -c "Maximum outgoing record payload length is 1023" \ |
| 5159 | -c "2560 bytes written in 3 fragments" |
| 5160 | |
| 5161 | requires_gnutls_tls1_3 |
| 5162 | requires_gnutls_record_size_limit |
| 5163 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5164 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5165 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5166 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 1 fragment" \ |
| 5167 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5168 | "$P_CLI debug_level=4 force_version=tls13 request_size=2048" \ |
| 5169 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5170 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5171 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5172 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5173 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5174 | -c "Maximum outgoing record payload length is 4095" \ |
| 5175 | -c "2048 bytes written in 1 fragments" |
| 5176 | |
| 5177 | requires_gnutls_tls1_3 |
| 5178 | requires_gnutls_record_size_limit |
| 5179 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5180 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5181 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5182 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 2 fragments" \ |
| 5183 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5184 | "$P_CLI debug_level=4 force_version=tls13 request_size=6144" \ |
| 5185 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5186 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5187 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5188 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5189 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5190 | -c "Maximum outgoing record payload length is 4095" \ |
| 5191 | -c "6144 bytes written in 2 fragments" |
| 5192 | |
| 5193 | requires_gnutls_tls1_3 |
| 5194 | requires_gnutls_record_size_limit |
| 5195 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE MBEDTLS_SSL_CLI_C MBEDTLS_DEBUG_C |
| 5196 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
| 5197 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5198 | run_test "Record Size Limit: TLS 1.3: Client complies with record size limit (4096), 3 fragments" \ |
| 5199 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL -d 4 --recordsize 4095" \ |
| 5200 | "$P_CLI debug_level=4 force_version=tls13 request_size=10240" \ |
| 5201 | 0 \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5202 | -c "Sent RecordSizeLimit: 16384 Bytes" \ |
Waleed Elmelegy | 1487760 | 2024-01-10 16:15:08 +0000 | [diff] [blame] | 5203 | -c "ClientHello: record_size_limit(28) extension exists." \ |
| 5204 | -c "RecordSizeLimit: 4096 Bytes" \ |
Waleed Elmelegy | 2fa99b2 | 2024-01-09 17:15:03 +0000 | [diff] [blame] | 5205 | -c "EncryptedExtensions: record_size_limit(28) extension exists." \ |
| 5206 | -c "Maximum outgoing record payload length is 4095" \ |
| 5207 | -c "10240 bytes written in 3 fragments" |
| 5208 | |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5209 | # TODO: For time being, we send fixed value of RecordSizeLimit defined by |
| 5210 | # MBEDTLS_SSL_IN_CONTENT_LEN. Once we support variable buffer length of |
| 5211 | # RecordSizeLimit, we need to modify value of RecordSizeLimit in below test. |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5212 | requires_config_value_equals "MBEDTLS_SSL_IN_CONTENT_LEN" 16384 |
| 5213 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C MBEDTLS_DEBUG_C |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5214 | requires_config_enabled MBEDTLS_SSL_RECORD_SIZE_LIMIT |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5215 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 5216 | run_test "Record Size Limit: TLS 1.3 m->m: both peer comply with record size limit (default)" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5217 | "$P_SRV debug_level=4 force_version=tls13" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5218 | "$P_CLI debug_level=4" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5219 | 0 \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5220 | -c "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5221 | -c "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
Waleed Elmelegy | 3a37756 | 2024-01-05 18:13:42 +0000 | [diff] [blame] | 5222 | -s "RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5223 | -s "Sent RecordSizeLimit: $MAX_IN_LEN Bytes" \ |
| 5224 | -s "Maximum outgoing record payload length is 16383" \ |
Waleed Elmelegy | 598ea09 | 2024-01-03 17:34:03 +0000 | [diff] [blame] | 5225 | -s "Maximum incoming record payload length is 16384" |
| 5226 | |
Waleed Elmelegy | f501790 | 2024-01-09 14:18:34 +0000 | [diff] [blame] | 5227 | # End of Record size limit tests |
| 5228 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5229 | # Tests for renegotiation |
| 5230 | |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5231 | # G_NEXT_SRV is used in renegotiation tests becuase of the increased |
| 5232 | # extensions limit since we exceed the limit in G_SRV when we send |
| 5233 | # TLS 1.3 extensions in the initial handshake. |
| 5234 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5235 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5236 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5237 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5238 | "$P_CLI force_version=tls12 debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5239 | 0 \ |
| 5240 | -C "client hello, adding renegotiation extension" \ |
| 5241 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5242 | -S "found renegotiation extension" \ |
| 5243 | -s "server hello, secure renegotiation extension" \ |
| 5244 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5245 | -C "=> renegotiate" \ |
| 5246 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5247 | -S "write hello request" |
| 5248 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5249 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5250 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5251 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5252 | "$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] | 5253 | 0 \ |
| 5254 | -c "client hello, adding renegotiation extension" \ |
| 5255 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5256 | -s "found renegotiation extension" \ |
| 5257 | -s "server hello, secure renegotiation extension" \ |
| 5258 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5259 | -c "=> renegotiate" \ |
| 5260 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5261 | -S "write hello request" |
| 5262 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5263 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5264 | run_test "Renegotiation: server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5265 | "$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] | 5266 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5267 | 0 \ |
| 5268 | -c "client hello, adding renegotiation extension" \ |
| 5269 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5270 | -s "found renegotiation extension" \ |
| 5271 | -s "server hello, secure renegotiation extension" \ |
| 5272 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5273 | -c "=> renegotiate" \ |
| 5274 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5275 | -s "write hello request" |
| 5276 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5277 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5278 | # 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] | 5279 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5280 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5281 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 5282 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5283 | "$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] | 5284 | 0 \ |
| 5285 | -c "client hello, adding renegotiation extension" \ |
| 5286 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5287 | -s "found renegotiation extension" \ |
| 5288 | -s "server hello, secure renegotiation extension" \ |
| 5289 | -c "found renegotiation extension" \ |
| 5290 | -c "=> renegotiate" \ |
| 5291 | -s "=> renegotiate" \ |
| 5292 | -S "write hello request" \ |
| 5293 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5294 | |
| 5295 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 5296 | # 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] | 5297 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5298 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 5299 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5300 | "$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] | 5301 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 5302 | 0 \ |
| 5303 | -c "client hello, adding renegotiation extension" \ |
| 5304 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5305 | -s "found renegotiation extension" \ |
| 5306 | -s "server hello, secure renegotiation extension" \ |
| 5307 | -c "found renegotiation extension" \ |
| 5308 | -c "=> renegotiate" \ |
| 5309 | -s "=> renegotiate" \ |
| 5310 | -s "write hello request" \ |
| 5311 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 5312 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5313 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5314 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5315 | "$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] | 5316 | "$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] | 5317 | 0 \ |
| 5318 | -c "client hello, adding renegotiation extension" \ |
| 5319 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5320 | -s "found renegotiation extension" \ |
| 5321 | -s "server hello, secure renegotiation extension" \ |
| 5322 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5323 | -c "=> renegotiate" \ |
| 5324 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5325 | -s "write hello request" |
| 5326 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5327 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5328 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 5329 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5330 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5331 | "$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] | 5332 | "$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" \ |
| 5333 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 5334 | -c "Maximum incoming record payload length is 2048" \ |
| 5335 | -c "Maximum outgoing record payload length is 2048" \ |
| 5336 | -s "Maximum incoming record payload length is 2048" \ |
| 5337 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 5338 | -c "client hello, adding max_fragment_length extension" \ |
| 5339 | -s "found max fragment length extension" \ |
| 5340 | -s "server hello, max_fragment_length extension" \ |
| 5341 | -c "found max_fragment_length extension" \ |
| 5342 | -c "client hello, adding renegotiation extension" \ |
| 5343 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5344 | -s "found renegotiation extension" \ |
| 5345 | -s "server hello, secure renegotiation extension" \ |
| 5346 | -c "found renegotiation extension" \ |
| 5347 | -c "=> renegotiate" \ |
| 5348 | -s "=> renegotiate" \ |
| 5349 | -s "write hello request" |
| 5350 | |
| 5351 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5352 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5353 | "$P_SRV debug_level=3 exchanges=2 renegotiation=0 auth_mode=optional" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5354 | "$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] | 5355 | 1 \ |
| 5356 | -c "client hello, adding renegotiation extension" \ |
| 5357 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5358 | -S "found renegotiation extension" \ |
| 5359 | -s "server hello, secure renegotiation extension" \ |
| 5360 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5361 | -c "=> renegotiate" \ |
| 5362 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5363 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 5364 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5365 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5366 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5367 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5368 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5369 | "$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] | 5370 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5371 | 0 \ |
| 5372 | -C "client hello, adding renegotiation extension" \ |
| 5373 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5374 | -S "found renegotiation extension" \ |
| 5375 | -s "server hello, secure renegotiation extension" \ |
| 5376 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 5377 | -C "=> renegotiate" \ |
| 5378 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 5379 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 5380 | -S "SSL - An unexpected message was received from our peer" \ |
| 5381 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 5382 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5383 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5384 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5385 | "$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] | 5386 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5387 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5388 | 0 \ |
| 5389 | -C "client hello, adding renegotiation extension" \ |
| 5390 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5391 | -S "found renegotiation extension" \ |
| 5392 | -s "server hello, secure renegotiation extension" \ |
| 5393 | -c "found renegotiation extension" \ |
| 5394 | -C "=> renegotiate" \ |
| 5395 | -S "=> renegotiate" \ |
| 5396 | -s "write hello request" \ |
| 5397 | -S "SSL - An unexpected message was received from our peer" \ |
| 5398 | -S "failed" |
| 5399 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5400 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5401 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5402 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5403 | "$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] | 5404 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5405 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5406 | 0 \ |
| 5407 | -C "client hello, adding renegotiation extension" \ |
| 5408 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5409 | -S "found renegotiation extension" \ |
| 5410 | -s "server hello, secure renegotiation extension" \ |
| 5411 | -c "found renegotiation extension" \ |
| 5412 | -C "=> renegotiate" \ |
| 5413 | -S "=> renegotiate" \ |
| 5414 | -s "write hello request" \ |
| 5415 | -S "SSL - An unexpected message was received from our peer" \ |
| 5416 | -S "failed" |
| 5417 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5418 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5419 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5420 | "$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] | 5421 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5422 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5423 | 0 \ |
| 5424 | -C "client hello, adding renegotiation extension" \ |
| 5425 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5426 | -S "found renegotiation extension" \ |
| 5427 | -s "server hello, secure renegotiation extension" \ |
| 5428 | -c "found renegotiation extension" \ |
| 5429 | -C "=> renegotiate" \ |
| 5430 | -S "=> renegotiate" \ |
| 5431 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 5432 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5433 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5434 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5435 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5436 | "$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] | 5437 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5438 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 5439 | 0 \ |
| 5440 | -c "client hello, adding renegotiation extension" \ |
| 5441 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5442 | -s "found renegotiation extension" \ |
| 5443 | -s "server hello, secure renegotiation extension" \ |
| 5444 | -c "found renegotiation extension" \ |
| 5445 | -c "=> renegotiate" \ |
| 5446 | -s "=> renegotiate" \ |
| 5447 | -s "write hello request" \ |
| 5448 | -S "SSL - An unexpected message was received from our peer" \ |
| 5449 | -S "failed" |
| 5450 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5451 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5452 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5453 | "$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] | 5454 | "$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] | 5455 | 0 \ |
| 5456 | -C "client hello, adding renegotiation extension" \ |
| 5457 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5458 | -S "found renegotiation extension" \ |
| 5459 | -s "server hello, secure renegotiation extension" \ |
| 5460 | -c "found renegotiation extension" \ |
| 5461 | -S "record counter limit reached: renegotiate" \ |
| 5462 | -C "=> renegotiate" \ |
| 5463 | -S "=> renegotiate" \ |
| 5464 | -S "write hello request" \ |
| 5465 | -S "SSL - An unexpected message was received from our peer" \ |
| 5466 | -S "failed" |
| 5467 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 5468 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5469 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5470 | run_test "Renegotiation: periodic, just above period" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5471 | "$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] | 5472 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5473 | 0 \ |
| 5474 | -c "client hello, adding renegotiation extension" \ |
| 5475 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5476 | -s "found renegotiation extension" \ |
| 5477 | -s "server hello, secure renegotiation extension" \ |
| 5478 | -c "found renegotiation extension" \ |
| 5479 | -s "record counter limit reached: renegotiate" \ |
| 5480 | -c "=> renegotiate" \ |
| 5481 | -s "=> renegotiate" \ |
| 5482 | -s "write hello request" \ |
| 5483 | -S "SSL - An unexpected message was received from our peer" \ |
| 5484 | -S "failed" |
| 5485 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5486 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5487 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5488 | "$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] | 5489 | "$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] | 5490 | 0 \ |
| 5491 | -c "client hello, adding renegotiation extension" \ |
| 5492 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5493 | -s "found renegotiation extension" \ |
| 5494 | -s "server hello, secure renegotiation extension" \ |
| 5495 | -c "found renegotiation extension" \ |
| 5496 | -s "record counter limit reached: renegotiate" \ |
| 5497 | -c "=> renegotiate" \ |
| 5498 | -s "=> renegotiate" \ |
| 5499 | -s "write hello request" \ |
| 5500 | -S "SSL - An unexpected message was received from our peer" \ |
| 5501 | -S "failed" |
| 5502 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5503 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 5504 | run_test "Renegotiation: periodic, above period, disabled" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5505 | "$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] | 5506 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 5507 | 0 \ |
| 5508 | -C "client hello, adding renegotiation extension" \ |
| 5509 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5510 | -S "found renegotiation extension" \ |
| 5511 | -s "server hello, secure renegotiation extension" \ |
| 5512 | -c "found renegotiation extension" \ |
| 5513 | -S "record counter limit reached: renegotiate" \ |
| 5514 | -C "=> renegotiate" \ |
| 5515 | -S "=> renegotiate" \ |
| 5516 | -S "write hello request" \ |
| 5517 | -S "SSL - An unexpected message was received from our peer" \ |
| 5518 | -S "failed" |
| 5519 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5520 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5521 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 5522 | "$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] | 5523 | "$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] | 5524 | 0 \ |
| 5525 | -c "client hello, adding renegotiation extension" \ |
| 5526 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5527 | -s "found renegotiation extension" \ |
| 5528 | -s "server hello, secure renegotiation extension" \ |
| 5529 | -c "found renegotiation extension" \ |
| 5530 | -c "=> renegotiate" \ |
| 5531 | -s "=> renegotiate" \ |
| 5532 | -S "write hello request" |
| 5533 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5534 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5535 | run_test "Renegotiation: nbio, server-initiated" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5536 | "$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] | 5537 | "$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] | 5538 | 0 \ |
| 5539 | -c "client hello, adding renegotiation extension" \ |
| 5540 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5541 | -s "found renegotiation extension" \ |
| 5542 | -s "server hello, secure renegotiation extension" \ |
| 5543 | -c "found renegotiation extension" \ |
| 5544 | -c "=> renegotiate" \ |
| 5545 | -s "=> renegotiate" \ |
| 5546 | -s "write hello request" |
| 5547 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5548 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5549 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5550 | run_test "Renegotiation: openssl server, client-initiated" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 5551 | "$O_SRV -www -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5552 | "$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] | 5553 | 0 \ |
| 5554 | -c "client hello, adding renegotiation extension" \ |
| 5555 | -c "found renegotiation extension" \ |
| 5556 | -c "=> renegotiate" \ |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5557 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5558 | -C "error" \ |
| 5559 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5560 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5561 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5562 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5563 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5564 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5565 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5566 | "$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] | 5567 | 0 \ |
| 5568 | -c "client hello, adding renegotiation extension" \ |
| 5569 | -c "found renegotiation extension" \ |
| 5570 | -c "=> renegotiate" \ |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5571 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 5572 | -C "error" \ |
| 5573 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5574 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5575 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5576 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5577 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5578 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5579 | "$G_NEXT_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] | 5580 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5581 | 1 \ |
| 5582 | -c "client hello, adding renegotiation extension" \ |
| 5583 | -C "found renegotiation extension" \ |
| 5584 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5585 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5586 | -c "error" \ |
| 5587 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5588 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5589 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5590 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5591 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5592 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5593 | "$G_NEXT_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] | 5594 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5595 | allow_legacy=0" \ |
| 5596 | 1 \ |
| 5597 | -c "client hello, adding renegotiation extension" \ |
| 5598 | -C "found renegotiation extension" \ |
| 5599 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5600 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5601 | -c "error" \ |
| 5602 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5603 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5604 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5605 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5606 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5607 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5608 | "$G_NEXT_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] | 5609 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 5610 | allow_legacy=1" \ |
| 5611 | 0 \ |
| 5612 | -c "client hello, adding renegotiation extension" \ |
| 5613 | -C "found renegotiation extension" \ |
| 5614 | -c "=> renegotiate" \ |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 5615 | -C "ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5616 | -C "error" \ |
| 5617 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5618 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5619 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5620 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 5621 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 5622 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 5623 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5624 | 0 \ |
| 5625 | -c "client hello, adding renegotiation extension" \ |
| 5626 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5627 | -s "found renegotiation extension" \ |
| 5628 | -s "server hello, secure renegotiation extension" \ |
| 5629 | -c "found renegotiation extension" \ |
| 5630 | -c "=> renegotiate" \ |
| 5631 | -s "=> renegotiate" \ |
| 5632 | -S "write hello request" |
| 5633 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5634 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5635 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5636 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 5637 | "$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] | 5638 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 5639 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 5640 | 0 \ |
| 5641 | -c "client hello, adding renegotiation extension" \ |
| 5642 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5643 | -s "found renegotiation extension" \ |
| 5644 | -s "server hello, secure renegotiation extension" \ |
| 5645 | -c "found renegotiation extension" \ |
| 5646 | -c "=> renegotiate" \ |
| 5647 | -s "=> renegotiate" \ |
| 5648 | -s "write hello request" |
| 5649 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5650 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5651 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5652 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 5653 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 5654 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 5655 | 0 \ |
| 5656 | -c "client hello, adding renegotiation extension" \ |
| 5657 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 5658 | -s "found renegotiation extension" \ |
| 5659 | -s "server hello, secure renegotiation extension" \ |
| 5660 | -s "record counter limit reached: renegotiate" \ |
| 5661 | -c "=> renegotiate" \ |
| 5662 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5663 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 5664 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 5665 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5666 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5667 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5668 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5669 | "$G_NEXT_SRV -u --mtu 4096" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5670 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 5671 | 0 \ |
| 5672 | -c "client hello, adding renegotiation extension" \ |
| 5673 | -c "found renegotiation extension" \ |
| 5674 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5675 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 5676 | -C "error" \ |
| 5677 | -s "Extra-header:" |
| 5678 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 5679 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5680 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5681 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5682 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5683 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5684 | run_test "Renego ext: gnutls server strict, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5685 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5686 | "$P_CLI debug_level=3" \ |
| 5687 | 0 \ |
| 5688 | -c "found renegotiation extension" \ |
| 5689 | -C "error" \ |
| 5690 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5691 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5692 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5693 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5694 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5695 | run_test "Renego ext: gnutls server unsafe, client default" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5696 | "$G_NEXT_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] | 5697 | "$P_CLI debug_level=3" \ |
| 5698 | 0 \ |
| 5699 | -C "found renegotiation extension" \ |
| 5700 | -C "error" \ |
| 5701 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 5702 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5703 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5704 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5705 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5706 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
Waleed Elmelegy | 4b09dcd | 2024-01-12 10:50:25 +0000 | [diff] [blame] | 5707 | "$G_NEXT_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] | 5708 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 5709 | 1 \ |
| 5710 | -C "found renegotiation extension" \ |
| 5711 | -c "error" \ |
| 5712 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 5713 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5714 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5715 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5717 | run_test "Renego ext: gnutls client strict, server default" \ |
| 5718 | "$P_SRV debug_level=3" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5719 | "$G_CLI --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5720 | 0 \ |
| 5721 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5722 | -s "server hello, secure renegotiation extension" |
| 5723 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5724 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5725 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5726 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5727 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 5728 | "$P_SRV debug_level=3" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5729 | "$G_CLI --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5730 | 0 \ |
| 5731 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5732 | -S "server hello, secure renegotiation extension" |
| 5733 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 5734 | requires_gnutls |
Gilles Peskine | 21ad576 | 2024-04-29 17:47:35 +0200 | [diff] [blame] | 5735 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5736 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5737 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 5738 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Gilles Peskine | e373c94 | 2024-04-29 17:44:19 +0200 | [diff] [blame] | 5739 | "$G_CLI --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 5740 | 1 \ |
| 5741 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 5742 | -S "server hello, secure renegotiation extension" |
| 5743 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5744 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 5745 | |
| 5746 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5748 | run_test "DER format: no trailing bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5749 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der0.crt \ |
| 5750 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5751 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5752 | 0 \ |
| 5753 | -c "Handshake was completed" \ |
| 5754 | |
| 5755 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5756 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5757 | run_test "DER format: with a trailing zero byte" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5758 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der1a.crt \ |
| 5759 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5760 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5761 | 0 \ |
| 5762 | -c "Handshake was completed" \ |
| 5763 | |
| 5764 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5765 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5766 | run_test "DER format: with a trailing random byte" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5767 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der1b.crt \ |
| 5768 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5769 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5770 | 0 \ |
| 5771 | -c "Handshake was completed" \ |
| 5772 | |
| 5773 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5774 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5775 | run_test "DER format: with 2 trailing random bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5776 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der2.crt \ |
| 5777 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5778 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5779 | 0 \ |
| 5780 | -c "Handshake was completed" \ |
| 5781 | |
| 5782 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5783 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5784 | run_test "DER format: with 4 trailing random bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5785 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der4.crt \ |
| 5786 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5787 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5788 | 0 \ |
| 5789 | -c "Handshake was completed" \ |
| 5790 | |
| 5791 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5792 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5793 | run_test "DER format: with 8 trailing random bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5794 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der8.crt \ |
| 5795 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5796 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5797 | 0 \ |
| 5798 | -c "Handshake was completed" \ |
| 5799 | |
| 5800 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 5801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5802 | run_test "DER format: with 9 trailing random bytes" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5803 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-der9.crt \ |
| 5804 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5805 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 5806 | 0 \ |
| 5807 | -c "Handshake was completed" \ |
| 5808 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 5809 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 5810 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5811 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5812 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5813 | run_test "Authentication: server badcert, client required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5814 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5815 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5816 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5817 | 1 \ |
| 5818 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5819 | -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] | 5820 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5821 | -c "X509 - Certificate verification failed" |
| 5822 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5823 | run_test "Authentication: server badcert, client optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5824 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5825 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5826 | "$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] | 5827 | 0 \ |
| 5828 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5829 | -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] | 5830 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5831 | -C "X509 - Certificate verification failed" |
| 5832 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5833 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5834 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 5835 | "$P_SRV" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5836 | "$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] | 5837 | 0 \ |
| 5838 | -c "x509_verify_cert() returned" \ |
| 5839 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5840 | -c "! Certificate verification flags"\ |
| 5841 | -C "! mbedtls_ssl_handshake returned" \ |
| 5842 | -C "X509 - Certificate verification failed" \ |
| 5843 | -C "SSL - No CA Chain is set, but required to operate" |
| 5844 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5845 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5846 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 5847 | "$P_SRV" \ |
| 5848 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5849 | 1 \ |
| 5850 | -c "x509_verify_cert() returned" \ |
| 5851 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5852 | -c "! Certificate verification flags"\ |
| 5853 | -c "! mbedtls_ssl_handshake returned" \ |
| 5854 | -c "SSL - No CA Chain is set, but required to operate" |
| 5855 | |
Manuel Pégourié-Gonnard | 060e284 | 2024-08-05 11:10:47 +0200 | [diff] [blame^] | 5856 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 5857 | run_test "Authentication: server goodcert, client required, no trusted CA (1.2)" \ |
| 5858 | "$P_SRV force_version=tls12" \ |
| 5859 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 5860 | 1 \ |
| 5861 | -c "x509_verify_cert() returned" \ |
| 5862 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5863 | -c "! Certificate verification flags"\ |
| 5864 | -c "! mbedtls_ssl_handshake returned" \ |
| 5865 | -c "SSL - No CA Chain is set, but required to operate" |
| 5866 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5867 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 5868 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 5869 | # the client informs the server about the supported curves - it does, though, in the |
| 5870 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 5871 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 5872 | # different means to have the server ignoring the client's supported curve list. |
| 5873 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5874 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5875 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 5876 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 5877 | "$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] | 5878 | 1 \ |
| 5879 | -c "bad certificate (EC key curve)"\ |
| 5880 | -c "! Certificate verification flags"\ |
| 5881 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 5882 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 5883 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5884 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 5885 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 5886 | "$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] | 5887 | 1 \ |
| 5888 | -c "bad certificate (EC key curve)"\ |
| 5889 | -c "! Certificate verification flags"\ |
| 5890 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 5891 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5892 | run_test "Authentication: server badcert, client none" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5893 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5894 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 5895 | "$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] | 5896 | 0 \ |
| 5897 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5898 | -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] | 5899 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5900 | -C "X509 - Certificate verification failed" |
| 5901 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5902 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5903 | run_test "Authentication: client SHA256, server required" \ |
| 5904 | "$P_SRV auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5905 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 5906 | key_file=$DATA_FILES_PATH/server6.key \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5907 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 5908 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5909 | -c "Supported Signature Algorithm found: 04 " \ |
| 5910 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5911 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 5912 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5913 | run_test "Authentication: client SHA384, server required" \ |
| 5914 | "$P_SRV auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5915 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 5916 | key_file=$DATA_FILES_PATH/server6.key \ |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5917 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 5918 | 0 \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 5919 | -c "Supported Signature Algorithm found: 04 " \ |
| 5920 | -c "Supported Signature Algorithm found: 05 " |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 5921 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5922 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5923 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 5924 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 5925 | "$P_CLI debug_level=3 crt_file=none \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5926 | key_file=$DATA_FILES_PATH/server5.key" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5927 | 1 \ |
| 5928 | -S "skip write certificate request" \ |
| 5929 | -C "skip parse certificate request" \ |
| 5930 | -c "got a certificate request" \ |
| 5931 | -c "= write certificate$" \ |
| 5932 | -C "skip write certificate$" \ |
| 5933 | -S "x509_verify_cert() returned" \ |
Ronald Cron | 1938588 | 2022-06-15 16:26:13 +0200 | [diff] [blame] | 5934 | -s "peer has no certificate" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5935 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 5936 | -s "No client certification received from the client, but required by the authentication mode" |
| 5937 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5938 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5939 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5940 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5941 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5942 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5943 | 1 \ |
| 5944 | -S "skip write certificate request" \ |
| 5945 | -C "skip parse certificate request" \ |
| 5946 | -c "got a certificate request" \ |
| 5947 | -C "skip write certificate" \ |
| 5948 | -C "skip write certificate verify" \ |
| 5949 | -S "skip parse certificate verify" \ |
| 5950 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5951 | -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] | 5952 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5953 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5954 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 5955 | # We don't check that the client receives the alert because it might |
| 5956 | # detect that its write end of the connection is closed and abort |
| 5957 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5958 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5959 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 5960 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5961 | "$P_SRV debug_level=3 auth_mode=required ca_file=$DATA_FILES_PATH/server5-selfsigned.crt" \ |
| 5962 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 5963 | key_file=$DATA_FILES_PATH/server5.key" \ |
Gilles Peskine | e1cc60e | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 5964 | 0 \ |
| 5965 | -S "skip write certificate request" \ |
| 5966 | -C "skip parse certificate request" \ |
| 5967 | -c "got a certificate request" \ |
| 5968 | -C "skip write certificate" \ |
| 5969 | -C "skip write certificate verify" \ |
| 5970 | -S "skip parse certificate verify" \ |
| 5971 | -S "x509_verify_cert() returned" \ |
| 5972 | -S "! The certificate is not correctly signed" \ |
| 5973 | -S "X509 - Certificate verification failed" |
| 5974 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5975 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5976 | run_test "Authentication: client cert not trusted, server required" \ |
| 5977 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5978 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 5979 | key_file=$DATA_FILES_PATH/server5.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5980 | 1 \ |
| 5981 | -S "skip write certificate request" \ |
| 5982 | -C "skip parse certificate request" \ |
| 5983 | -c "got a certificate request" \ |
| 5984 | -C "skip write certificate" \ |
| 5985 | -C "skip write certificate verify" \ |
| 5986 | -S "skip parse certificate verify" \ |
| 5987 | -s "x509_verify_cert() returned" \ |
| 5988 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5989 | -s "! mbedtls_ssl_handshake returned" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 5990 | -s "X509 - Certificate verification failed" |
| 5991 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 5992 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5993 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5994 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 5995 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 5996 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 5997 | 0 \ |
| 5998 | -S "skip write certificate request" \ |
| 5999 | -C "skip parse certificate request" \ |
| 6000 | -c "got a certificate request" \ |
| 6001 | -C "skip write certificate" \ |
| 6002 | -C "skip write certificate verify" \ |
| 6003 | -S "skip parse certificate verify" \ |
| 6004 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6005 | -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] | 6006 | -S "! mbedtls_ssl_handshake returned" \ |
| 6007 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6008 | -S "X509 - Certificate verification failed" |
| 6009 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6010 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6011 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6012 | "$P_SRV debug_level=3 auth_mode=none" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6013 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6014 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6015 | 0 \ |
| 6016 | -s "skip write certificate request" \ |
| 6017 | -C "skip parse certificate request" \ |
| 6018 | -c "got no certificate request" \ |
| 6019 | -c "skip write certificate" \ |
| 6020 | -c "skip write certificate verify" \ |
| 6021 | -s "skip parse certificate verify" \ |
| 6022 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6023 | -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] | 6024 | -S "! mbedtls_ssl_handshake returned" \ |
| 6025 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 6026 | -S "X509 - Certificate verification failed" |
| 6027 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6028 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6029 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6030 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 6031 | "$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] | 6032 | 0 \ |
| 6033 | -S "skip write certificate request" \ |
| 6034 | -C "skip parse certificate request" \ |
| 6035 | -c "got a certificate request" \ |
| 6036 | -C "skip write certificate$" \ |
| 6037 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6038 | -c "skip write certificate verify" \ |
| 6039 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6040 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6041 | -S "! mbedtls_ssl_handshake returned" \ |
| 6042 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6043 | -S "X509 - Certificate verification failed" |
| 6044 | |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 6045 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6046 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6047 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6048 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6049 | "$O_NEXT_CLI_NO_CERT -no_middlebox" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6050 | 0 \ |
| 6051 | -S "skip write certificate request" \ |
| 6052 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6053 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6054 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6055 | -S "X509 - Certificate verification failed" |
| 6056 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6057 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6058 | run_test "Authentication: client no cert, openssl server optional" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6059 | "$O_SRV -verify 10 -tls1_2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 6060 | "$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] | 6061 | 0 \ |
| 6062 | -C "skip parse certificate request" \ |
| 6063 | -c "got a certificate request" \ |
| 6064 | -C "skip write certificate$" \ |
| 6065 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6066 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 6067 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6068 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6069 | run_test "Authentication: client no cert, openssl server required" \ |
Ronald Cron | cbd7bfd | 2022-03-31 18:19:56 +0200 | [diff] [blame] | 6070 | "$O_SRV -Verify 10 -tls1_2" \ |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 6071 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 6072 | 1 \ |
| 6073 | -C "skip parse certificate request" \ |
| 6074 | -c "got a certificate request" \ |
| 6075 | -C "skip write certificate$" \ |
| 6076 | -c "skip write certificate verify" \ |
| 6077 | -c "! mbedtls_ssl_handshake returned" |
| 6078 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6079 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 6080 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 6081 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6082 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 6083 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 6084 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 6085 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 6086 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 6087 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 6088 | # 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] | 6089 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6090 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6091 | run_test "Authentication: server max_int chain, client default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6092 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6093 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
| 6094 | "$P_CLI server_name=CA09 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6095 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6096 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6097 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6098 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6099 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6100 | run_test "Authentication: server max_int+1 chain, client default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6101 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6102 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6103 | "$P_CLI server_name=CA10 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6104 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6105 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6106 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6107 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6108 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6109 | run_test "Authentication: server max_int+1 chain, client optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6110 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6111 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6112 | "$P_CLI force_version=tls12 server_name=CA10 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6113 | auth_mode=optional" \ |
| 6114 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6115 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6116 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6117 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6118 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6119 | run_test "Authentication: server max_int+1 chain, client none" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6120 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6121 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6122 | "$P_CLI force_version=tls12 server_name=CA10 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6123 | auth_mode=none" \ |
| 6124 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6125 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6126 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6127 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6128 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6129 | run_test "Authentication: client max_int+1 chain, server default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6130 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt" \ |
| 6131 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6132 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6133 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6134 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6135 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6136 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6137 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6138 | run_test "Authentication: client max_int+1 chain, server optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6139 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=optional" \ |
| 6140 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6141 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6142 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6143 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6144 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6145 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6146 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6147 | run_test "Authentication: client max_int+1 chain, server required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6148 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6149 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6150 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6151 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6152 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6153 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6154 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6155 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6156 | run_test "Authentication: client max_int chain, server required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6157 | "$P_SRV ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6158 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6159 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6160 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 6161 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 6162 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6163 | # Tests for CA list in CertificateRequest messages |
| 6164 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6165 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6166 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 6167 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6168 | "$P_CLI force_version=tls12 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6169 | key_file=$DATA_FILES_PATH/server6.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6170 | 0 \ |
| 6171 | -s "requested DN" |
| 6172 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6173 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6174 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 6175 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6176 | "$P_CLI force_version=tls12 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6177 | key_file=$DATA_FILES_PATH/server6.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6178 | 0 \ |
| 6179 | -S "requested DN" |
| 6180 | |
| 6181 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6182 | "$P_SRV force_version=tls12 debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6183 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6184 | key_file=$DATA_FILES_PATH/server5.key" \ |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 6185 | 1 \ |
| 6186 | -S "requested DN" \ |
| 6187 | -s "x509_verify_cert() returned" \ |
| 6188 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6189 | -s "! mbedtls_ssl_handshake returned" \ |
| 6190 | -c "! mbedtls_ssl_handshake returned" \ |
| 6191 | -s "X509 - Certificate verification failed" |
| 6192 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6193 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6194 | run_test "Authentication: send alt conf DN hints in CertificateRequest" \ |
| 6195 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6196 | crt_file2=$DATA_FILES_PATH/server1.crt \ |
| 6197 | key_file2=$DATA_FILES_PATH/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6198 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6199 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6200 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6201 | 0 \ |
| 6202 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6203 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6204 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6205 | run_test "Authentication: send alt conf DN hints in CertificateRequest (2)" \ |
| 6206 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6207 | crt_file2=$DATA_FILES_PATH/server2.crt \ |
| 6208 | key_file2=$DATA_FILES_PATH/server2.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6209 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6210 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6211 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6212 | 0 \ |
| 6213 | -c "DN hint: C=NL, O=PolarSSL, CN=localhost" |
| 6214 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6215 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6216 | run_test "Authentication: send alt hs DN hints in CertificateRequest" \ |
| 6217 | "$P_SRV debug_level=3 auth_mode=optional cert_req_ca_list=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6218 | crt_file2=$DATA_FILES_PATH/server1.crt \ |
| 6219 | key_file2=$DATA_FILES_PATH/server1.key" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6220 | "$P_CLI force_version=tls12 debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6221 | crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6222 | key_file=$DATA_FILES_PATH/server6.key" \ |
Glenn Strauss | bd10c4e | 2022-06-25 03:15:48 -0400 | [diff] [blame] | 6223 | 0 \ |
| 6224 | -c "DN hint: C=NL, O=PolarSSL, CN=PolarSSL Server 1" |
| 6225 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 6226 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 6227 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6228 | |
| 6229 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6230 | run_test "Authentication, CA callback: server badcert, client required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6231 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6232 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 6233 | "$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] | 6234 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6235 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6236 | -c "x509_verify_cert() returned" \ |
| 6237 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6238 | -c "! mbedtls_ssl_handshake returned" \ |
| 6239 | -c "X509 - Certificate verification failed" |
| 6240 | |
| 6241 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6242 | run_test "Authentication, CA callback: server badcert, client optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6243 | "$P_SRV crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6244 | key_file=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 6245 | "$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] | 6246 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6247 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6248 | -c "x509_verify_cert() returned" \ |
| 6249 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6250 | -C "! mbedtls_ssl_handshake returned" \ |
| 6251 | -C "X509 - Certificate verification failed" |
| 6252 | |
| 6253 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 6254 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 6255 | # the client informs the server about the supported curves - it does, though, in the |
| 6256 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 6257 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 6258 | # different means to have the server ignoring the client's supported curve list. |
| 6259 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6260 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6261 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6262 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6263 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6264 | "$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] | 6265 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6266 | -c "use CA callback for X.509 CRT verification" \ |
| 6267 | -c "bad certificate (EC key curve)" \ |
| 6268 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6269 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 6270 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6271 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6272 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6273 | "$P_SRV debug_level=1 key_file=$DATA_FILES_PATH/server5.key \ |
| 6274 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 6275 | "$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] | 6276 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6277 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6278 | -c "bad certificate (EC key curve)"\ |
| 6279 | -c "! Certificate verification flags"\ |
| 6280 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 6281 | |
| 6282 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6283 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6284 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 6285 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6286 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6287 | key_file=$DATA_FILES_PATH/server6.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6288 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 6289 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6290 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6291 | -c "Supported Signature Algorithm found: 04 " \ |
| 6292 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6293 | |
| 6294 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6295 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6296 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 6297 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6298 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server6.crt \ |
| 6299 | key_file=$DATA_FILES_PATH/server6.key \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6300 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 6301 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6302 | -s "use CA callback for X.509 CRT verification" \ |
Andrzej Kurek | ec71b09 | 2022-11-15 10:21:50 -0500 | [diff] [blame] | 6303 | -c "Supported Signature Algorithm found: 04 " \ |
| 6304 | -c "Supported Signature Algorithm found: 05 " |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6305 | |
| 6306 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6307 | run_test "Authentication, CA callback: client badcert, server required" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 6308 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6309 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6310 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6311 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6312 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6313 | -S "skip write certificate request" \ |
| 6314 | -C "skip parse certificate request" \ |
| 6315 | -c "got a certificate request" \ |
| 6316 | -C "skip write certificate" \ |
| 6317 | -C "skip write certificate verify" \ |
| 6318 | -S "skip parse certificate verify" \ |
| 6319 | -s "x509_verify_cert() returned" \ |
| 6320 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6321 | -s "! mbedtls_ssl_handshake returned" \ |
| 6322 | -s "send alert level=2 message=48" \ |
| 6323 | -c "! mbedtls_ssl_handshake returned" \ |
| 6324 | -s "X509 - Certificate verification failed" |
| 6325 | # We don't check that the client receives the alert because it might |
| 6326 | # detect that its write end of the connection is closed and abort |
| 6327 | # before reading the alert message. |
| 6328 | |
| 6329 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6330 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 6331 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6332 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-selfsigned.crt \ |
| 6333 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6334 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6335 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6336 | -S "skip write certificate request" \ |
| 6337 | -C "skip parse certificate request" \ |
| 6338 | -c "got a certificate request" \ |
| 6339 | -C "skip write certificate" \ |
| 6340 | -C "skip write certificate verify" \ |
| 6341 | -S "skip parse certificate verify" \ |
| 6342 | -s "x509_verify_cert() returned" \ |
| 6343 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6344 | -s "! mbedtls_ssl_handshake returned" \ |
| 6345 | -c "! mbedtls_ssl_handshake returned" \ |
| 6346 | -s "X509 - Certificate verification failed" |
| 6347 | |
| 6348 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6349 | run_test "Authentication, CA callback: client badcert, server optional" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 6350 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6351 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 6352 | key_file=$DATA_FILES_PATH/server5.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6353 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6354 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6355 | -S "skip write certificate request" \ |
| 6356 | -C "skip parse certificate request" \ |
| 6357 | -c "got a certificate request" \ |
| 6358 | -C "skip write certificate" \ |
| 6359 | -C "skip write certificate verify" \ |
| 6360 | -S "skip parse certificate verify" \ |
| 6361 | -s "x509_verify_cert() returned" \ |
| 6362 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6363 | -S "! mbedtls_ssl_handshake returned" \ |
| 6364 | -C "! mbedtls_ssl_handshake returned" \ |
| 6365 | -S "X509 - Certificate verification failed" |
| 6366 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6367 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6368 | requires_full_size_output_buffer |
| 6369 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6370 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6371 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6372 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
| 6373 | "$P_CLI force_version=tls12 ca_callback=1 debug_level=3 server_name=CA09 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6374 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6375 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6376 | -C "X509 - A fatal error occurred" |
| 6377 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6378 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6379 | requires_full_size_output_buffer |
| 6380 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6381 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6382 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6383 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6384 | "$P_CLI force_version=tls12 debug_level=3 ca_callback=1 server_name=CA10 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6385 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6386 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6387 | -c "X509 - A fatal error occurred" |
| 6388 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6389 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6390 | requires_full_size_output_buffer |
| 6391 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6392 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6393 | "$P_SRV crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6394 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
| 6395 | "$P_CLI force_version=tls12 ca_callback=1 server_name=CA10 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6396 | debug_level=3 auth_mode=optional" \ |
| 6397 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6398 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6399 | -c "X509 - A fatal error occurred" |
| 6400 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6401 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6402 | requires_full_size_output_buffer |
| 6403 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6404 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6405 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=optional" \ |
| 6406 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6407 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6408 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6409 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6410 | -s "X509 - A fatal error occurred" |
| 6411 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6412 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6413 | requires_full_size_output_buffer |
| 6414 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6415 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6416 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6417 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c10.pem \ |
| 6418 | key_file=$DATA_FILES_PATH/dir-maxpath/10.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6419 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6420 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6421 | -s "X509 - A fatal error occurred" |
| 6422 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 6423 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6424 | requires_full_size_output_buffer |
| 6425 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 6426 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6427 | "$P_SRV force_version=tls12 ca_callback=1 debug_level=3 ca_file=$DATA_FILES_PATH/dir-maxpath/00.crt auth_mode=required" \ |
| 6428 | "$P_CLI crt_file=$DATA_FILES_PATH/dir-maxpath/c09.pem \ |
| 6429 | key_file=$DATA_FILES_PATH/dir-maxpath/09.key" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6430 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 6431 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 6432 | -S "X509 - A fatal error occurred" |
| 6433 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 6434 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6435 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6436 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6437 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6438 | "$P_SRV force_version=tls12 crt_file=$DATA_FILES_PATH/server5.crt \ |
| 6439 | key_file=$DATA_FILES_PATH/server5.key \ |
| 6440 | crt_file2=$DATA_FILES_PATH/server5-sha1.crt \ |
| 6441 | key_file2=$DATA_FILES_PATH/server5.key" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 6442 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 6443 | 0 \ |
| 6444 | -c "signed using.*ECDSA with SHA256" \ |
| 6445 | -C "signed using.*ECDSA with SHA1" |
| 6446 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6447 | # tests for SNI |
| 6448 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6449 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6450 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6451 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6452 | "$P_SRV debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6453 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6454 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6455 | 0 \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6456 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6457 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6458 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6459 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6460 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6461 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6462 | "$P_SRV debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6463 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6464 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6465 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6466 | 0 \ |
| 6467 | -s "parse ServerName extension" \ |
| 6468 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6469 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6470 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6471 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6472 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6473 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6474 | "$P_SRV debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6475 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6476 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6477 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6478 | 0 \ |
| 6479 | -s "parse ServerName extension" \ |
| 6480 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6481 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 6482 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6483 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6484 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6485 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6486 | "$P_SRV debug_level=3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6487 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6488 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6489 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6490 | 1 \ |
| 6491 | -s "parse ServerName extension" \ |
| 6492 | -s "ssl_sni_wrapper() returned" \ |
| 6493 | -s "mbedtls_ssl_handshake returned" \ |
| 6494 | -c "mbedtls_ssl_handshake returned" \ |
| 6495 | -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] | 6496 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6497 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6498 | run_test "SNI: client auth no override: optional" \ |
| 6499 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6500 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6501 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-" \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6502 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6503 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6504 | -S "skip write certificate request" \ |
| 6505 | -C "skip parse certificate request" \ |
| 6506 | -c "got a certificate request" \ |
| 6507 | -C "skip write certificate" \ |
| 6508 | -C "skip write certificate verify" \ |
| 6509 | -S "skip parse certificate verify" |
| 6510 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6511 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6512 | run_test "SNI: client auth override: none -> optional" \ |
| 6513 | "$P_SRV debug_level=3 auth_mode=none \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6514 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6515 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,optional" \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6516 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6517 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6518 | -S "skip write certificate request" \ |
| 6519 | -C "skip parse certificate request" \ |
| 6520 | -c "got a certificate request" \ |
| 6521 | -C "skip write certificate" \ |
| 6522 | -C "skip write certificate verify" \ |
| 6523 | -S "skip parse certificate verify" |
| 6524 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6525 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6526 | run_test "SNI: client auth override: optional -> none" \ |
| 6527 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6528 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6529 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,none" \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6530 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6531 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6532 | -s "skip write certificate request" \ |
| 6533 | -C "skip parse certificate request" \ |
| 6534 | -c "got no certificate request" \ |
XiaokangQian | 23c5be6 | 2022-06-07 02:04:34 +0000 | [diff] [blame] | 6535 | -c "skip write certificate" |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 6536 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6537 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6538 | run_test "SNI: CA no override" \ |
| 6539 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6540 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6541 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6542 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,required" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6543 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6544 | crt_file=$DATA_FILES_PATH/server6.crt key_file=$DATA_FILES_PATH/server6.key" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6545 | 1 \ |
| 6546 | -S "skip write certificate request" \ |
| 6547 | -C "skip parse certificate request" \ |
| 6548 | -c "got a certificate request" \ |
| 6549 | -C "skip write certificate" \ |
| 6550 | -C "skip write certificate verify" \ |
| 6551 | -S "skip parse certificate verify" \ |
| 6552 | -s "x509_verify_cert() returned" \ |
| 6553 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6554 | -S "The certificate has been revoked (is on a CRL)" |
| 6555 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6556 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6557 | run_test "SNI: CA override" \ |
| 6558 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6559 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6560 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6561 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,$DATA_FILES_PATH/test-ca2.crt,-,required" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6562 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6563 | crt_file=$DATA_FILES_PATH/server6.crt key_file=$DATA_FILES_PATH/server6.key" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6564 | 0 \ |
| 6565 | -S "skip write certificate request" \ |
| 6566 | -C "skip parse certificate request" \ |
| 6567 | -c "got a certificate request" \ |
| 6568 | -C "skip write certificate" \ |
| 6569 | -C "skip write certificate verify" \ |
| 6570 | -S "skip parse certificate verify" \ |
| 6571 | -S "x509_verify_cert() returned" \ |
| 6572 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6573 | -S "The certificate has been revoked (is on a CRL)" |
| 6574 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6575 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6576 | run_test "SNI: CA override with CRL" \ |
| 6577 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6578 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6579 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6580 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,$DATA_FILES_PATH/test-ca2.crt,$DATA_FILES_PATH/crl-ec-sha256.pem,required" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6581 | "$P_CLI debug_level=3 server_name=localhost \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6582 | crt_file=$DATA_FILES_PATH/server6.crt key_file=$DATA_FILES_PATH/server6.key" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 6583 | 1 \ |
| 6584 | -S "skip write certificate request" \ |
| 6585 | -C "skip parse certificate request" \ |
| 6586 | -c "got a certificate request" \ |
| 6587 | -C "skip write certificate" \ |
| 6588 | -C "skip write certificate verify" \ |
| 6589 | -S "skip parse certificate verify" \ |
| 6590 | -s "x509_verify_cert() returned" \ |
| 6591 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6592 | -s "The certificate has been revoked (is on a CRL)" |
| 6593 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6594 | # Tests for SNI and DTLS |
| 6595 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6596 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6597 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6598 | run_test "SNI: DTLS, no SNI callback" \ |
| 6599 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6600 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6601 | "$P_CLI server_name=localhost dtls=1" \ |
| 6602 | 0 \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6603 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 6604 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6605 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6606 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6607 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6608 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6609 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6610 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6611 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6612 | "$P_CLI server_name=localhost dtls=1" \ |
| 6613 | 0 \ |
| 6614 | -s "parse ServerName extension" \ |
| 6615 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6616 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 6617 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6618 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6619 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6620 | run_test "SNI: DTLS, matching cert 2" \ |
| 6621 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6622 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6623 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6624 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 6625 | 0 \ |
| 6626 | -s "parse ServerName extension" \ |
| 6627 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6628 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6629 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6630 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6631 | run_test "SNI: DTLS, no matching cert" \ |
| 6632 | "$P_SRV debug_level=3 dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6633 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6634 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6635 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 6636 | 1 \ |
| 6637 | -s "parse ServerName extension" \ |
| 6638 | -s "ssl_sni_wrapper() returned" \ |
| 6639 | -s "mbedtls_ssl_handshake returned" \ |
| 6640 | -c "mbedtls_ssl_handshake returned" \ |
| 6641 | -c "SSL - A fatal alert message was received from our peer" |
| 6642 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6643 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6644 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 6645 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6646 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6647 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6648 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6649 | 0 \ |
| 6650 | -S "skip write certificate request" \ |
| 6651 | -C "skip parse certificate request" \ |
| 6652 | -c "got a certificate request" \ |
| 6653 | -C "skip write certificate" \ |
| 6654 | -C "skip write certificate verify" \ |
| 6655 | -S "skip parse certificate verify" |
| 6656 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6657 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6658 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 6659 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6660 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6661 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,optional" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6662 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6663 | 0 \ |
| 6664 | -S "skip write certificate request" \ |
| 6665 | -C "skip parse certificate request" \ |
| 6666 | -c "got a certificate request" \ |
| 6667 | -C "skip write certificate" \ |
| 6668 | -C "skip write certificate verify" \ |
| 6669 | -S "skip parse certificate verify" |
| 6670 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6671 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6672 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 6673 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6674 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6675 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,none" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6676 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 6677 | 0 \ |
| 6678 | -s "skip write certificate request" \ |
| 6679 | -C "skip parse certificate request" \ |
| 6680 | -c "got no certificate request" \ |
| 6681 | -c "skip write certificate" \ |
| 6682 | -c "skip write certificate verify" \ |
| 6683 | -s "skip parse certificate verify" |
| 6684 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6685 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6686 | run_test "SNI: DTLS, CA no override" \ |
| 6687 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6688 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6689 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6690 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,required" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6691 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6692 | crt_file=$DATA_FILES_PATH/server6.crt key_file=$DATA_FILES_PATH/server6.key" \ |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 6693 | 1 \ |
| 6694 | -S "skip write certificate request" \ |
| 6695 | -C "skip parse certificate request" \ |
| 6696 | -c "got a certificate request" \ |
| 6697 | -C "skip write certificate" \ |
| 6698 | -C "skip write certificate verify" \ |
| 6699 | -S "skip parse certificate verify" \ |
| 6700 | -s "x509_verify_cert() returned" \ |
| 6701 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 6702 | -S "The certificate has been revoked (is on a CRL)" |
| 6703 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6704 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6705 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6706 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6707 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 6708 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6709 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,$DATA_FILES_PATH/test-ca2.crt,-,required" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6710 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6711 | crt_file=$DATA_FILES_PATH/server6.crt key_file=$DATA_FILES_PATH/server6.key" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6712 | 0 \ |
| 6713 | -S "skip write certificate request" \ |
| 6714 | -C "skip parse certificate request" \ |
| 6715 | -c "got a certificate request" \ |
| 6716 | -C "skip write certificate" \ |
| 6717 | -C "skip write certificate verify" \ |
| 6718 | -S "skip parse certificate verify" \ |
| 6719 | -S "x509_verify_cert() returned" \ |
| 6720 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6721 | -S "The certificate has been revoked (is on a CRL)" |
| 6722 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6723 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 6724 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6725 | "$P_SRV debug_level=3 auth_mode=optional \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6726 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key dtls=1 \ |
| 6727 | ca_file=$DATA_FILES_PATH/test-ca.crt \ |
| 6728 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,$DATA_FILES_PATH/test-ca2.crt,$DATA_FILES_PATH/crl-ec-sha256.pem,required" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6729 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 6730 | crt_file=$DATA_FILES_PATH/server6.crt key_file=$DATA_FILES_PATH/server6.key" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 6731 | 1 \ |
| 6732 | -S "skip write certificate request" \ |
| 6733 | -C "skip parse certificate request" \ |
| 6734 | -c "got a certificate request" \ |
| 6735 | -C "skip write certificate" \ |
| 6736 | -C "skip write certificate verify" \ |
| 6737 | -S "skip parse certificate verify" \ |
| 6738 | -s "x509_verify_cert() returned" \ |
| 6739 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 6740 | -s "The certificate has been revoked (is on a CRL)" |
| 6741 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6742 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 6743 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6744 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6745 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6746 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 6747 | "$P_CLI nbio=2 tickets=0" \ |
| 6748 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6749 | -S "mbedtls_ssl_handshake returned" \ |
| 6750 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6751 | -c "Read from server: .* bytes read" |
| 6752 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6753 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6754 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6755 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 6756 | "$P_CLI nbio=2 tickets=0" \ |
| 6757 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6758 | -S "mbedtls_ssl_handshake returned" \ |
| 6759 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6760 | -c "Read from server: .* bytes read" |
| 6761 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6762 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6763 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6764 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6765 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 6766 | "$P_CLI nbio=2 tickets=1" \ |
| 6767 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6768 | -S "mbedtls_ssl_handshake returned" \ |
| 6769 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6770 | -c "Read from server: .* bytes read" |
| 6771 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6772 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6773 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6774 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6775 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 6776 | "$P_CLI nbio=2 tickets=1" \ |
| 6777 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6778 | -S "mbedtls_ssl_handshake returned" \ |
| 6779 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6780 | -c "Read from server: .* bytes read" |
| 6781 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6782 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6783 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6784 | 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] | 6785 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6786 | "$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] | 6787 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6788 | -S "mbedtls_ssl_handshake returned" \ |
| 6789 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6790 | -c "Read from server: .* bytes read" |
| 6791 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6792 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6793 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6794 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6795 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6796 | run_test "Non-blocking I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6797 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6798 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6799 | 0 \ |
| 6800 | -S "mbedtls_ssl_handshake returned" \ |
| 6801 | -C "mbedtls_ssl_handshake returned" \ |
| 6802 | -c "Read from server: .* bytes read" |
| 6803 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6804 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6805 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6806 | 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] | 6807 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6808 | "$P_CLI force_version=tls12 nbio=2 tickets=1 reconnect=1" \ |
| 6809 | 0 \ |
| 6810 | -S "mbedtls_ssl_handshake returned" \ |
| 6811 | -C "mbedtls_ssl_handshake returned" \ |
| 6812 | -c "Read from server: .* bytes read" |
| 6813 | |
| 6814 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6815 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6816 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6817 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6818 | run_test "Non-blocking I/O: TLS 1.3 + ticket + resume" \ |
| 6819 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6820 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6821 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6822 | -S "mbedtls_ssl_handshake returned" \ |
| 6823 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6824 | -c "Read from server: .* bytes read" |
| 6825 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6826 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6827 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6828 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6829 | "$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] | 6830 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6831 | -S "mbedtls_ssl_handshake returned" \ |
| 6832 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 6833 | -c "Read from server: .* bytes read" |
| 6834 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6835 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 6836 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6837 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6838 | run_test "Event-driven I/O: basic handshake" \ |
| 6839 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 6840 | "$P_CLI event=1 tickets=0" \ |
| 6841 | 0 \ |
| 6842 | -S "mbedtls_ssl_handshake returned" \ |
| 6843 | -C "mbedtls_ssl_handshake returned" \ |
| 6844 | -c "Read from server: .* bytes read" |
| 6845 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 6846 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6847 | run_test "Event-driven I/O: client auth" \ |
| 6848 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 6849 | "$P_CLI event=1 tickets=0" \ |
| 6850 | 0 \ |
| 6851 | -S "mbedtls_ssl_handshake returned" \ |
| 6852 | -C "mbedtls_ssl_handshake returned" \ |
| 6853 | -c "Read from server: .* bytes read" |
| 6854 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6855 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6856 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6857 | run_test "Event-driven I/O: ticket" \ |
| 6858 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 6859 | "$P_CLI event=1 tickets=1" \ |
| 6860 | 0 \ |
| 6861 | -S "mbedtls_ssl_handshake returned" \ |
| 6862 | -C "mbedtls_ssl_handshake returned" \ |
| 6863 | -c "Read from server: .* bytes read" |
| 6864 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6865 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6866 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6867 | run_test "Event-driven I/O: ticket + client auth" \ |
| 6868 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 6869 | "$P_CLI event=1 tickets=1" \ |
| 6870 | 0 \ |
| 6871 | -S "mbedtls_ssl_handshake returned" \ |
| 6872 | -C "mbedtls_ssl_handshake returned" \ |
| 6873 | -c "Read from server: .* bytes read" |
| 6874 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6875 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6876 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6877 | 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] | 6878 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6879 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6880 | 0 \ |
| 6881 | -S "mbedtls_ssl_handshake returned" \ |
| 6882 | -C "mbedtls_ssl_handshake returned" \ |
| 6883 | -c "Read from server: .* bytes read" |
| 6884 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6885 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6886 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6887 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6888 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6889 | run_test "Event-driven I/O: TLS 1.3 + ticket + client auth + resume" \ |
| 6890 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6891 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6892 | 0 \ |
| 6893 | -S "mbedtls_ssl_handshake returned" \ |
| 6894 | -C "mbedtls_ssl_handshake returned" \ |
| 6895 | -c "Read from server: .* bytes read" |
| 6896 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6897 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6898 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6899 | run_test "Event-driven I/O: TLS 1.2 + ticket + resume" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6900 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6901 | "$P_CLI force_version=tls12 event=1 tickets=1 reconnect=1" \ |
| 6902 | 0 \ |
| 6903 | -S "mbedtls_ssl_handshake returned" \ |
| 6904 | -C "mbedtls_ssl_handshake returned" \ |
| 6905 | -c "Read from server: .* bytes read" |
| 6906 | |
| 6907 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 6908 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 6909 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6910 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 6911 | run_test "Event-driven I/O: TLS 1.3 + ticket + resume" \ |
| 6912 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 6913 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6914 | 0 \ |
| 6915 | -S "mbedtls_ssl_handshake returned" \ |
| 6916 | -C "mbedtls_ssl_handshake returned" \ |
| 6917 | -c "Read from server: .* bytes read" |
| 6918 | |
Ronald Cron | 5de538c | 2022-10-20 14:47:56 +0200 | [diff] [blame] | 6919 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6920 | run_test "Event-driven I/O: session-id resume" \ |
| 6921 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 6922 | "$P_CLI force_version=tls12 event=1 tickets=0 reconnect=1" \ |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 6923 | 0 \ |
| 6924 | -S "mbedtls_ssl_handshake returned" \ |
| 6925 | -C "mbedtls_ssl_handshake returned" \ |
| 6926 | -c "Read from server: .* bytes read" |
| 6927 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6928 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6929 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 6930 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 6931 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6932 | 0 \ |
| 6933 | -c "Read from server: .* bytes read" |
| 6934 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6935 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6936 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 6937 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 6938 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 6939 | 0 \ |
| 6940 | -c "Read from server: .* bytes read" |
| 6941 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6942 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6943 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6944 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 6945 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 6946 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6947 | 0 \ |
| 6948 | -c "Read from server: .* bytes read" |
| 6949 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6950 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6951 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6952 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 6953 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 6954 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 6955 | 0 \ |
| 6956 | -c "Read from server: .* bytes read" |
| 6957 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6958 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6959 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6960 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 6961 | "$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] | 6962 | "$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] | 6963 | 0 \ |
| 6964 | -c "Read from server: .* bytes read" |
| 6965 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6966 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 6967 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6968 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 6969 | "$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] | 6970 | "$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] | 6971 | 0 \ |
| 6972 | -c "Read from server: .* bytes read" |
| 6973 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6974 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 6975 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 6976 | "$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] | 6977 | "$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] | 6978 | 0 \ |
| 6979 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6980 | |
| 6981 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 6982 | # During session resumption, the client will send its ApplicationData record |
| 6983 | # within the same datagram as the Finished messages. In this situation, the |
| 6984 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 6985 | # because the ApplicationData request has already been queued internally. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 6986 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6987 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6988 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 6989 | "$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] | 6990 | "$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] | 6991 | 0 \ |
| 6992 | -c "Read from server: .* bytes read" |
| 6993 | |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 6994 | # Tests for version negotiation. Some information to ease the understanding |
| 6995 | # of the version negotiation test titles below: |
| 6996 | # . 1.2/1.3 means that only TLS 1.2/TLS 1.3 is enabled. |
| 6997 | # . 1.2+1.3 means that both TLS 1.2 and TLS 1.3 are enabled. |
| 6998 | # . 1.2+(1.3)/(1.2)+1.3 means that TLS 1.2/1.3 is enabled and that |
| 6999 | # TLS 1.3/1.2 may be enabled or not. |
| 7000 | # . max=1.2 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 7001 | # TLS 1.3 is disabled at runtime (maximum negotiable version is TLS 1.2). |
| 7002 | # . min=1.3 means that both TLS 1.2 and TLS 1.3 are enabled at build time but |
| 7003 | # TLS 1.2 is disabled at runtime (minimum negotiable version is TLS 1.3). |
| 7004 | |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7005 | # Tests for version negotiation, MbedTLS client and server |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7006 | |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7007 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C |
| 7008 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7009 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7010 | run_test "Version nego m->m: cli 1.2, srv 1.2 -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7011 | "$P_SRV" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7012 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7013 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7014 | -S "mbedtls_ssl_handshake returned" \ |
| 7015 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7016 | -s "Protocol is TLSv1.2" \ |
| 7017 | -c "Protocol is TLSv1.2" |
| 7018 | |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7019 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7020 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7021 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7022 | run_test "Version nego m->m: cli max=1.2, srv max=1.2 -> 1.2" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7023 | "$P_SRV max_version=tls12" \ |
| 7024 | "$P_CLI max_version=tls12" \ |
| 7025 | 0 \ |
| 7026 | -S "mbedtls_ssl_handshake returned" \ |
| 7027 | -C "mbedtls_ssl_handshake returned" \ |
| 7028 | -s "Protocol is TLSv1.2" \ |
| 7029 | -c "Protocol is TLSv1.2" |
| 7030 | |
| 7031 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7032 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 7033 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7034 | run_test "Version nego m->m: cli 1.3, srv 1.3 -> 1.3" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7035 | "$P_SRV" \ |
| 7036 | "$P_CLI" \ |
| 7037 | 0 \ |
| 7038 | -S "mbedtls_ssl_handshake returned" \ |
| 7039 | -C "mbedtls_ssl_handshake returned" \ |
| 7040 | -s "Protocol is TLSv1.3" \ |
| 7041 | -c "Protocol is TLSv1.3" |
| 7042 | |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7043 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7044 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7045 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7046 | run_test "Version nego m->m: cli min=1.3, srv min=1.3 -> 1.3" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7047 | "$P_SRV min_version=tls13" \ |
| 7048 | "$P_CLI min_version=tls13" \ |
| 7049 | 0 \ |
| 7050 | -S "mbedtls_ssl_handshake returned" \ |
| 7051 | -C "mbedtls_ssl_handshake returned" \ |
| 7052 | -s "Protocol is TLSv1.3" \ |
| 7053 | -c "Protocol is TLSv1.3" |
| 7054 | |
| 7055 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7056 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7057 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7058 | run_test "Version nego m->m: cli 1.2+1.3, srv 1.2+1.3 -> 1.3" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7059 | "$P_SRV" \ |
| 7060 | "$P_CLI" \ |
| 7061 | 0 \ |
| 7062 | -S "mbedtls_ssl_handshake returned" \ |
| 7063 | -C "mbedtls_ssl_handshake returned" \ |
| 7064 | -s "Protocol is TLSv1.3" \ |
| 7065 | -c "Protocol is TLSv1.3" |
| 7066 | |
| 7067 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7068 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7069 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7070 | run_test "Version nego m->m: cli 1.2+1.3, srv min=1.3 -> 1.3" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7071 | "$P_SRV min_version=tls13" \ |
| 7072 | "$P_CLI" \ |
| 7073 | 0 \ |
| 7074 | -S "mbedtls_ssl_handshake returned" \ |
| 7075 | -C "mbedtls_ssl_handshake returned" \ |
| 7076 | -s "Protocol is TLSv1.3" \ |
| 7077 | -c "Protocol is TLSv1.3" |
| 7078 | |
| 7079 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7080 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7081 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7082 | run_test "Version nego m->m: cli 1.2+1.3, srv max=1.2 -> 1.2" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7083 | "$P_SRV max_version=tls12" \ |
| 7084 | "$P_CLI" \ |
| 7085 | 0 \ |
| 7086 | -S "mbedtls_ssl_handshake returned" \ |
| 7087 | -C "mbedtls_ssl_handshake returned" \ |
| 7088 | -s "Protocol is TLSv1.2" \ |
| 7089 | -c "Protocol is TLSv1.2" |
| 7090 | |
| 7091 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7092 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7093 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7094 | run_test "Version nego m->m: cli max=1.2, srv 1.2+1.3 -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7095 | "$P_SRV" \ |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7096 | "$P_CLI max_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 7097 | 0 \ |
| 7098 | -S "mbedtls_ssl_handshake returned" \ |
| 7099 | -C "mbedtls_ssl_handshake returned" \ |
| 7100 | -s "Protocol is TLSv1.2" \ |
| 7101 | -c "Protocol is TLSv1.2" |
| 7102 | |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7103 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7104 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7105 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7106 | run_test "Version nego m->m: cli min=1.3, srv 1.2+1.3 -> 1.3" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7107 | "$P_SRV" \ |
| 7108 | "$P_CLI min_version=tls13" \ |
| 7109 | 0 \ |
| 7110 | -S "mbedtls_ssl_handshake returned" \ |
| 7111 | -C "mbedtls_ssl_handshake returned" \ |
| 7112 | -s "Protocol is TLSv1.3" \ |
| 7113 | -c "Protocol is TLSv1.3" |
| 7114 | |
| 7115 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7116 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7117 | run_test "Not supported version m->m: cli max=1.2, srv min=1.3" \ |
Ronald Cron | dcfd00c | 2024-03-06 15:58:50 +0100 | [diff] [blame] | 7118 | "$P_SRV min_version=tls13" \ |
| 7119 | "$P_CLI max_version=tls12" \ |
| 7120 | 1 \ |
| 7121 | -s "Handshake protocol not within min/max boundaries" \ |
| 7122 | -S "Protocol is TLSv1.2" \ |
| 7123 | -C "Protocol is TLSv1.2" \ |
| 7124 | -S "Protocol is TLSv1.3" \ |
| 7125 | -C "Protocol is TLSv1.3" |
Ronald Cron | fe18d8d | 2024-03-06 15:19:55 +0100 | [diff] [blame] | 7126 | |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7127 | requires_all_configs_enabled MBEDTLS_SSL_CLI_C MBEDTLS_SSL_SRV_C \ |
| 7128 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7129 | run_test "Not supported version m->m: cli min=1.3, srv max=1.2" \ |
Ronald Cron | 114c5f0 | 2024-03-06 15:24:41 +0100 | [diff] [blame] | 7130 | "$P_SRV max_version=tls12" \ |
| 7131 | "$P_CLI min_version=tls13" \ |
| 7132 | 1 \ |
| 7133 | -s "The handshake negotiation failed" \ |
| 7134 | -S "Protocol is TLSv1.2" \ |
| 7135 | -C "Protocol is TLSv1.2" \ |
| 7136 | -S "Protocol is TLSv1.3" \ |
| 7137 | -C "Protocol is TLSv1.3" |
| 7138 | |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7139 | # Tests of version negotiation on server side against GnuTLS client |
| 7140 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7141 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7142 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7143 | run_test "Server version nego G->m: cli 1.2, srv 1.2+(1.3) -> 1.2" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7144 | "$P_SRV" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7145 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7146 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7147 | -S "mbedtls_ssl_handshake returned" \ |
| 7148 | -s "Protocol is TLSv1.2" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7149 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7150 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7151 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7152 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7153 | run_test "Server version nego G->m: cli 1.2, srv max=1.2 -> 1.2" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7154 | "$P_SRV max_version=tls12" \ |
| 7155 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7156 | 0 \ |
| 7157 | -S "mbedtls_ssl_handshake returned" \ |
| 7158 | -s "Protocol is TLSv1.2" |
| 7159 | |
| 7160 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7161 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7162 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7163 | run_test "Server version nego G->m: cli 1.3, srv (1.2)+1.3 -> 1.3" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7164 | "$P_SRV" \ |
| 7165 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7166 | 0 \ |
| 7167 | -S "mbedtls_ssl_handshake returned" \ |
| 7168 | -s "Protocol is TLSv1.3" |
| 7169 | |
| 7170 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7171 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7172 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7173 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7174 | run_test "Server version nego G->m: cli 1.3, srv min=1.3 -> 1.3" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7175 | "$P_SRV min_version=tls13" \ |
| 7176 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7177 | 0 \ |
| 7178 | -S "mbedtls_ssl_handshake returned" \ |
| 7179 | -s "Protocol is TLSv1.3" |
| 7180 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7181 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7182 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7183 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7184 | run_test "Server version nego G->m: cli 1.2+1.3, srv (1.2)+1.3 -> 1.3" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7185 | "$P_SRV" \ |
| 7186 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7187 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7188 | -S "mbedtls_ssl_handshake returned" \ |
| 7189 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7190 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7191 | requires_gnutls_next_disable_tls13_compat |
| 7192 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7193 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7194 | run_test "Server version nego G->m (no compat): cli 1.2+1.3, srv (1.2)+1.3 -> 1.3" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7195 | "$P_SRV" \ |
| 7196 | "$G_NEXT_CLI localhost --priority=NORMAL:%DISABLE_TLS13_COMPAT_MODE" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7197 | 0 \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7198 | -S "mbedtls_ssl_handshake returned" \ |
| 7199 | -s "Protocol is TLSv1.3" |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7200 | |
| 7201 | # GnuTLS can be setup to send a ClientHello containing a supported versions |
| 7202 | # extension proposing TLS 1.2 (preferred) and then TLS 1.3. In that case, |
| 7203 | # a TLS 1.3 and TLS 1.2 capable server is supposed to negotiate TLS 1.2 and |
| 7204 | # to indicate in the ServerHello that it downgrades from TLS 1.3. The GnuTLS |
| 7205 | # client then detects the downgrade indication and aborts the handshake even |
| 7206 | # if TLS 1.2 was its preferred version. Keeping the test even if the |
| 7207 | # handshake fails eventually as it exercices parts of the Mbed TLS |
| 7208 | # implementation that are otherwise not exercised. |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7209 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7210 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7211 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7212 | run_test "Server version nego G->m: cli 1.2+1.3 (1.2 preferred!), srv 1.2+1.3 -> 1.2" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7213 | "$P_SRV" \ |
Ronald Cron | cd1370e | 2024-03-12 16:07:48 +0100 | [diff] [blame] | 7214 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.3" \ |
| 7215 | 1 \ |
| 7216 | -c "Detected downgrade to TLS 1.2 from TLS 1.3" |
| 7217 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7218 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7219 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7220 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7221 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7222 | run_test "Server version nego G->m: cli 1.2+1.3, srv min=1.3 -> 1.3" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7223 | "$P_SRV min_version=tls13" \ |
| 7224 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7225 | 0 \ |
| 7226 | -S "mbedtls_ssl_handshake returned" \ |
| 7227 | -s "Protocol is TLSv1.3" |
| 7228 | |
| 7229 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7230 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7231 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7232 | run_test "Server version nego G->m: cli 1.2+1.3, srv 1.2 -> 1.2" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7233 | "$P_SRV" \ |
| 7234 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7235 | 0 \ |
| 7236 | -S "mbedtls_ssl_handshake returned" \ |
| 7237 | -s "Protocol is TLSv1.2" |
| 7238 | |
| 7239 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7240 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7241 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7242 | run_test "Server version nego G->m: cli 1.2+1.3, max=1.2 -> 1.2" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7243 | "$P_SRV max_version=tls12" \ |
| 7244 | "$G_NEXT_CLI localhost --priority=NORMAL" \ |
| 7245 | 0 \ |
| 7246 | -S "mbedtls_ssl_handshake returned" \ |
| 7247 | -s "Protocol is TLSv1.2" |
| 7248 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7249 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7250 | run_test "Not supported version G->m: cli 1.0, (1.2)+(1.3)" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7251 | "$P_SRV" \ |
| 7252 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 7253 | 1 \ |
| 7254 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7255 | -S "Protocol is TLSv1.0" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7256 | |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7257 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7258 | run_test "Not supported version G->m: cli 1.1, (1.2)+(1.3)" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7259 | "$P_SRV" \ |
| 7260 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 7261 | 1 \ |
| 7262 | -s "Handshake protocol not within min/max boundaries" \ |
Ronald Cron | 98bdcc4 | 2024-03-06 15:00:42 +0100 | [diff] [blame] | 7263 | -S "Protocol is TLSv1.1" |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7264 | |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7265 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7266 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7267 | run_test "Not supported version G->m: cli 1.2, srv 1.3" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7268 | "$P_SRV" \ |
| 7269 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7270 | 1 \ |
| 7271 | -s "Handshake protocol not within min/max boundaries" \ |
| 7272 | -S "Protocol is TLSv1.2" |
| 7273 | |
| 7274 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7275 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7276 | run_test "Not supported version G->m: cli 1.3, srv 1.2" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7277 | "$P_SRV" \ |
| 7278 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7279 | 1 \ |
| 7280 | -S "Handshake protocol not within min/max boundaries" \ |
| 7281 | -s "The handshake negotiation failed" \ |
| 7282 | -S "Protocol is TLSv1.3" |
| 7283 | |
| 7284 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7285 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7286 | run_test "Not supported version G->m: cli 1.2, srv min=1.3" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7287 | "$P_SRV min_version=tls13" \ |
| 7288 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
| 7289 | 1 \ |
| 7290 | -s "Handshake protocol not within min/max boundaries" \ |
| 7291 | -S "Protocol is TLSv1.2" |
| 7292 | |
| 7293 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7294 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7295 | run_test "Not supported version G->m: cli 1.3, srv max=1.2" \ |
Ronald Cron | dfad493 | 2024-03-06 15:05:14 +0100 | [diff] [blame] | 7296 | "$P_SRV max_version=tls12" \ |
| 7297 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3" \ |
| 7298 | 1 \ |
| 7299 | -S "Handshake protocol not within min/max boundaries" \ |
| 7300 | -s "The handshake negotiation failed" \ |
| 7301 | -S "Protocol is TLSv1.3" |
| 7302 | |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7303 | # Tests of version negotiation on server side against OpenSSL client |
| 7304 | |
| 7305 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_2 |
| 7306 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7307 | run_test "Server version nego O->m: cli 1.2, srv 1.2+(1.3) -> 1.2" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7308 | "$P_SRV" \ |
| 7309 | "$O_NEXT_CLI -tls1_2" \ |
| 7310 | 0 \ |
| 7311 | -S "mbedtls_ssl_handshake returned" \ |
| 7312 | -s "Protocol is TLSv1.2" |
| 7313 | |
| 7314 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7315 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7316 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7317 | run_test "Server version nego O->m: cli 1.2, srv max=1.2 -> 1.2" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7318 | "$P_SRV max_version=tls12" \ |
| 7319 | "$O_NEXT_CLI -tls1_2" \ |
| 7320 | 0 \ |
| 7321 | -S "mbedtls_ssl_handshake returned" \ |
| 7322 | -s "Protocol is TLSv1.2" |
| 7323 | |
| 7324 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7325 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7326 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7327 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7328 | run_test "Server version nego O->m: cli 1.3, srv (1.2)+1.3 -> 1.3" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7329 | "$P_SRV" \ |
| 7330 | "$O_NEXT_CLI -tls1_3" \ |
| 7331 | 0 \ |
| 7332 | -S "mbedtls_ssl_handshake returned" \ |
| 7333 | -s "Protocol is TLSv1.3" |
| 7334 | |
| 7335 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7336 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7337 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7338 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7339 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7340 | run_test "Server version nego O->m: cli 1.3, srv min=1.3 -> 1.3" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7341 | "$P_SRV min_version=tls13" \ |
| 7342 | "$O_NEXT_CLI -tls1_3" \ |
| 7343 | 0 \ |
| 7344 | -S "mbedtls_ssl_handshake returned" \ |
| 7345 | -s "Protocol is TLSv1.3" |
| 7346 | |
| 7347 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7348 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7349 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7350 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7351 | run_test "Server version nego O->m: cli 1.2+1.3, srv (1.2)+1.3 -> 1.3" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7352 | "$P_SRV" \ |
| 7353 | "$O_NEXT_CLI" \ |
| 7354 | 0 \ |
| 7355 | -S "mbedtls_ssl_handshake returned" \ |
| 7356 | -s "Protocol is TLSv1.3" |
| 7357 | |
| 7358 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7359 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7360 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7361 | run_test "Server version nego O->m (no compat): cli 1.2+1.3, srv (1.2)+1.3 -> 1.3" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7362 | "$P_SRV" \ |
| 7363 | "$O_NEXT_CLI -no_middlebox" \ |
| 7364 | 0 \ |
| 7365 | -S "mbedtls_ssl_handshake returned" \ |
| 7366 | -s "Protocol is TLSv1.3" |
| 7367 | |
| 7368 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7369 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7370 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 \ |
| 7371 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED \ |
| 7372 | MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7373 | run_test "Server version nego O->m: cli 1.2+1.3, srv min=1.3 -> 1.3" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7374 | "$P_SRV min_version=tls13" \ |
| 7375 | "$O_NEXT_CLI" \ |
| 7376 | 0 \ |
| 7377 | -S "mbedtls_ssl_handshake returned" \ |
| 7378 | -s "Protocol is TLSv1.3" |
| 7379 | |
| 7380 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7381 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7382 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7383 | run_test "Server version nego O->m: cli 1.2+1.3, srv 1.2 -> 1.2" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7384 | "$P_SRV" \ |
| 7385 | "$O_NEXT_CLI" \ |
| 7386 | 0 \ |
| 7387 | -S "mbedtls_ssl_handshake returned" \ |
| 7388 | -s "Protocol is TLSv1.2" |
| 7389 | |
| 7390 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7391 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
| 7392 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7393 | run_test "Server version nego O->m: cli 1.2+1.3, srv max=1.2 -> 1.2" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7394 | "$P_SRV max_version=tls12" \ |
| 7395 | "$O_NEXT_CLI" \ |
| 7396 | 0 \ |
| 7397 | -S "mbedtls_ssl_handshake returned" \ |
| 7398 | -s "Protocol is TLSv1.2" |
| 7399 | |
| 7400 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7401 | run_test "Not supported version O->m: cli 1.0, srv (1.2)+(1.3)" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7402 | "$P_SRV" \ |
| 7403 | "$O_CLI -tls1" \ |
| 7404 | 1 \ |
| 7405 | -s "Handshake protocol not within min/max boundaries" \ |
| 7406 | -S "Protocol is TLSv1.0" |
| 7407 | |
| 7408 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7409 | run_test "Not supported version O->m: cli 1.1, srv (1.2)+(1.3)" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7410 | "$P_SRV" \ |
| 7411 | "$O_CLI -tls1_1" \ |
| 7412 | 1 \ |
| 7413 | -s "Handshake protocol not within min/max boundaries" \ |
| 7414 | -S "Protocol is TLSv1.1" |
| 7415 | |
| 7416 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7417 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7418 | run_test "Not supported version O->m: cli 1.2, srv 1.3" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7419 | "$P_SRV" \ |
| 7420 | "$O_NEXT_CLI -tls1_2" \ |
| 7421 | 1 \ |
| 7422 | -s "Handshake protocol not within min/max boundaries" \ |
| 7423 | -S "Protocol is TLSv1.2" |
| 7424 | |
| 7425 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 7426 | requires_config_disabled MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7427 | run_test "Not supported version O->m: cli 1.3, srv 1.2" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7428 | "$P_SRV" \ |
| 7429 | "$O_NEXT_CLI -tls1_3" \ |
| 7430 | 1 \ |
| 7431 | -S "Handshake protocol not within min/max boundaries" \ |
| 7432 | -s "The handshake negotiation failed" \ |
| 7433 | -S "Protocol is TLSv1.3" |
| 7434 | |
| 7435 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7436 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7437 | run_test "Not supported version O->m: cli 1.2, srv min=1.3" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7438 | "$P_SRV min_version=tls13" \ |
| 7439 | "$O_NEXT_CLI -tls1_2" \ |
| 7440 | 1 \ |
| 7441 | -s "Handshake protocol not within min/max boundaries" \ |
| 7442 | -S "Protocol is TLSv1.2" |
| 7443 | |
| 7444 | requires_all_configs_enabled MBEDTLS_SSL_SRV_C \ |
| 7445 | MBEDTLS_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7446 | run_test "Not supported version O->m: cli 1.3, srv max=1.2" \ |
Ronald Cron | 10797e3 | 2024-03-07 08:27:24 +0100 | [diff] [blame] | 7447 | "$P_SRV max_version=tls12" \ |
| 7448 | "$O_NEXT_CLI -tls1_3" \ |
| 7449 | 1 \ |
| 7450 | -S "Handshake protocol not within min/max boundaries" \ |
| 7451 | -s "The handshake negotiation failed" \ |
| 7452 | -S "Protocol is TLSv1.3" |
| 7453 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7454 | # Tests of version negotiation on client side against GnuTLS and OpenSSL server |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7455 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7456 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7457 | run_test "Not supported version: srv max TLS 1.0" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7458 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 7459 | "$P_CLI" \ |
| 7460 | 1 \ |
| 7461 | -s "Error in protocol version" \ |
| 7462 | -c "Handshake protocol not within min/max boundaries" \ |
| 7463 | -S "Version: TLS1.0" \ |
| 7464 | -C "Protocol is TLSv1.0" |
| 7465 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7466 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7467 | run_test "Not supported version: srv max TLS 1.1" \ |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 7468 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 7469 | "$P_CLI" \ |
| 7470 | 1 \ |
| 7471 | -s "Error in protocol version" \ |
| 7472 | -c "Handshake protocol not within min/max boundaries" \ |
| 7473 | -S "Version: TLS1.1" \ |
| 7474 | -C "Protocol is TLSv1.1" |
| 7475 | |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7476 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7477 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7478 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7479 | skip_handshake_stage_check |
| 7480 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7481 | run_test "TLS 1.3: Not supported version:gnutls: srv max TLS 1.0" \ |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7482 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0 -d 4" \ |
| 7483 | "$P_CLI debug_level=4" \ |
| 7484 | 1 \ |
| 7485 | -s "Client's version: 3.3" \ |
| 7486 | -S "Version: TLS1.0" \ |
| 7487 | -C "Protocol is TLSv1.0" |
| 7488 | |
| 7489 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7490 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7491 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7492 | skip_handshake_stage_check |
| 7493 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7494 | run_test "TLS 1.3: Not supported version:gnutls: srv max TLS 1.1" \ |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7495 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1 -d 4" \ |
| 7496 | "$P_CLI debug_level=4" \ |
| 7497 | 1 \ |
| 7498 | -s "Client's version: 3.3" \ |
| 7499 | -S "Version: TLS1.1" \ |
| 7500 | -C "Protocol is TLSv1.1" |
| 7501 | |
| 7502 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7503 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7504 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7505 | skip_handshake_stage_check |
| 7506 | requires_gnutls_tls1_3 |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7507 | run_test "TLS 1.3: Not supported version:gnutls: srv max TLS 1.2" \ |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7508 | "$G_NEXT_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 -d 4" \ |
| 7509 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7510 | 1 \ |
| 7511 | -s "Client's version: 3.3" \ |
| 7512 | -c "is a fatal alert message (msg 40)" \ |
| 7513 | -S "Version: TLS1.2" \ |
| 7514 | -C "Protocol is TLSv1.2" |
| 7515 | |
| 7516 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7517 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7518 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7519 | skip_handshake_stage_check |
| 7520 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7521 | run_test "TLS 1.3: Not supported version:openssl: srv max TLS 1.0" \ |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7522 | "$O_NEXT_SRV -msg -tls1" \ |
| 7523 | "$P_CLI debug_level=4" \ |
| 7524 | 1 \ |
| 7525 | -s "fatal protocol_version" \ |
| 7526 | -c "is a fatal alert message (msg 70)" \ |
| 7527 | -S "Version: TLS1.0" \ |
| 7528 | -C "Protocol : TLSv1.0" |
| 7529 | |
| 7530 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7531 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7532 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7533 | skip_handshake_stage_check |
| 7534 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7535 | run_test "TLS 1.3: Not supported version:openssl: srv max TLS 1.1" \ |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7536 | "$O_NEXT_SRV -msg -tls1_1" \ |
| 7537 | "$P_CLI debug_level=4" \ |
| 7538 | 1 \ |
| 7539 | -s "fatal protocol_version" \ |
| 7540 | -c "is a fatal alert message (msg 70)" \ |
| 7541 | -S "Version: TLS1.1" \ |
| 7542 | -C "Protocol : TLSv1.1" |
| 7543 | |
| 7544 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 7545 | requires_config_enabled MBEDTLS_DEBUG_C |
| 7546 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 7547 | skip_handshake_stage_check |
| 7548 | requires_openssl_next |
Ronald Cron | 35884a4 | 2024-03-15 15:43:14 +0100 | [diff] [blame] | 7549 | run_test "TLS 1.3: Not supported version:openssl: srv max TLS 1.2" \ |
Ronald Cron | a1e7b6a | 2024-03-06 15:13:49 +0100 | [diff] [blame] | 7550 | "$O_NEXT_SRV -msg -tls1_2" \ |
| 7551 | "$P_CLI force_version=tls13 debug_level=4" \ |
| 7552 | 1 \ |
| 7553 | -s "fatal protocol_version" \ |
| 7554 | -c "is a fatal alert message (msg 70)" \ |
| 7555 | -S "Version: TLS1.2" \ |
| 7556 | -C "Protocol : TLSv1.2" |
| 7557 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7558 | # Tests for ALPN extension |
| 7559 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7560 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7561 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7562 | "$P_SRV debug_level=3" \ |
| 7563 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7564 | 0 \ |
| 7565 | -C "client hello, adding alpn extension" \ |
| 7566 | -S "found alpn extension" \ |
| 7567 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7568 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7569 | -C "found alpn extension " \ |
| 7570 | -C "Application Layer Protocol is" \ |
| 7571 | -S "Application Layer Protocol is" |
| 7572 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7573 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7574 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7575 | "$P_SRV debug_level=3" \ |
| 7576 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7577 | 0 \ |
| 7578 | -c "client hello, adding alpn extension" \ |
| 7579 | -s "found alpn extension" \ |
| 7580 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7581 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7582 | -C "found alpn extension " \ |
| 7583 | -c "Application Layer Protocol is (none)" \ |
| 7584 | -S "Application Layer Protocol is" |
| 7585 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7586 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7587 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7588 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7589 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7590 | 0 \ |
| 7591 | -C "client hello, adding alpn extension" \ |
| 7592 | -S "found alpn extension" \ |
| 7593 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7594 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7595 | -C "found alpn extension " \ |
| 7596 | -C "Application Layer Protocol is" \ |
| 7597 | -s "Application Layer Protocol is (none)" |
| 7598 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7599 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7600 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7601 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7602 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7603 | 0 \ |
| 7604 | -c "client hello, adding alpn extension" \ |
| 7605 | -s "found alpn extension" \ |
| 7606 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7607 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7608 | -c "found alpn extension" \ |
| 7609 | -c "Application Layer Protocol is abc" \ |
| 7610 | -s "Application Layer Protocol is abc" |
| 7611 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7612 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7613 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7614 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7615 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7616 | 0 \ |
| 7617 | -c "client hello, adding alpn extension" \ |
| 7618 | -s "found alpn extension" \ |
| 7619 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7620 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7621 | -c "found alpn extension" \ |
| 7622 | -c "Application Layer Protocol is abc" \ |
| 7623 | -s "Application Layer Protocol is abc" |
| 7624 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7625 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7626 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7627 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 7628 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7629 | 0 \ |
| 7630 | -c "client hello, adding alpn extension" \ |
| 7631 | -s "found alpn extension" \ |
| 7632 | -C "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7633 | -s "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7634 | -c "found alpn extension" \ |
| 7635 | -c "Application Layer Protocol is 1234" \ |
| 7636 | -s "Application Layer Protocol is 1234" |
| 7637 | |
Ronald Cron | bc5adf4 | 2022-10-04 11:06:14 +0200 | [diff] [blame] | 7638 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 7639 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7640 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 7641 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7642 | 1 \ |
| 7643 | -c "client hello, adding alpn extension" \ |
| 7644 | -s "found alpn extension" \ |
| 7645 | -c "got an alert message, type: \\[2:120]" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 7646 | -S "server side, adding alpn extension" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 7647 | -C "found alpn extension" \ |
| 7648 | -C "Application Layer Protocol is 1234" \ |
| 7649 | -S "Application Layer Protocol is 1234" |
| 7650 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 7651 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7652 | # Tests for keyUsage in leaf certificates, part 1: |
| 7653 | # server-side certificate/suite selection |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7654 | # |
| 7655 | # This is only about 1.2 (for 1.3, all key exchanges use signatures). |
| 7656 | # In 4.0 this will probably go away as all TLS 1.2 key exchanges will use |
| 7657 | # signatures too, following the removal of RSA #8170 and static ECDH #9201. |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7658 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7659 | run_test "keyUsage srv 1.2: RSA, digitalSignature -> (EC)DHE-RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7660 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7661 | crt_file=$DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7662 | "$P_CLI" \ |
| 7663 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 7664 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7665 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7666 | run_test "keyUsage srv 1.2: RSA, keyEncipherment -> RSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7667 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7668 | crt_file=$DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7669 | "$P_CLI" \ |
| 7670 | 0 \ |
| 7671 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 7672 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7673 | run_test "keyUsage srv 1.2: RSA, keyAgreement -> fail" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7674 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server2.key \ |
| 7675 | crt_file=$DATA_FILES_PATH/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7676 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7677 | 1 \ |
| 7678 | -C "Ciphersuite is " |
| 7679 | |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 7680 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7681 | run_test "keyUsage srv 1.2: ECC, digitalSignature -> ECDHE-ECDSA" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7682 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7683 | crt_file=$DATA_FILES_PATH/server5.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7684 | "$P_CLI" \ |
| 7685 | 0 \ |
| 7686 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 7687 | |
| 7688 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7689 | run_test "keyUsage srv 1.2: ECC, keyAgreement -> ECDH-" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7690 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7691 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7692 | "$P_CLI" \ |
| 7693 | 0 \ |
| 7694 | -c "Ciphersuite is TLS-ECDH-" |
| 7695 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7696 | run_test "keyUsage srv 1.2: ECC, keyEncipherment -> fail" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7697 | "$P_SRV force_version=tls12 key_file=$DATA_FILES_PATH/server5.key \ |
| 7698 | crt_file=$DATA_FILES_PATH/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 7699 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7700 | 1 \ |
| 7701 | -C "Ciphersuite is " |
| 7702 | |
| 7703 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7704 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7705 | # |
| 7706 | # TLS 1.3 uses only signature, but for 1.2 it depends on the key exchange. |
| 7707 | # In 4.0 this will probably change as all TLS 1.2 key exchanges will use |
| 7708 | # signatures too, following the removal of RSA #8170 and static ECDH #9201. |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7709 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7710 | run_test "keyUsage cli 1.2: DigitalSignature+KeyEncipherment, RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7711 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7712 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7713 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7714 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7715 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7716 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7717 | -C "Processing of the Certificate handshake message failed" \ |
| 7718 | -c "Ciphersuite is TLS-" |
| 7719 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7720 | run_test "keyUsage cli 1.2: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7721 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7722 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7723 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7724 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7725 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7726 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7727 | -C "Processing of the Certificate handshake message failed" \ |
| 7728 | -c "Ciphersuite is TLS-" |
| 7729 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7730 | run_test "keyUsage cli 1.2: KeyEncipherment, RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7731 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7732 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7733 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7734 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7735 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7736 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7737 | -C "Processing of the Certificate handshake message failed" \ |
| 7738 | -c "Ciphersuite is TLS-" |
| 7739 | |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7740 | run_test "keyUsage cli 1.2: KeyEncipherment, DHE-RSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7741 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7742 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7743 | "$P_CLI debug_level=3 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7744 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7745 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7746 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7747 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7748 | -C "Ciphersuite is TLS-" \ |
| 7749 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7750 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7751 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7752 | |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7753 | run_test "keyUsage cli 1.2: KeyEncipherment, DHE-RSA: fail (soft)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7754 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7755 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7756 | "$P_CLI debug_level=3 auth_mode=optional \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7757 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7758 | 0 \ |
| 7759 | -c "bad certificate (usage extensions)" \ |
| 7760 | -C "Processing of the Certificate handshake message failed" \ |
| 7761 | -c "Ciphersuite is TLS-" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7762 | -C "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7763 | -c "! Usage does not match the keyUsage extension" |
| 7764 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7765 | run_test "keyUsage cli 1.2: DigitalSignature, DHE-RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7766 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7767 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7768 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7769 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 7770 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7771 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7772 | -C "Processing of the Certificate handshake message failed" \ |
| 7773 | -c "Ciphersuite is TLS-" |
| 7774 | |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7775 | run_test "keyUsage cli 1.2: DigitalSignature, RSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7776 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7777 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7778 | "$P_CLI debug_level=3 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7779 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7780 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7781 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7782 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7783 | -C "Ciphersuite is TLS-" \ |
| 7784 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7785 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7786 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 7787 | |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7788 | run_test "keyUsage cli 1.2: DigitalSignature, RSA: fail (soft)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7789 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7790 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7791 | "$P_CLI debug_level=3 auth_mode=optional \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7792 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7793 | 0 \ |
| 7794 | -c "bad certificate (usage extensions)" \ |
| 7795 | -C "Processing of the Certificate handshake message failed" \ |
| 7796 | -c "Ciphersuite is TLS-" \ |
Manuel Pégourié-Gonnard | ee1715c | 2024-08-05 12:49:57 +0200 | [diff] [blame] | 7797 | -C "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 7798 | -c "! Usage does not match the keyUsage extension" |
| 7799 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7800 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7801 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7802 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7803 | run_test "keyUsage cli 1.3: DigitalSignature, RSA: OK" \ |
| 7804 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7805 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds.crt" \ |
| 7806 | "$P_CLI debug_level=3" \ |
| 7807 | 0 \ |
| 7808 | -C "bad certificate (usage extensions)" \ |
| 7809 | -C "Processing of the Certificate handshake message failed" \ |
| 7810 | -c "Ciphersuite is" |
| 7811 | |
| 7812 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 7813 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7814 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7815 | run_test "keyUsage cli 1.3: DigitalSignature+KeyEncipherment, RSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7816 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7817 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds_ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7818 | "$P_CLI debug_level=3" \ |
| 7819 | 0 \ |
| 7820 | -C "bad certificate (usage extensions)" \ |
| 7821 | -C "Processing of the Certificate handshake message failed" \ |
| 7822 | -c "Ciphersuite is" |
| 7823 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7824 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7825 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7826 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7827 | run_test "keyUsage cli 1.3: KeyEncipherment, RSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7828 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7829 | -cert $DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7830 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7831 | 1 \ |
| 7832 | -c "bad certificate (usage extensions)" \ |
| 7833 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7834 | -C "Ciphersuite is" \ |
| 7835 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7836 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7837 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7838 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7839 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7840 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7841 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7842 | run_test "keyUsage cli 1.3: KeyAgreement, RSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7843 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server2.key \ |
| 7844 | -cert $DATA_FILES_PATH/server2-sha256.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7845 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7846 | 1 \ |
| 7847 | -c "bad certificate (usage extensions)" \ |
| 7848 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7849 | -C "Ciphersuite is" \ |
| 7850 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7851 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7852 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7853 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7854 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7855 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7856 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7857 | run_test "keyUsage cli 1.3: DigitalSignature, ECDSA: OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7858 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 7859 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7860 | "$P_CLI debug_level=3" \ |
| 7861 | 0 \ |
| 7862 | -C "bad certificate (usage extensions)" \ |
| 7863 | -C "Processing of the Certificate handshake message failed" \ |
| 7864 | -c "Ciphersuite is" |
| 7865 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7866 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7867 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7868 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7869 | run_test "keyUsage cli 1.3: KeyEncipherment, ECDSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7870 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 7871 | -cert $DATA_FILES_PATH/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7872 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7873 | 1 \ |
| 7874 | -c "bad certificate (usage extensions)" \ |
| 7875 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7876 | -C "Ciphersuite is" \ |
| 7877 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7878 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7879 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7880 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7881 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7882 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7883 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7884 | run_test "keyUsage cli 1.3: KeyAgreement, ECDSA: fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7885 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 7886 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7887 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7888 | 1 \ |
| 7889 | -c "bad certificate (usage extensions)" \ |
| 7890 | -c "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 7891 | -C "Ciphersuite is" \ |
| 7892 | -c "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7893 | -c "! Usage does not match the keyUsage extension" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7894 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7895 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7896 | # Tests for keyUsage in leaf certificates, part 3: |
| 7897 | # server-side checking of client cert |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7898 | # |
| 7899 | # Here, both 1.2 and 1.3 only use signatures. |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7900 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7901 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7902 | run_test "keyUsage cli-auth 1.2: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7903 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7904 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7905 | -cert $DATA_FILES_PATH/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7906 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 7907 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7908 | -S "bad certificate (usage extensions)" \ |
| 7909 | -S "Processing of the Certificate handshake message failed" |
| 7910 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7911 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7912 | run_test "keyUsage cli-auth 1.2: RSA, DigitalSignature+KeyEncipherment: OK" \ |
| 7913 | "$P_SRV debug_level=1 auth_mode=optional" \ |
| 7914 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7915 | -cert $DATA_FILES_PATH/server2.ku-ds_ke.crt" \ |
| 7916 | 0 \ |
| 7917 | -s "Verifying peer X.509 certificate... ok" \ |
| 7918 | -S "bad certificate (usage extensions)" \ |
| 7919 | -S "Processing of the Certificate handshake message failed" |
| 7920 | |
| 7921 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7922 | run_test "keyUsage cli-auth 1.2: RSA, KeyEncipherment: fail (soft)" \ |
| 7923 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7924 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7925 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7926 | 0 \ |
| 7927 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7928 | -S "send alert level=2 message=43" \ |
| 7929 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7930 | -S "Processing of the Certificate handshake message failed" |
| 7931 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7932 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7933 | run_test "keyUsage cli-auth 1.2: RSA, KeyEncipherment: fail (hard)" \ |
| 7934 | "$P_SRV debug_level=3 force_version=tls12 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7935 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server2.key \ |
| 7936 | -cert $DATA_FILES_PATH/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7937 | 1 \ |
| 7938 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7939 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7940 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7941 | -s "Processing of the Certificate handshake message failed" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7942 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7943 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7944 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7945 | run_test "keyUsage cli-auth 1.2: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 7946 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7947 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 7948 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7949 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 7950 | -s "Verifying peer X.509 certificate... ok" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7951 | -S "bad certificate (usage extensions)" \ |
| 7952 | -S "Processing of the Certificate handshake message failed" |
| 7953 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 7954 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7955 | run_test "keyUsage cli-auth 1.2: ECDSA, KeyAgreement: fail (soft)" \ |
| 7956 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7957 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 7958 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7959 | 0 \ |
| 7960 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7961 | -S "send alert level=2 message=43" \ |
| 7962 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 7963 | -S "Processing of the Certificate handshake message failed" |
| 7964 | |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7965 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7966 | run_test "keyUsage cli-auth 1.2: ECDSA, KeyAgreement: fail (hard)" \ |
| 7967 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 7968 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 7969 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
| 7970 | 1 \ |
| 7971 | -s "bad certificate (usage extensions)" \ |
| 7972 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 7973 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7974 | -s "Processing of the Certificate handshake message failed" |
| 7975 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 7976 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7977 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7978 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7979 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7980 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7981 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7982 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
| 7983 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7984 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 7985 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 7986 | -S "bad certificate (usage extensions)" \ |
| 7987 | -S "Processing of the Certificate handshake message failed" |
| 7988 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 7989 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 7990 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 7991 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Manuel Pégourié-Gonnard | 52c0f5a | 2024-08-08 12:19:46 +0200 | [diff] [blame] | 7992 | run_test "keyUsage cli-auth 1.3: RSA, DigitalSignature+KeyEncipherment: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 7993 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 7994 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 7995 | -cert $DATA_FILES_PATH/server2-sha256.ku-ds_ke.crt" \ |
| 7996 | 0 \ |
| 7997 | -s "Verifying peer X.509 certificate... ok" \ |
| 7998 | -S "bad certificate (usage extensions)" \ |
| 7999 | -S "Processing of the Certificate handshake message failed" |
| 8000 | |
| 8001 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 8002 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8003 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 8004 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (soft)" \ |
| 8005 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
| 8006 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server2.key \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8007 | -cert $DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8008 | 0 \ |
| 8009 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8010 | -S "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8011 | -s "! Usage does not match the keyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8012 | -S "Processing of the Certificate handshake message failed" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8013 | |
| 8014 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 8015 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8016 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 8017 | run_test "keyUsage cli-auth 1.3: RSA, KeyEncipherment: fail (hard)" \ |
| 8018 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
Manuel Pégourié-Gonnard | cdd5b07 | 2024-08-12 09:50:18 +0200 | [diff] [blame] | 8019 | "$P_CLI key_file=$DATA_FILES_PATH/server2.key \ |
| 8020 | crt_file=$DATA_FILES_PATH/server2-sha256.ku-ke.crt" \ |
| 8021 | 1 \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8022 | -s "bad certificate (usage extensions)" \ |
| 8023 | -s "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8024 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8025 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8026 | -s "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8027 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8028 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8029 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8030 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8031 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8032 | run_test "keyUsage cli-auth 1.3: ECDSA, DigitalSignature: OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8033 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8034 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8035 | -cert $DATA_FILES_PATH/server5.ku-ds.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8036 | 0 \ |
Ronald Cron | f9c13fe | 2022-06-22 14:35:17 +0200 | [diff] [blame] | 8037 | -s "Verifying peer X.509 certificate... ok" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8038 | -S "bad certificate (usage extensions)" \ |
| 8039 | -S "Processing of the Certificate handshake message failed" |
| 8040 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8041 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8042 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8043 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8044 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8045 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8046 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8047 | -cert $DATA_FILES_PATH/server5.ku-ka.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8048 | 0 \ |
| 8049 | -s "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8050 | -s "! Usage does not match the keyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8051 | -S "Processing of the Certificate handshake message failed" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8052 | |
| 8053 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 8054 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8055 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 8056 | run_test "keyUsage cli-auth 1.3: ECDSA, KeyAgreement: fail (hard)" \ |
| 8057 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
Manuel Pégourié-Gonnard | cdd5b07 | 2024-08-12 09:50:18 +0200 | [diff] [blame] | 8058 | "$P_CLI key_file=$DATA_FILES_PATH/server5.key \ |
| 8059 | crt_file=$DATA_FILES_PATH/server5.ku-ka.crt" \ |
| 8060 | 1 \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8061 | -s "bad certificate (usage extensions)" \ |
| 8062 | -s "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | ef41d8c | 2024-08-08 10:28:56 +0200 | [diff] [blame] | 8063 | -s "send alert level=2 message=43" \ |
Manuel Pégourié-Gonnard | 013d079 | 2024-08-08 10:56:41 +0200 | [diff] [blame] | 8064 | -s "! Usage does not match the keyUsage extension" \ |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8065 | -s "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | 36d1b4a | 2024-08-06 12:14:04 +0200 | [diff] [blame] | 8066 | # MBEDTLS_X509_BADCERT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8067 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8068 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 8069 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 8070 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8071 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8072 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8073 | crt_file=$DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8074 | "$P_CLI" \ |
| 8075 | 0 |
| 8076 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 8077 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8078 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8079 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8080 | crt_file=$DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8081 | "$P_CLI" \ |
| 8082 | 0 |
| 8083 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 8084 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8085 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8086 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8087 | crt_file=$DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8088 | "$P_CLI" \ |
| 8089 | 0 |
| 8090 | |
Ronald Cron | 92dca39 | 2023-03-10 16:11:15 +0100 | [diff] [blame] | 8091 | requires_key_exchange_with_cert_in_tls12_or_tls13_enabled |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8092 | run_test "extKeyUsage srv: codeSign -> fail" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8093 | "$P_SRV key_file=$DATA_FILES_PATH/server5.key \ |
| 8094 | crt_file=$DATA_FILES_PATH/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 8095 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8096 | 1 |
| 8097 | |
| 8098 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 8099 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8100 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8101 | run_test "extKeyUsage cli 1.2: serverAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8102 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8103 | -cert $DATA_FILES_PATH/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8104 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8105 | 0 \ |
| 8106 | -C "bad certificate (usage extensions)" \ |
| 8107 | -C "Processing of the Certificate handshake message failed" \ |
| 8108 | -c "Ciphersuite is TLS-" |
| 8109 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8110 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8111 | run_test "extKeyUsage cli 1.2: serverAuth,clientAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8112 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8113 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8114 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8115 | 0 \ |
| 8116 | -C "bad certificate (usage extensions)" \ |
| 8117 | -C "Processing of the Certificate handshake message failed" \ |
| 8118 | -c "Ciphersuite is TLS-" |
| 8119 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8120 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8121 | run_test "extKeyUsage cli 1.2: codeSign,anyEKU -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8122 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8123 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8124 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8125 | 0 \ |
| 8126 | -C "bad certificate (usage extensions)" \ |
| 8127 | -C "Processing of the Certificate handshake message failed" \ |
| 8128 | -c "Ciphersuite is TLS-" |
| 8129 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8130 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | 04db1fb | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8131 | run_test "extKeyUsage cli 1.2: codeSign -> fail (soft)" \ |
| 8132 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8133 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
| 8134 | "$P_CLI debug_level=3 auth_mode=optional" \ |
| 8135 | 0 \ |
| 8136 | -c "bad certificate (usage extensions)" \ |
| 8137 | -C "Processing of the Certificate handshake message failed" \ |
| 8138 | -c "Ciphersuite is TLS-" \ |
| 8139 | -C "send alert level=2 message=43" \ |
| 8140 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8141 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8142 | |
| 8143 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8144 | run_test "extKeyUsage cli 1.2: codeSign -> fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8145 | "$O_SRV -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8146 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8147 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8148 | 1 \ |
| 8149 | -c "bad certificate (usage extensions)" \ |
| 8150 | -c "Processing of the Certificate handshake message failed" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8151 | -C "Ciphersuite is TLS-" \ |
| 8152 | -c "send alert level=2 message=43" \ |
| 8153 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8154 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8155 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8156 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8157 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8158 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8159 | run_test "extKeyUsage cli 1.3: serverAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8160 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8161 | -cert $DATA_FILES_PATH/server5.eku-srv.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8162 | "$P_CLI debug_level=1" \ |
| 8163 | 0 \ |
| 8164 | -C "bad certificate (usage extensions)" \ |
| 8165 | -C "Processing of the Certificate handshake message failed" \ |
| 8166 | -c "Ciphersuite is" |
| 8167 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8168 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8169 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8170 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8171 | run_test "extKeyUsage cli 1.3: serverAuth,clientAuth -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8172 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8173 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8174 | "$P_CLI debug_level=1" \ |
| 8175 | 0 \ |
| 8176 | -C "bad certificate (usage extensions)" \ |
| 8177 | -C "Processing of the Certificate handshake message failed" \ |
| 8178 | -c "Ciphersuite is" |
| 8179 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8180 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8181 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8182 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8183 | run_test "extKeyUsage cli 1.3: codeSign,anyEKU -> OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8184 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8185 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8186 | "$P_CLI debug_level=1" \ |
| 8187 | 0 \ |
| 8188 | -C "bad certificate (usage extensions)" \ |
| 8189 | -C "Processing of the Certificate handshake message failed" \ |
| 8190 | -c "Ciphersuite is" |
| 8191 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8192 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8193 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8194 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8195 | run_test "extKeyUsage cli 1.3: codeSign -> fail (hard)" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8196 | "$O_NEXT_SRV_NO_CERT -tls1_3 -num_tickets=0 -key $DATA_FILES_PATH/server5.key \ |
| 8197 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8198 | "$P_CLI debug_level=3" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8199 | 1 \ |
| 8200 | -c "bad certificate (usage extensions)" \ |
| 8201 | -c "Processing of the Certificate handshake message failed" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8202 | -C "Ciphersuite is" \ |
| 8203 | -c "send alert level=2 message=43" \ |
| 8204 | -c "! Usage does not match the extendedKeyUsage extension" |
| 8205 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8206 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8207 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 8208 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8209 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8210 | run_test "extKeyUsage cli-auth 1.2: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8211 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8212 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8213 | -cert $DATA_FILES_PATH/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8214 | 0 \ |
| 8215 | -S "bad certificate (usage extensions)" \ |
| 8216 | -S "Processing of the Certificate handshake message failed" |
| 8217 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8218 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8219 | run_test "extKeyUsage cli-auth 1.2: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8220 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8221 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8222 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8223 | 0 \ |
| 8224 | -S "bad certificate (usage extensions)" \ |
| 8225 | -S "Processing of the Certificate handshake message failed" |
| 8226 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8227 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8228 | run_test "extKeyUsage cli-auth 1.2: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 8229 | "$P_SRV debug_level=1 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8230 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8231 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8232 | 0 \ |
| 8233 | -S "bad certificate (usage extensions)" \ |
| 8234 | -S "Processing of the Certificate handshake message failed" |
| 8235 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8236 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8237 | run_test "extKeyUsage cli-auth 1.2: codeSign -> fail (soft)" \ |
| 8238 | "$P_SRV debug_level=3 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8239 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8240 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8241 | 0 \ |
| 8242 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8243 | -S "send alert level=2 message=43" \ |
| 8244 | -s "! Usage does not match the extendedKeyUsage extension" \ |
| 8245 | -S "Processing of the Certificate handshake message failed" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8246 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 8247 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8248 | run_test "extKeyUsage cli-auth 1.2: codeSign -> fail (hard)" \ |
| 8249 | "$P_SRV debug_level=3 auth_mode=required" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8250 | "$O_CLI -tls1_2 -key $DATA_FILES_PATH/server5.key \ |
| 8251 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8252 | 1 \ |
| 8253 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8254 | -s "send alert level=2 message=43" \ |
| 8255 | -s "! Usage does not match the extendedKeyUsage extension" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8256 | -s "Processing of the Certificate handshake message failed" |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8257 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 8258 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8259 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8260 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8261 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8262 | run_test "extKeyUsage cli-auth 1.3: clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8263 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8264 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8265 | -cert $DATA_FILES_PATH/server5.eku-cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8266 | 0 \ |
| 8267 | -S "bad certificate (usage extensions)" \ |
| 8268 | -S "Processing of the Certificate handshake message failed" |
| 8269 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8270 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8271 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8272 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8273 | run_test "extKeyUsage cli-auth 1.3: serverAuth,clientAuth -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8274 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8275 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8276 | -cert $DATA_FILES_PATH/server5.eku-srv_cli.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8277 | 0 \ |
| 8278 | -S "bad certificate (usage extensions)" \ |
| 8279 | -S "Processing of the Certificate handshake message failed" |
| 8280 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8281 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8282 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8283 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8284 | run_test "extKeyUsage cli-auth 1.3: codeSign,anyEKU -> OK" \ |
Ronald Cron | 89ca977 | 2022-10-17 14:56:45 +0200 | [diff] [blame] | 8285 | "$P_SRV debug_level=1 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8286 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8287 | -cert $DATA_FILES_PATH/server5.eku-cs_any.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8288 | 0 \ |
| 8289 | -S "bad certificate (usage extensions)" \ |
| 8290 | -S "Processing of the Certificate handshake message failed" |
| 8291 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 8292 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 8293 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8294 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8295 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (soft)" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8296 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=optional" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8297 | "$O_NEXT_CLI_NO_CERT -key $DATA_FILES_PATH/server5.key \ |
| 8298 | -cert $DATA_FILES_PATH/server5.eku-cs.crt" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8299 | 0 \ |
| 8300 | -s "bad certificate (usage extensions)" \ |
Elena Uziunaite | e74c840 | 2024-08-15 15:24:09 +0100 | [diff] [blame] | 8301 | -S "send alert level=2 message=43" \ |
| 8302 | -s "! Usage does not match the extendedKeyUsage extension" \ |
Ronald Cron | d28f5a9 | 2022-06-16 19:27:25 +0200 | [diff] [blame] | 8303 | -S "Processing of the Certificate handshake message failed" |
| 8304 | |
Elena Uziunaite | 04db1fb | 2024-08-16 17:18:28 +0100 | [diff] [blame] | 8305 | requires_openssl_tls1_3_with_compatible_ephemeral |
| 8306 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 8307 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 8308 | run_test "extKeyUsage cli-auth 1.3: codeSign -> fail (hard)" \ |
| 8309 | "$P_SRV debug_level=3 force_version=tls13 auth_mode=required" \ |
| 8310 | "$P_CLI key_file=$DATA_FILES_PATH/server5.key \ |
| 8311 | crt_file=$DATA_FILES_PATH/server5.eku-cs.crt" \ |
| 8312 | 1 \ |
| 8313 | -s "bad certificate (usage extensions)" \ |
| 8314 | -s "send alert level=2 message=43" \ |
| 8315 | -s "! Usage does not match the extendedKeyUsage extension" \ |
| 8316 | -s "Processing of the Certificate handshake message failed" |
| 8317 | # MBEDTLS_X509_BADCERT_EXT_KEY_USAGE -> MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT |
| 8318 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8319 | # Tests for DHM parameters loading |
| 8320 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8321 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8322 | "$P_SRV" \ |
| 8323 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8324 | debug_level=3" \ |
| 8325 | 0 \ |
| 8326 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 8327 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8328 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8329 | run_test "DHM parameters: other parameters" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8330 | "$P_SRV dhm_file=$DATA_FILES_PATH/dhparams.pem" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 8331 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8332 | debug_level=3" \ |
| 8333 | 0 \ |
| 8334 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 8335 | -c "value of 'DHM: G ' (2 bits)" |
| 8336 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8337 | # Tests for DHM client-side size checking |
| 8338 | |
| 8339 | run_test "DHM size: server default, client default, OK" \ |
| 8340 | "$P_SRV" \ |
| 8341 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8342 | debug_level=1" \ |
| 8343 | 0 \ |
| 8344 | -C "DHM prime too short:" |
| 8345 | |
| 8346 | run_test "DHM size: server default, client 2048, OK" \ |
| 8347 | "$P_SRV" \ |
| 8348 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8349 | debug_level=1 dhmlen=2048" \ |
| 8350 | 0 \ |
| 8351 | -C "DHM prime too short:" |
| 8352 | |
| 8353 | run_test "DHM size: server 1024, client default, OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8354 | "$P_SRV dhm_file=$DATA_FILES_PATH/dhparams.pem" \ |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8355 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8356 | debug_level=1" \ |
| 8357 | 0 \ |
| 8358 | -C "DHM prime too short:" |
| 8359 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8360 | run_test "DHM size: server 999, client 999, OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8361 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.999.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8362 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8363 | debug_level=1 dhmlen=999" \ |
| 8364 | 0 \ |
| 8365 | -C "DHM prime too short:" |
| 8366 | |
| 8367 | run_test "DHM size: server 1000, client 1000, OK" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8368 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8369 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8370 | debug_level=1 dhmlen=1000" \ |
| 8371 | 0 \ |
| 8372 | -C "DHM prime too short:" |
| 8373 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8374 | run_test "DHM size: server 1000, client default, rejected" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8375 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8376 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8377 | debug_level=1" \ |
| 8378 | 1 \ |
| 8379 | -c "DHM prime too short:" |
| 8380 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8381 | run_test "DHM size: server 1000, client 1001, rejected" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8382 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.1000.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8383 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8384 | debug_level=1 dhmlen=1001" \ |
| 8385 | 1 \ |
| 8386 | -c "DHM prime too short:" |
| 8387 | |
| 8388 | run_test "DHM size: server 999, client 1000, rejected" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8389 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.999.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8390 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8391 | debug_level=1 dhmlen=1000" \ |
| 8392 | 1 \ |
| 8393 | -c "DHM prime too short:" |
| 8394 | |
| 8395 | run_test "DHM size: server 998, client 999, rejected" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 8396 | "$P_SRV dhm_file=$DATA_FILES_PATH/dh.998.pem" \ |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 8397 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8398 | debug_level=1 dhmlen=999" \ |
| 8399 | 1 \ |
| 8400 | -c "DHM prime too short:" |
| 8401 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 8402 | run_test "DHM size: server default, client 2049, rejected" \ |
| 8403 | "$P_SRV" \ |
| 8404 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 8405 | debug_level=1 dhmlen=2049" \ |
| 8406 | 1 \ |
| 8407 | -c "DHM prime too short:" |
| 8408 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8409 | # Tests for PSK callback |
| 8410 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 8411 | run_test "PSK callback: psk, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8412 | "$P_SRV psk=73776f726466697368 psk_identity=foo" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8413 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8414 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 8415 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8416 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 8417 | -S "SSL - Unknown identity received" \ |
| 8418 | -S "SSL - Verification of the message MAC failed" |
| 8419 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8420 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8421 | run_test "PSK callback: opaque psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8422 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8423 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8424 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8425 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8426 | -C "session hash for extended master secret"\ |
| 8427 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8428 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8429 | -S "SSL - Unknown identity received" \ |
| 8430 | -S "SSL - Verification of the message MAC failed" |
| 8431 | |
| 8432 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8433 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8434 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8435 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8436 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8437 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8438 | -C "session hash for extended master secret"\ |
| 8439 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8440 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8441 | -S "SSL - Unknown identity received" \ |
| 8442 | -S "SSL - Verification of the message MAC failed" |
| 8443 | |
| 8444 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8445 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8446 | "$P_SRV extended_ms=1 debug_level=3 psk=73776f726466697368 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8447 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8448 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8449 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8450 | -c "session hash for extended master secret"\ |
| 8451 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8452 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8453 | -S "SSL - Unknown identity received" \ |
| 8454 | -S "SSL - Verification of the message MAC failed" |
| 8455 | |
| 8456 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8457 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8458 | "$P_SRV extended_ms=1 debug_level=3 psk=73776f726466697368 psk_identity=foo" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8459 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8460 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8461 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8462 | -c "session hash for extended master secret"\ |
| 8463 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8464 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 8465 | -S "SSL - Unknown identity received" \ |
| 8466 | -S "SSL - Verification of the message MAC failed" |
| 8467 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8468 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8469 | run_test "PSK callback: opaque rsa-psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8470 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8471 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8472 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8473 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8474 | -C "session hash for extended master secret"\ |
| 8475 | -S "session hash for extended master secret"\ |
| 8476 | -S "SSL - The handshake negotiation failed" \ |
| 8477 | -S "SSL - Unknown identity received" \ |
| 8478 | -S "SSL - Verification of the message MAC failed" |
| 8479 | |
| 8480 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8481 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8482 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8483 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8484 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8485 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8486 | -C "session hash for extended master secret"\ |
| 8487 | -S "session hash for extended master secret"\ |
| 8488 | -S "SSL - The handshake negotiation failed" \ |
| 8489 | -S "SSL - Unknown identity received" \ |
| 8490 | -S "SSL - Verification of the message MAC failed" |
| 8491 | |
| 8492 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8493 | run_test "PSK callback: opaque rsa-psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8494 | "$P_SRV extended_ms=1 debug_level=3 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8495 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8496 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8497 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8498 | -c "session hash for extended master secret"\ |
| 8499 | -s "session hash for extended master secret"\ |
| 8500 | -S "SSL - The handshake negotiation failed" \ |
| 8501 | -S "SSL - Unknown identity received" \ |
| 8502 | -S "SSL - Verification of the message MAC failed" |
| 8503 | |
| 8504 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8505 | run_test "PSK callback: opaque rsa-psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8506 | "$P_SRV extended_ms=1 debug_level=3 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8507 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8508 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8509 | 0 \ |
Przemek Stekiel | 8e0495e | 2022-04-05 23:00:04 +0200 | [diff] [blame] | 8510 | -c "session hash for extended master secret"\ |
| 8511 | -s "session hash for extended master secret"\ |
| 8512 | -S "SSL - The handshake negotiation failed" \ |
| 8513 | -S "SSL - Unknown identity received" \ |
| 8514 | -S "SSL - Verification of the message MAC failed" |
| 8515 | |
| 8516 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8517 | run_test "PSK callback: opaque ecdhe-psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8518 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8519 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8520 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8521 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8522 | -C "session hash for extended master secret"\ |
| 8523 | -S "session hash for extended master secret"\ |
| 8524 | -S "SSL - The handshake negotiation failed" \ |
| 8525 | -S "SSL - Unknown identity received" \ |
| 8526 | -S "SSL - Verification of the message MAC failed" |
| 8527 | |
| 8528 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8529 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8530 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8531 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8532 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8533 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8534 | -C "session hash for extended master secret"\ |
| 8535 | -S "session hash for extended master secret"\ |
| 8536 | -S "SSL - The handshake negotiation failed" \ |
| 8537 | -S "SSL - Unknown identity received" \ |
| 8538 | -S "SSL - Verification of the message MAC failed" |
| 8539 | |
| 8540 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8541 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8542 | "$P_SRV extended_ms=1 debug_level=3 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8543 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8544 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8545 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8546 | -c "session hash for extended master secret"\ |
| 8547 | -s "session hash for extended master secret"\ |
| 8548 | -S "SSL - The handshake negotiation failed" \ |
| 8549 | -S "SSL - Unknown identity received" \ |
| 8550 | -S "SSL - Verification of the message MAC failed" |
| 8551 | |
| 8552 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8553 | run_test "PSK callback: opaque ecdhe-psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8554 | "$P_SRV extended_ms=1 debug_level=3 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8555 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8556 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8557 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8558 | -c "session hash for extended master secret"\ |
| 8559 | -s "session hash for extended master secret"\ |
| 8560 | -S "SSL - The handshake negotiation failed" \ |
| 8561 | -S "SSL - Unknown identity received" \ |
| 8562 | -S "SSL - Verification of the message MAC failed" |
| 8563 | |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8564 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8565 | run_test "PSK callback: opaque dhe-psk on client, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8566 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8567 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8568 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8569 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8570 | -C "session hash for extended master secret"\ |
| 8571 | -S "session hash for extended master secret"\ |
| 8572 | -S "SSL - The handshake negotiation failed" \ |
| 8573 | -S "SSL - Unknown identity received" \ |
| 8574 | -S "SSL - Verification of the message MAC failed" |
| 8575 | |
| 8576 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8577 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8578 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8579 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8580 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8581 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8582 | -C "session hash for extended master secret"\ |
| 8583 | -S "session hash for extended master secret"\ |
| 8584 | -S "SSL - The handshake negotiation failed" \ |
| 8585 | -S "SSL - Unknown identity received" \ |
| 8586 | -S "SSL - Verification of the message MAC failed" |
| 8587 | |
| 8588 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8589 | run_test "PSK callback: opaque dhe-psk on client, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8590 | "$P_SRV extended_ms=1 debug_level=3 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8591 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8592 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8593 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8594 | -c "session hash for extended master secret"\ |
| 8595 | -s "session hash for extended master secret"\ |
| 8596 | -S "SSL - The handshake negotiation failed" \ |
| 8597 | -S "SSL - Unknown identity received" \ |
| 8598 | -S "SSL - Verification of the message MAC failed" |
| 8599 | |
| 8600 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8601 | run_test "PSK callback: opaque dhe-psk on client, no callback, SHA-384, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8602 | "$P_SRV extended_ms=1 debug_level=3 psk=73776f726466697368 psk_identity=foo" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8603 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8604 | psk_identity=foo psk=73776f726466697368 psk_opaque=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8605 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8606 | -c "session hash for extended master secret"\ |
| 8607 | -s "session hash for extended master secret"\ |
| 8608 | -S "SSL - The handshake negotiation failed" \ |
| 8609 | -S "SSL - Unknown identity received" \ |
| 8610 | -S "SSL - Verification of the message MAC failed" |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8611 | |
| 8612 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8613 | run_test "PSK callback: raw psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8614 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8615 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8616 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8617 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8618 | -C "session hash for extended master secret"\ |
| 8619 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8620 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8621 | -S "SSL - Unknown identity received" \ |
| 8622 | -S "SSL - Verification of the message MAC failed" |
| 8623 | |
| 8624 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8625 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8626 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8627 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8628 | psk_identity=foo psk=73776f726466697368" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8629 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8630 | -C "session hash for extended master secret"\ |
| 8631 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8632 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8633 | -S "SSL - Unknown identity received" \ |
| 8634 | -S "SSL - Verification of the message MAC failed" |
| 8635 | |
| 8636 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8637 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8638 | "$P_SRV debug_level=3 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8639 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8640 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8641 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8642 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8643 | -c "session hash for extended master secret"\ |
| 8644 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8645 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8646 | -S "SSL - Unknown identity received" \ |
| 8647 | -S "SSL - Verification of the message MAC failed" |
| 8648 | |
| 8649 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8650 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8651 | "$P_SRV debug_level=3 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8652 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8653 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8654 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8655 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8656 | -c "session hash for extended master secret"\ |
| 8657 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8658 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8659 | -S "SSL - Unknown identity received" \ |
| 8660 | -S "SSL - Verification of the message MAC failed" |
| 8661 | |
| 8662 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8663 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8664 | "$P_SRV extended_ms=0 debug_level=5 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8665 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8666 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8667 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8668 | -C "session hash for extended master secret"\ |
| 8669 | -S "session hash for extended master secret"\ |
| 8670 | -S "SSL - The handshake negotiation failed" \ |
| 8671 | -S "SSL - Unknown identity received" \ |
| 8672 | -S "SSL - Verification of the message MAC failed" |
| 8673 | |
| 8674 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8675 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8676 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8677 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8678 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8679 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8680 | -C "session hash for extended master secret"\ |
| 8681 | -S "session hash for extended master secret"\ |
| 8682 | -S "SSL - The handshake negotiation failed" \ |
| 8683 | -S "SSL - Unknown identity received" \ |
| 8684 | -S "SSL - Verification of the message MAC failed" |
| 8685 | |
| 8686 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8687 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8688 | "$P_SRV debug_level=3 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8689 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8690 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8691 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8692 | 0 \ |
| 8693 | -c "session hash for extended master secret"\ |
| 8694 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8695 | -S "SSL - The handshake negotiation failed" \ |
| 8696 | -S "SSL - Unknown identity received" \ |
| 8697 | -S "SSL - Verification of the message MAC failed" |
| 8698 | |
| 8699 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8700 | run_test "PSK callback: raw rsa-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8701 | "$P_SRV debug_level=3 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8702 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8703 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8704 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8705 | 0 \ |
| 8706 | -c "session hash for extended master secret"\ |
| 8707 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8708 | -S "SSL - The handshake negotiation failed" \ |
| 8709 | -S "SSL - Unknown identity received" \ |
| 8710 | -S "SSL - Verification of the message MAC failed" |
| 8711 | |
| 8712 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8713 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8714 | "$P_SRV extended_ms=0 debug_level=5 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8715 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8716 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8717 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8718 | -C "session hash for extended master secret"\ |
| 8719 | -S "session hash for extended master secret"\ |
| 8720 | -S "SSL - The handshake negotiation failed" \ |
| 8721 | -S "SSL - Unknown identity received" \ |
| 8722 | -S "SSL - Verification of the message MAC failed" |
| 8723 | |
| 8724 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8725 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8726 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8727 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8728 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8729 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8730 | -C "session hash for extended master secret"\ |
| 8731 | -S "session hash for extended master secret"\ |
| 8732 | -S "SSL - The handshake negotiation failed" \ |
| 8733 | -S "SSL - Unknown identity received" \ |
| 8734 | -S "SSL - Verification of the message MAC failed" |
| 8735 | |
| 8736 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8737 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8738 | "$P_SRV debug_level=3 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8739 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8740 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8741 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8742 | 0 \ |
| 8743 | -c "session hash for extended master secret"\ |
| 8744 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8745 | -S "SSL - The handshake negotiation failed" \ |
| 8746 | -S "SSL - Unknown identity received" \ |
| 8747 | -S "SSL - Verification of the message MAC failed" |
| 8748 | |
| 8749 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8750 | run_test "PSK callback: raw ecdhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8751 | "$P_SRV debug_level=3 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8752 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8753 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8754 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8755 | 0 \ |
| 8756 | -c "session hash for extended master secret"\ |
| 8757 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8758 | -S "SSL - The handshake negotiation failed" \ |
| 8759 | -S "SSL - Unknown identity received" \ |
| 8760 | -S "SSL - Verification of the message MAC failed" |
| 8761 | |
| 8762 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8763 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8764 | "$P_SRV extended_ms=0 debug_level=5 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8765 | "$P_CLI extended_ms=0 debug_level=5 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8766 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8767 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8768 | -C "session hash for extended master secret"\ |
| 8769 | -S "session hash for extended master secret"\ |
| 8770 | -S "SSL - The handshake negotiation failed" \ |
| 8771 | -S "SSL - Unknown identity received" \ |
| 8772 | -S "SSL - Verification of the message MAC failed" |
| 8773 | |
| 8774 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8775 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, SHA-384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8776 | "$P_SRV extended_ms=0 debug_level=1 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8777 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8778 | psk_identity=foo psk=73776f726466697368" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8779 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8780 | -C "session hash for extended master secret"\ |
| 8781 | -S "session hash for extended master secret"\ |
| 8782 | -S "SSL - The handshake negotiation failed" \ |
| 8783 | -S "SSL - Unknown identity received" \ |
| 8784 | -S "SSL - Verification of the message MAC failed" |
| 8785 | |
| 8786 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8787 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8788 | "$P_SRV debug_level=3 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8789 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8790 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8791 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8792 | 0 \ |
| 8793 | -c "session hash for extended master secret"\ |
| 8794 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8795 | -S "SSL - The handshake negotiation failed" \ |
| 8796 | -S "SSL - Unknown identity received" \ |
| 8797 | -S "SSL - Verification of the message MAC failed" |
| 8798 | |
| 8799 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8800 | run_test "PSK callback: raw dhe-psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8801 | "$P_SRV debug_level=3 psk=73776f726466697368 psk_identity=foo psk_opaque=1 min_version=tls12 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8802 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8803 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 8804 | psk_identity=foo psk=73776f726466697368 extended_ms=1" \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8805 | 0 \ |
| 8806 | -c "session hash for extended master secret"\ |
| 8807 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8808 | -S "SSL - The handshake negotiation failed" \ |
| 8809 | -S "SSL - Unknown identity received" \ |
| 8810 | -S "SSL - Verification of the message MAC failed" |
| 8811 | |
| 8812 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8813 | 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] | 8814 | "$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" \ |
| 8815 | "$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] | 8816 | psk_identity=def psk=beef" \ |
| 8817 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8818 | -C "session hash for extended master secret"\ |
| 8819 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8820 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8821 | -S "SSL - Unknown identity received" \ |
| 8822 | -S "SSL - Verification of the message MAC failed" |
| 8823 | |
| 8824 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8825 | 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] | 8826 | "$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" \ |
| 8827 | "$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] | 8828 | psk_identity=def psk=beef" \ |
| 8829 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8830 | -C "session hash for extended master secret"\ |
| 8831 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8832 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8833 | -S "SSL - Unknown identity received" \ |
| 8834 | -S "SSL - Verification of the message MAC failed" |
| 8835 | |
| 8836 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8837 | 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] | 8838 | "$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] | 8839 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8840 | "$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] | 8841 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8842 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8843 | -c "session hash for extended master secret"\ |
| 8844 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8845 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8846 | -S "SSL - Unknown identity received" \ |
| 8847 | -S "SSL - Verification of the message MAC failed" |
| 8848 | |
| 8849 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 8850 | 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] | 8851 | "$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] | 8852 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8853 | "$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] | 8854 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8855 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 8856 | -c "session hash for extended master secret"\ |
| 8857 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 8858 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 8859 | -S "SSL - Unknown identity received" \ |
| 8860 | -S "SSL - Verification of the message MAC failed" |
| 8861 | |
| 8862 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8863 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback" \ |
| 8864 | "$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" \ |
| 8865 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 8866 | psk_identity=def psk=beef" \ |
| 8867 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8868 | -C "session hash for extended master secret"\ |
| 8869 | -S "session hash for extended master secret"\ |
| 8870 | -S "SSL - The handshake negotiation failed" \ |
| 8871 | -S "SSL - Unknown identity received" \ |
| 8872 | -S "SSL - Verification of the message MAC failed" |
| 8873 | |
| 8874 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8875 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, SHA-384" \ |
| 8876 | "$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" \ |
| 8877 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8878 | psk_identity=def psk=beef" \ |
| 8879 | 0 \ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8880 | -C "session hash for extended master secret"\ |
| 8881 | -S "session hash for extended master secret"\ |
| 8882 | -S "SSL - The handshake negotiation failed" \ |
| 8883 | -S "SSL - Unknown identity received" \ |
| 8884 | -S "SSL - Verification of the message MAC failed" |
| 8885 | |
| 8886 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8887 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS" \ |
| 8888 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8889 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8890 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA \ |
| 8891 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8892 | 0 \ |
| 8893 | -c "session hash for extended master secret"\ |
| 8894 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8895 | -S "SSL - The handshake negotiation failed" \ |
| 8896 | -S "SSL - Unknown identity received" \ |
| 8897 | -S "SSL - Verification of the message MAC failed" |
| 8898 | |
| 8899 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8900 | run_test "PSK callback: raw rsa-psk on client, no static RSA-PSK on server, opaque RSA-PSK from callback, EMS, SHA384" \ |
| 8901 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8902 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8903 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8904 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8905 | 0 \ |
| 8906 | -c "session hash for extended master secret"\ |
| 8907 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b270b56 | 2022-04-06 13:12:48 +0200 | [diff] [blame] | 8908 | -S "SSL - The handshake negotiation failed" \ |
| 8909 | -S "SSL - Unknown identity received" \ |
| 8910 | -S "SSL - Verification of the message MAC failed" |
| 8911 | |
| 8912 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8913 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback" \ |
| 8914 | "$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" \ |
| 8915 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 8916 | psk_identity=def psk=beef" \ |
| 8917 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8918 | -C "session hash for extended master secret"\ |
| 8919 | -S "session hash for extended master secret"\ |
| 8920 | -S "SSL - The handshake negotiation failed" \ |
| 8921 | -S "SSL - Unknown identity received" \ |
| 8922 | -S "SSL - Verification of the message MAC failed" |
| 8923 | |
| 8924 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8925 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, SHA-384" \ |
| 8926 | "$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" \ |
| 8927 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8928 | psk_identity=def psk=beef" \ |
| 8929 | 0 \ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8930 | -C "session hash for extended master secret"\ |
| 8931 | -S "session hash for extended master secret"\ |
| 8932 | -S "SSL - The handshake negotiation failed" \ |
| 8933 | -S "SSL - Unknown identity received" \ |
| 8934 | -S "SSL - Verification of the message MAC failed" |
| 8935 | |
| 8936 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8937 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS" \ |
| 8938 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8939 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8940 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA \ |
| 8941 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8942 | 0 \ |
| 8943 | -c "session hash for extended master secret"\ |
| 8944 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8945 | -S "SSL - The handshake negotiation failed" \ |
| 8946 | -S "SSL - Unknown identity received" \ |
| 8947 | -S "SSL - Verification of the message MAC failed" |
| 8948 | |
| 8949 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8950 | run_test "PSK callback: raw ecdhe-psk on client, no static ECDHE-PSK on server, opaque ECDHE-PSK from callback, EMS, SHA384" \ |
| 8951 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8952 | force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 8953 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8954 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8955 | 0 \ |
| 8956 | -c "session hash for extended master secret"\ |
| 8957 | -s "session hash for extended master secret"\ |
Przemek Stekiel | b6a0503 | 2022-04-14 10:22:18 +0200 | [diff] [blame] | 8958 | -S "SSL - The handshake negotiation failed" \ |
| 8959 | -S "SSL - Unknown identity received" \ |
| 8960 | -S "SSL - Verification of the message MAC failed" |
| 8961 | |
| 8962 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8963 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback" \ |
| 8964 | "$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" \ |
| 8965 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 8966 | psk_identity=def psk=beef" \ |
| 8967 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8968 | -C "session hash for extended master secret"\ |
| 8969 | -S "session hash for extended master secret"\ |
| 8970 | -S "SSL - The handshake negotiation failed" \ |
| 8971 | -S "SSL - Unknown identity received" \ |
| 8972 | -S "SSL - Verification of the message MAC failed" |
| 8973 | |
| 8974 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8975 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, SHA-384" \ |
| 8976 | "$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" \ |
| 8977 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 8978 | psk_identity=def psk=beef" \ |
| 8979 | 0 \ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8980 | -C "session hash for extended master secret"\ |
| 8981 | -S "session hash for extended master secret"\ |
| 8982 | -S "SSL - The handshake negotiation failed" \ |
| 8983 | -S "SSL - Unknown identity received" \ |
| 8984 | -S "SSL - Verification of the message MAC failed" |
| 8985 | |
| 8986 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8987 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS" \ |
| 8988 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 8989 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 8990 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-128-CBC-SHA \ |
| 8991 | psk_identity=abc psk=dead extended_ms=1" \ |
| 8992 | 0 \ |
| 8993 | -c "session hash for extended master secret"\ |
| 8994 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 8995 | -S "SSL - The handshake negotiation failed" \ |
| 8996 | -S "SSL - Unknown identity received" \ |
| 8997 | -S "SSL - Verification of the message MAC failed" |
| 8998 | |
| 8999 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9000 | run_test "PSK callback: raw dhe-psk on client, no static DHE-PSK on server, opaque DHE-PSK from callback, EMS, SHA384" \ |
| 9001 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls12 \ |
| 9002 | force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 9003 | "$P_CLI debug_level=3 min_version=tls12 force_ciphersuite=TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 \ |
| 9004 | psk_identity=abc psk=dead extended_ms=1" \ |
| 9005 | 0 \ |
| 9006 | -c "session hash for extended master secret"\ |
| 9007 | -s "session hash for extended master secret"\ |
Przemek Stekiel | 85d46fe | 2022-04-19 12:47:48 +0200 | [diff] [blame] | 9008 | -S "SSL - The handshake negotiation failed" \ |
| 9009 | -S "SSL - Unknown identity received" \ |
| 9010 | -S "SSL - Verification of the message MAC failed" |
| 9011 | |
| 9012 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9013 | run_test "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9014 | "$P_SRV extended_ms=0 psk_identity=foo psk=73776f726466697368 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" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9015 | "$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] | 9016 | psk_identity=def psk=beef" \ |
| 9017 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9018 | -C "session hash for extended master secret"\ |
| 9019 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9020 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9021 | -S "SSL - Unknown identity received" \ |
| 9022 | -S "SSL - Verification of the message MAC failed" |
| 9023 | |
| 9024 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9025 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9026 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=73776f726466697368 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" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9027 | "$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] | 9028 | psk_identity=def psk=beef" \ |
| 9029 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9030 | -C "session hash for extended master secret"\ |
| 9031 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9032 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9033 | -S "SSL - Unknown identity received" \ |
| 9034 | -S "SSL - Verification of the message MAC failed" |
| 9035 | |
| 9036 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9037 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9038 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=73776f726466697368 debug_level=3 psk_list=abc,dead,def,beef min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9039 | "$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] | 9040 | psk_identity=def psk=beef" \ |
| 9041 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9042 | -C "session hash for extended master secret"\ |
| 9043 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9044 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9045 | -S "SSL - Unknown identity received" \ |
| 9046 | -S "SSL - Verification of the message MAC failed" |
| 9047 | |
| 9048 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9049 | run_test "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK from callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9050 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=73776f726466697368 debug_level=3 psk_list=abc,dead,def,beef min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9051 | "$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] | 9052 | psk_identity=def psk=beef" \ |
| 9053 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 9054 | -C "session hash for extended master secret"\ |
| 9055 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9056 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 9057 | -S "SSL - Unknown identity received" \ |
| 9058 | -S "SSL - Verification of the message MAC failed" |
| 9059 | |
| 9060 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9061 | run_test "PSK callback: raw psk on client, matching opaque PSK on server, wrong opaque PSK from callback" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9062 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=beef debug_level=3 psk_list=abc,dead,def,73776f726466697368 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9063 | "$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] | 9064 | psk_identity=def psk=beef" \ |
| 9065 | 1 \ |
| 9066 | -s "SSL - Verification of the message MAC failed" |
| 9067 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9068 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 9069 | "$P_SRV" \ |
| 9070 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9071 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 9072 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 9073 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9074 | -S "SSL - Unknown identity received" \ |
| 9075 | -S "SSL - Verification of the message MAC failed" |
| 9076 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9077 | run_test "PSK callback: callback overrides other settings" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9078 | "$P_SRV psk=73776f726466697368 psk_identity=foo psk_list=abc,dead,def,beef" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9079 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9080 | psk_identity=foo psk=73776f726466697368" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9081 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9082 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9083 | -s "SSL - Unknown identity received" \ |
| 9084 | -S "SSL - Verification of the message MAC failed" |
| 9085 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9086 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9087 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9088 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9089 | psk_identity=abc psk=dead" \ |
| 9090 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9091 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9092 | -S "SSL - Unknown identity received" \ |
| 9093 | -S "SSL - Verification of the message MAC failed" |
| 9094 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9095 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9096 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9097 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9098 | psk_identity=def psk=beef" \ |
| 9099 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9100 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9101 | -S "SSL - Unknown identity received" \ |
| 9102 | -S "SSL - Verification of the message MAC failed" |
| 9103 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9104 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9105 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9106 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9107 | psk_identity=ghi psk=beef" \ |
| 9108 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9109 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9110 | -s "SSL - Unknown identity received" \ |
| 9111 | -S "SSL - Verification of the message MAC failed" |
| 9112 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 9113 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9114 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 9115 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 9116 | psk_identity=abc psk=beef" \ |
| 9117 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9118 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 9119 | -S "SSL - Unknown identity received" \ |
| 9120 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 9121 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9122 | # Tests for EC J-PAKE |
| 9123 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9124 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9125 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9126 | run_test "ECJPAKE: client not configured" \ |
| 9127 | "$P_SRV debug_level=3" \ |
| 9128 | "$P_CLI debug_level=3" \ |
| 9129 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 9130 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9131 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9132 | -S "found ecjpake kkpp extension" \ |
| 9133 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9134 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9135 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9136 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9137 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9138 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9139 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9140 | run_test "ECJPAKE: server not configured" \ |
| 9141 | "$P_SRV debug_level=3" \ |
| 9142 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 9143 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9144 | 1 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 9145 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9146 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9147 | -s "found ecjpake kkpp extension" \ |
| 9148 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9149 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9150 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9151 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9152 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 9153 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9154 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9155 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 9156 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9157 | run_test "ECJPAKE: working, TLS" \ |
| 9158 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9159 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 9160 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 9161 | 0 \ |
Ronald Cron | 7320e64 | 2022-03-08 13:34:49 +0100 | [diff] [blame] | 9162 | -c "add ciphersuite: c0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9163 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9164 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9165 | -s "found ecjpake kkpp extension" \ |
| 9166 | -S "skip ecjpake kkpp extension" \ |
| 9167 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 9168 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 9169 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 9170 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9171 | -S "SSL - Verification of the message MAC failed" |
| 9172 | |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9173 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Valerio Setti | a6b69da | 2022-11-30 16:44:49 +0100 | [diff] [blame] | 9174 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9175 | run_test "ECJPAKE: opaque password client+server, working, TLS" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9176 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9177 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 9178 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9179 | 0 \ |
| 9180 | -c "add ciphersuite: c0ff" \ |
| 9181 | -c "adding ecjpake_kkpp extension" \ |
Valerio Setti | 661b9bc | 2022-11-29 17:19:25 +0100 | [diff] [blame] | 9182 | -c "using opaque password" \ |
| 9183 | -s "using opaque password" \ |
Valerio Setti | d572a82 | 2022-11-28 18:27:51 +0100 | [diff] [blame] | 9184 | -C "re-using cached ecjpake parameters" \ |
| 9185 | -s "found ecjpake kkpp extension" \ |
| 9186 | -S "skip ecjpake kkpp extension" \ |
| 9187 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9188 | -s "server hello, ecjpake kkpp extension" \ |
| 9189 | -c "found ecjpake_kkpp extension" \ |
| 9190 | -S "SSL - The handshake negotiation failed" \ |
| 9191 | -S "SSL - Verification of the message MAC failed" |
| 9192 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9193 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9194 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9195 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9196 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9197 | run_test "ECJPAKE: opaque password client only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9198 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9199 | "$P_CLI debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1\ |
| 9200 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9201 | 0 \ |
| 9202 | -c "add ciphersuite: c0ff" \ |
| 9203 | -c "adding ecjpake_kkpp extension" \ |
| 9204 | -c "using opaque password" \ |
| 9205 | -S "using opaque password" \ |
| 9206 | -C "re-using cached ecjpake parameters" \ |
| 9207 | -s "found ecjpake kkpp extension" \ |
| 9208 | -S "skip ecjpake kkpp extension" \ |
| 9209 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9210 | -s "server hello, ecjpake kkpp extension" \ |
| 9211 | -c "found ecjpake_kkpp extension" \ |
| 9212 | -S "SSL - The handshake negotiation failed" \ |
| 9213 | -S "SSL - Verification of the message MAC failed" |
| 9214 | |
Valerio Setti | f11e05a | 2022-12-07 15:41:05 +0100 | [diff] [blame] | 9215 | # Note: if the name of this test is changed, then please adjust the corresponding |
| 9216 | # filtering label in "test_tls1_2_ecjpake_compatibility" (in "all.sh") |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9217 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9218 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | 70e0290 | 2022-12-02 16:21:56 +0100 | [diff] [blame] | 9219 | run_test "ECJPAKE: opaque password server only, working, TLS" \ |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9220 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9221 | "$P_CLI debug_level=3 ecjpake_pw=bla\ |
| 9222 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9223 | 0 \ |
| 9224 | -c "add ciphersuite: c0ff" \ |
| 9225 | -c "adding ecjpake_kkpp extension" \ |
| 9226 | -C "using opaque password" \ |
| 9227 | -s "using opaque password" \ |
| 9228 | -C "re-using cached ecjpake parameters" \ |
| 9229 | -s "found ecjpake kkpp extension" \ |
| 9230 | -S "skip ecjpake kkpp extension" \ |
| 9231 | -S "ciphersuite mismatch: ecjpake not configured" \ |
| 9232 | -s "server hello, ecjpake kkpp extension" \ |
| 9233 | -c "found ecjpake_kkpp extension" \ |
| 9234 | -S "SSL - The handshake negotiation failed" \ |
| 9235 | -S "SSL - Verification of the message MAC failed" |
| 9236 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9237 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9238 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9239 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 9240 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 9241 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 9242 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9243 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9244 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9245 | -s "SSL - Verification of the message MAC failed" |
| 9246 | |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9247 | server_needs_more_time 1 |
| 9248 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 9249 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Valerio Setti | b287ddf | 2022-12-01 16:18:12 +0100 | [diff] [blame] | 9250 | run_test "ECJPAKE_OPAQUE_PW: opaque password mismatch, TLS" \ |
| 9251 | "$P_SRV debug_level=3 ecjpake_pw=bla ecjpake_pw_opaque=1" \ |
| 9252 | "$P_CLI debug_level=3 ecjpake_pw=bad ecjpake_pw_opaque=1 \ |
| 9253 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9254 | 1 \ |
| 9255 | -c "using opaque password" \ |
| 9256 | -s "using opaque password" \ |
| 9257 | -C "re-using cached ecjpake parameters" \ |
| 9258 | -s "SSL - Verification of the message MAC failed" |
| 9259 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9260 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9261 | run_test "ECJPAKE: working, DTLS" \ |
| 9262 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 9263 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 9264 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9265 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9266 | -c "re-using cached ecjpake parameters" \ |
| 9267 | -S "SSL - Verification of the message MAC failed" |
| 9268 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9269 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9270 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 9271 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 9272 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 9273 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9274 | 0 \ |
| 9275 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9276 | -S "SSL - Verification of the message MAC failed" |
| 9277 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9278 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9279 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9280 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 9281 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 9282 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 9283 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9284 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 9285 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 9286 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 9287 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 9288 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 9289 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 9290 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 9291 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 9292 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 9293 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 9294 | 0 |
| 9295 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 9296 | # Test for ClientHello without extensions |
| 9297 | |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9298 | # Without extensions, ECC is impossible (no curve negotiation). |
| 9299 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 9300 | requires_gnutls |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9301 | run_test "ClientHello without extensions: RSA" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 9302 | "$P_SRV force_version=tls12 debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9303 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 9304 | 0 \ |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9305 | -s "Ciphersuite is .*-RSA-WITH-.*" \ |
| 9306 | -S "Ciphersuite is .*-EC.*" \ |
| 9307 | -s "dumping 'client hello extensions' (0 bytes)" |
| 9308 | |
Gilles Peskine | f287691 | 2024-05-13 21:18:41 +0200 | [diff] [blame] | 9309 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_PSK_ENABLED |
Gilles Peskine | 80e54a2 | 2024-04-29 17:42:52 +0200 | [diff] [blame] | 9310 | requires_gnutls |
| 9311 | run_test "ClientHello without extensions: PSK" \ |
| 9312 | "$P_SRV force_version=tls12 debug_level=3 psk=73776f726466697368" \ |
| 9313 | "$G_CLI --priority=NORMAL:+PSK:-RSA:-DHE-RSA:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION --pskusername=Client_identity --pskkey=73776f726466697368 localhost" \ |
| 9314 | 0 \ |
| 9315 | -s "Ciphersuite is .*-PSK-.*" \ |
| 9316 | -S "Ciphersuite is .*-EC.*" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 9317 | -s "dumping 'client hello extensions' (0 bytes)" |
| 9318 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9319 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9320 | |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9321 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9322 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 9323 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9324 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9325 | "$P_CLI request_size=100" \ |
| 9326 | 0 \ |
| 9327 | -s "Read from client: 100 bytes read$" |
| 9328 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 9329 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9330 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 9331 | "$P_SRV buffer_size=100" \ |
| 9332 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 9333 | 0 \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9334 | -s "Read from client: 101 bytes read (100 + 1)" |
| 9335 | |
| 9336 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9337 | requires_max_content_len 200 |
| 9338 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 9339 | "$P_SRV buffer_size=100" \ |
| 9340 | "$P_CLI request_size=200" \ |
| 9341 | 0 \ |
| 9342 | -s "Read from client: 200 bytes read (100 + 100)" |
| 9343 | |
| 9344 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9345 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
Waleed Elmelegy | bae705c | 2024-01-01 14:21:21 +0000 | [diff] [blame] | 9346 | "$P_SRV buffer_size=100 force_version=tls12" \ |
Gilles Peskine | d2d90af | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 9347 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 9348 | 0 \ |
| 9349 | -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] | 9350 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9351 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9352 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9353 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9354 | "$P_SRV force_version=tls12" \ |
| 9355 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9356 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9357 | 0 \ |
| 9358 | -s "Read from client: 1 bytes read" |
| 9359 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9360 | run_test "Small client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9361 | "$P_SRV force_version=tls12" \ |
| 9362 | "$P_CLI request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 9363 | 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] | 9364 | 0 \ |
| 9365 | -s "Read from client: 1 bytes read" |
| 9366 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9367 | run_test "Small client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9368 | "$P_SRV force_version=tls12" \ |
| 9369 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9370 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9371 | 0 \ |
| 9372 | -s "Read from client: 1 bytes read" |
| 9373 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9374 | run_test "Small client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9375 | "$P_SRV force_version=tls12" \ |
| 9376 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9377 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 9378 | 0 \ |
| 9379 | -s "Read from client: 1 bytes read" |
| 9380 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9381 | run_test "Small client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9382 | "$P_SRV force_version=tls12" \ |
| 9383 | "$P_CLI request_size=1 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 9384 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 9385 | 0 \ |
| 9386 | -s "Read from client: 1 bytes read" |
| 9387 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9388 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9389 | run_test "Small client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9390 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9391 | "$P_CLI request_size=1 \ |
| 9392 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9393 | 0 \ |
| 9394 | -s "Read from client: 1 bytes read" |
| 9395 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9396 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9397 | run_test "Small client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9398 | "$P_SRV" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9399 | "$P_CLI request_size=1 \ |
| 9400 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9401 | 0 \ |
| 9402 | -s "Read from client: 1 bytes read" |
| 9403 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9404 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9405 | |
| 9406 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9407 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9408 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9409 | "$P_CLI dtls=1 request_size=1 \ |
| 9410 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9411 | 0 \ |
| 9412 | -s "Read from client: 1 bytes read" |
| 9413 | |
| 9414 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9415 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9416 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 9417 | "$P_CLI dtls=1 request_size=1 \ |
| 9418 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9419 | 0 \ |
| 9420 | -s "Read from client: 1 bytes read" |
| 9421 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9422 | # Tests for small server packets |
| 9423 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9424 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9425 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9426 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9427 | 0 \ |
| 9428 | -c "Read from server: 1 bytes read" |
| 9429 | |
| 9430 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9431 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9432 | "$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] | 9433 | 0 \ |
| 9434 | -c "Read from server: 1 bytes read" |
| 9435 | |
| 9436 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9437 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9438 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9439 | 0 \ |
| 9440 | -c "Read from server: 1 bytes read" |
| 9441 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9442 | run_test "Small server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9443 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9444 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9445 | 0 \ |
| 9446 | -c "Read from server: 1 bytes read" |
| 9447 | |
| 9448 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9449 | "$P_SRV response_size=1 force_version=tls12" \ |
| 9450 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9451 | 0 \ |
| 9452 | -c "Read from server: 1 bytes read" |
| 9453 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9454 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9455 | run_test "Small server packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9456 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9457 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9458 | 0 \ |
| 9459 | -c "Read from server: 1 bytes read" |
| 9460 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9461 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9462 | run_test "Small server packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9463 | "$P_SRV response_size=1" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9464 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9465 | 0 \ |
| 9466 | -c "Read from server: 1 bytes read" |
| 9467 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9468 | # Tests for small server packets in DTLS |
| 9469 | |
| 9470 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9471 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9472 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9473 | "$P_CLI dtls=1 \ |
| 9474 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9475 | 0 \ |
| 9476 | -c "Read from server: 1 bytes read" |
| 9477 | |
| 9478 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9479 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9480 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9481 | "$P_CLI dtls=1 \ |
| 9482 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9483 | 0 \ |
| 9484 | -c "Read from server: 1 bytes read" |
| 9485 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9486 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9487 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9488 | # How many fragments do we expect to write $1 bytes? |
| 9489 | fragments_for_write() { |
| 9490 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 9491 | } |
| 9492 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9493 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9494 | "$P_SRV force_version=tls12" \ |
| 9495 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9496 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9497 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9498 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9499 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9500 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9501 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9502 | "$P_SRV force_version=tls12" \ |
| 9503 | "$P_CLI request_size=16384 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9504 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 9505 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9506 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 9507 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9508 | run_test "Large client packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9509 | "$P_SRV force_version=tls12" \ |
| 9510 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 9511 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9512 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9513 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9514 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9515 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9516 | run_test "Large client packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9517 | "$P_SRV force_version=tls12" \ |
| 9518 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9519 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 9520 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9521 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9522 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9523 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9524 | run_test "Large client packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9525 | "$P_SRV force_version=tls12" \ |
| 9526 | "$P_CLI request_size=16384 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9527 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 9528 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 9529 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 9530 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 9531 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9532 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9533 | run_test "Large client packet TLS 1.3 AEAD" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9534 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9535 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9536 | force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9537 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9538 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9539 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9540 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9541 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9542 | run_test "Large client packet TLS 1.3 AEAD shorter tag" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 9543 | "$P_SRV" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9544 | "$P_CLI request_size=16383 \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9545 | force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9546 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9547 | -c "16383 bytes written in $(fragments_for_write 16383) fragments" \ |
| 9548 | -s "Read from client: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9549 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9550 | # 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] | 9551 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9552 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9553 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9554 | 0 \ |
| 9555 | -c "Read from server: 16384 bytes read" |
| 9556 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9557 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9558 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9559 | "$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] | 9560 | 0 \ |
| 9561 | -s "16384 bytes written in 1 fragments" \ |
| 9562 | -c "Read from server: 16384 bytes read" |
| 9563 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9564 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9565 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9566 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9567 | 0 \ |
| 9568 | -c "Read from server: 16384 bytes read" |
| 9569 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 9570 | 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] | 9571 | "$P_SRV response_size=16384 trunc_hmac=1 force_version=tls12" \ |
| 9572 | "$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] | 9573 | 0 \ |
| 9574 | -s "16384 bytes written in 1 fragments" \ |
| 9575 | -c "Read from server: 16384 bytes read" |
| 9576 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9577 | run_test "Large server packet TLS 1.2 AEAD" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9578 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9579 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9580 | 0 \ |
| 9581 | -c "Read from server: 16384 bytes read" |
| 9582 | |
| 9583 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
Ronald Cron | f3b425b | 2022-03-17 16:45:09 +0100 | [diff] [blame] | 9584 | "$P_SRV response_size=16384 force_version=tls12" \ |
| 9585 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 9586 | 0 \ |
| 9587 | -c "Read from server: 16384 bytes read" |
| 9588 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9589 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9590 | run_test "Large server packet TLS 1.3 AEAD" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9591 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9592 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-SHA256" \ |
| 9593 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9594 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9595 | |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 9596 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9597 | run_test "Large server packet TLS 1.3 AEAD shorter tag" \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9598 | "$P_SRV response_size=16383" \ |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9599 | "$P_CLI force_ciphersuite=TLS1-3-AES-128-CCM-8-SHA256" \ |
| 9600 | 0 \ |
Waleed Elmelegy | ea03183 | 2023-12-29 15:36:51 +0000 | [diff] [blame] | 9601 | -c "Read from server: 16383 bytes read" |
Ronald Cron | a4417c1 | 2022-06-23 16:06:28 +0200 | [diff] [blame] | 9602 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9603 | # Tests for restartable ECC |
| 9604 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9605 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 9606 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9607 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9608 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9609 | run_test "EC restart: TLS, default" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9610 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9611 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9612 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9613 | debug_level=1" \ |
| 9614 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9615 | -C "x509_verify_cert.*4b00" \ |
| 9616 | -C "mbedtls_pk_verify.*4b00" \ |
| 9617 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9618 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9619 | |
| 9620 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9621 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9622 | run_test "EC restart: TLS, max_ops=0" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9623 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9624 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9625 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9626 | debug_level=1 ec_max_ops=0" \ |
| 9627 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9628 | -C "x509_verify_cert.*4b00" \ |
| 9629 | -C "mbedtls_pk_verify.*4b00" \ |
| 9630 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9631 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9632 | |
| 9633 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9634 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9635 | run_test "EC restart: TLS, max_ops=65535" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9636 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9637 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9638 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9639 | debug_level=1 ec_max_ops=65535" \ |
| 9640 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9641 | -C "x509_verify_cert.*4b00" \ |
| 9642 | -C "mbedtls_pk_verify.*4b00" \ |
| 9643 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9644 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9645 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9646 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9647 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9648 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9649 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9650 | run_test "EC restart: TLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9651 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9652 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9653 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9654 | debug_level=1 ec_max_ops=1000" \ |
| 9655 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9656 | -c "x509_verify_cert.*4b00" \ |
| 9657 | -c "mbedtls_pk_verify.*4b00" \ |
| 9658 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9659 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9660 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9661 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9662 | # everything except ECDH (where TLS calls PSA directly). |
| 9663 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9664 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9665 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9666 | run_test "EC restart: TLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9667 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9668 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9669 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9670 | debug_level=1 ec_max_ops=1000" \ |
| 9671 | 0 \ |
| 9672 | -c "x509_verify_cert.*4b00" \ |
| 9673 | -c "mbedtls_pk_verify.*4b00" \ |
| 9674 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9675 | -c "mbedtls_pk_sign.*4b00" |
| 9676 | |
| 9677 | # This works the same with & without USE_PSA as we never get to ECDH: |
| 9678 | # 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] | 9679 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9680 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9681 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9682 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9683 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9684 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9685 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9686 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9687 | debug_level=1 ec_max_ops=1000" \ |
| 9688 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9689 | -c "x509_verify_cert.*4b00" \ |
| 9690 | -C "mbedtls_pk_verify.*4b00" \ |
| 9691 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9692 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9693 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9694 | -c "! mbedtls_ssl_handshake returned" \ |
| 9695 | -c "X509 - Certificate verification failed" |
| 9696 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9697 | # With USE_PSA disabled we expect full restartable behaviour. |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9698 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9699 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9700 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9701 | 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] | 9702 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9703 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9704 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9705 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9706 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9707 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9708 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9709 | -c "x509_verify_cert.*4b00" \ |
| 9710 | -c "mbedtls_pk_verify.*4b00" \ |
| 9711 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9712 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9713 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9714 | -C "! mbedtls_ssl_handshake returned" \ |
| 9715 | -C "X509 - Certificate verification failed" |
| 9716 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9717 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9718 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9719 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9720 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9721 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9722 | 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] | 9723 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9724 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9725 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9726 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9727 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9728 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 9729 | 0 \ |
| 9730 | -c "x509_verify_cert.*4b00" \ |
| 9731 | -c "mbedtls_pk_verify.*4b00" \ |
| 9732 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9733 | -c "mbedtls_pk_sign.*4b00" \ |
| 9734 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 9735 | -C "! mbedtls_ssl_handshake returned" \ |
| 9736 | -C "X509 - Certificate verification failed" |
| 9737 | |
| 9738 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9739 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9740 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9741 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9742 | 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] | 9743 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9744 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9745 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9746 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9747 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9748 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9749 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9750 | -C "x509_verify_cert.*4b00" \ |
| 9751 | -c "mbedtls_pk_verify.*4b00" \ |
| 9752 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9753 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9754 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9755 | -C "! mbedtls_ssl_handshake returned" \ |
| 9756 | -C "X509 - Certificate verification failed" |
| 9757 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9758 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9759 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 9760 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9761 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9762 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9763 | 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] | 9764 | "$P_SRV groups=secp256r1 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9765 | crt_file=$DATA_FILES_PATH/server5-badsign.crt \ |
| 9766 | key_file=$DATA_FILES_PATH/server5.key" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9767 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9768 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9769 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 9770 | 0 \ |
| 9771 | -C "x509_verify_cert.*4b00" \ |
| 9772 | -c "mbedtls_pk_verify.*4b00" \ |
| 9773 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9774 | -c "mbedtls_pk_sign.*4b00" \ |
| 9775 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 9776 | -C "! mbedtls_ssl_handshake returned" \ |
| 9777 | -C "X509 - Certificate verification failed" |
| 9778 | |
| 9779 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9780 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9781 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9782 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9783 | run_test "EC restart: DTLS, max_ops=1000 (no USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9784 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9785 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9786 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9787 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9788 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9789 | -c "x509_verify_cert.*4b00" \ |
| 9790 | -c "mbedtls_pk_verify.*4b00" \ |
| 9791 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9792 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 9793 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9794 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9795 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9796 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9797 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9798 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9799 | run_test "EC restart: DTLS, max_ops=1000 (USE_PSA)" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9800 | "$P_SRV groups=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9801 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9802 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9803 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 9804 | 0 \ |
| 9805 | -c "x509_verify_cert.*4b00" \ |
| 9806 | -c "mbedtls_pk_verify.*4b00" \ |
| 9807 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9808 | -c "mbedtls_pk_sign.*4b00" |
| 9809 | |
| 9810 | # With USE_PSA disabled we expect full restartable behaviour. |
| 9811 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9812 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9813 | requires_config_disabled MBEDTLS_USE_PSA_CRYPTO |
| 9814 | 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] | 9815 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9816 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9817 | debug_level=1 ec_max_ops=1000" \ |
| 9818 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9819 | -c "x509_verify_cert.*4b00" \ |
| 9820 | -c "mbedtls_pk_verify.*4b00" \ |
| 9821 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 9822 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9823 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9824 | |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9825 | # With USE_PSA enabled we expect only partial restartable behaviour: |
| 9826 | # everything except ECDH (where TLS calls PSA directly). |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9827 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 9828 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9829 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 9830 | 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] | 9831 | "$P_SRV groups=secp256r1" \ |
Manuel Pégourié-Gonnard | 55a188b | 2022-12-06 12:00:33 +0100 | [diff] [blame] | 9832 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 9833 | debug_level=1 ec_max_ops=1000" \ |
| 9834 | 0 \ |
| 9835 | -c "x509_verify_cert.*4b00" \ |
| 9836 | -c "mbedtls_pk_verify.*4b00" \ |
| 9837 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9838 | -C "mbedtls_pk_sign.*4b00" |
| 9839 | |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9840 | # Restartable is only for ECDHE-ECDSA, with another ciphersuite we expect no |
| 9841 | # restartable behaviour at all (not even client auth). |
| 9842 | # This is the same as "EC restart: TLS, max_ops=1000" except with ECDHE-RSA, |
| 9843 | # and all 4 assertions negated. |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9844 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 9845 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9846 | run_test "EC restart: TLS, max_ops=1000, ECDHE-RSA" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 9847 | "$P_SRV groups=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9848 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9849 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
Manuel Pégourié-Gonnard | 2b7ad64 | 2022-12-06 10:42:44 +0100 | [diff] [blame] | 9850 | debug_level=1 ec_max_ops=1000" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9851 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 9852 | -C "x509_verify_cert.*4b00" \ |
| 9853 | -C "mbedtls_pk_verify.*4b00" \ |
| 9854 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 9855 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 9856 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9857 | # Tests of asynchronous private key support in SSL |
| 9858 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9859 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9860 | run_test "SSL async private: sign, delay=0" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9861 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9862 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9863 | "$P_CLI" \ |
| 9864 | 0 \ |
| 9865 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9866 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9867 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9868 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9869 | run_test "SSL async private: sign, delay=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9870 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9871 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9872 | "$P_CLI" \ |
| 9873 | 0 \ |
| 9874 | -s "Async sign callback: using key slot " \ |
| 9875 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9876 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 9877 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 9878 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 9879 | run_test "SSL async private: sign, delay=2" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9880 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 9881 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 9882 | "$P_CLI" \ |
| 9883 | 0 \ |
| 9884 | -s "Async sign callback: using key slot " \ |
| 9885 | -U "Async sign callback: using key slot " \ |
| 9886 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 9887 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 9888 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 9889 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9890 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 9891 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 9892 | run_test "SSL async private: sign, SNI" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9893 | "$P_SRV force_version=tls12 debug_level=3 \ |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 9894 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9895 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
| 9896 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 9897 | "$P_CLI server_name=polarssl.example" \ |
| 9898 | 0 \ |
| 9899 | -s "Async sign callback: using key slot " \ |
| 9900 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 9901 | -s "parse ServerName extension" \ |
| 9902 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 9903 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 9904 | |
| 9905 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9906 | run_test "SSL async private: decrypt, delay=0" \ |
| 9907 | "$P_SRV \ |
| 9908 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 9909 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9910 | 0 \ |
| 9911 | -s "Async decrypt callback: using key slot " \ |
| 9912 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 9913 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9914 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9915 | run_test "SSL async private: decrypt, delay=1" \ |
| 9916 | "$P_SRV \ |
| 9917 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 9918 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9919 | 0 \ |
| 9920 | -s "Async decrypt callback: using key slot " \ |
| 9921 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 9922 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 9923 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9924 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9925 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9926 | "$P_SRV psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9927 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9928 | "$P_CLI psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9929 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 9930 | 0 \ |
| 9931 | -s "Async decrypt callback: using key slot " \ |
| 9932 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 9933 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9934 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9935 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9936 | "$P_SRV psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9937 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 9938 | "$P_CLI psk=73776f726466697368 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9939 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 9940 | 0 \ |
| 9941 | -s "Async decrypt callback: using key slot " \ |
| 9942 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 9943 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 9944 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9945 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9946 | run_test "SSL async private: sign callback not present" \ |
| 9947 | "$P_SRV \ |
| 9948 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 9949 | "$P_CLI force_version=tls12; [ \$? -eq 1 ] && |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9950 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9951 | 0 \ |
| 9952 | -S "Async sign callback" \ |
| 9953 | -s "! mbedtls_ssl_handshake returned" \ |
| 9954 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 9955 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 9956 | -s "Successful connection" |
| 9957 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9958 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9959 | run_test "SSL async private: decrypt callback not present" \ |
| 9960 | "$P_SRV debug_level=1 \ |
| 9961 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 9962 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
Ronald Cron | c564938 | 2023-04-04 15:33:42 +0200 | [diff] [blame] | 9963 | [ \$? -eq 1 ] && $P_CLI force_version=tls12" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9964 | 0 \ |
| 9965 | -S "Async decrypt callback" \ |
| 9966 | -s "! mbedtls_ssl_handshake returned" \ |
| 9967 | -s "got no RSA private key" \ |
| 9968 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 9969 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9970 | |
| 9971 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9972 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9973 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9974 | "$P_SRV \ |
| 9975 | async_operations=s async_private_delay1=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9976 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 9977 | key_file2=$DATA_FILES_PATH/server2.key crt_file2=$DATA_FILES_PATH/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9978 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 9979 | 0 \ |
| 9980 | -s "Async sign callback: using key slot 0," \ |
| 9981 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9982 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9983 | |
| 9984 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9985 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9986 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9987 | "$P_SRV \ |
| 9988 | async_operations=s async_private_delay2=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 9989 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 9990 | key_file2=$DATA_FILES_PATH/server2.key crt_file2=$DATA_FILES_PATH/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9991 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 9992 | 0 \ |
| 9993 | -s "Async sign callback: using key slot 0," \ |
| 9994 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 9995 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 9996 | |
| 9997 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 9998 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 9999 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10000 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 10001 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10002 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10003 | key_file2=$DATA_FILES_PATH/server2.key crt_file2=$DATA_FILES_PATH/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10004 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10005 | 0 \ |
| 10006 | -s "Async sign callback: using key slot 1," \ |
| 10007 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10008 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10009 | |
| 10010 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10011 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10012 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10013 | "$P_SRV \ |
| 10014 | async_operations=s async_private_delay1=1 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10015 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10016 | key_file2=$DATA_FILES_PATH/server2.key crt_file2=$DATA_FILES_PATH/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10017 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10018 | 0 \ |
| 10019 | -s "Async sign callback: no key matches this certificate." |
| 10020 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10021 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10022 | run_test "SSL async private: sign, error in start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10023 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10024 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10025 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10026 | "$P_CLI" \ |
| 10027 | 1 \ |
| 10028 | -s "Async sign callback: injected error" \ |
| 10029 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 10030 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10031 | -s "! mbedtls_ssl_handshake returned" |
| 10032 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10033 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10034 | run_test "SSL async private: sign, cancel after start" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10035 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10036 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10037 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10038 | "$P_CLI" \ |
| 10039 | 1 \ |
| 10040 | -s "Async sign callback: using key slot " \ |
| 10041 | -S "Async resume" \ |
| 10042 | -s "Async cancel" |
| 10043 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10044 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10045 | run_test "SSL async private: sign, error in resume" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10046 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10047 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10048 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10049 | "$P_CLI" \ |
| 10050 | 1 \ |
| 10051 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10052 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 10053 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10054 | -s "! mbedtls_ssl_handshake returned" |
| 10055 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10056 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10057 | run_test "SSL async private: decrypt, error in start" \ |
| 10058 | "$P_SRV \ |
| 10059 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10060 | async_private_error=1" \ |
| 10061 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10062 | 1 \ |
| 10063 | -s "Async decrypt callback: injected error" \ |
| 10064 | -S "Async resume" \ |
| 10065 | -S "Async cancel" \ |
| 10066 | -s "! mbedtls_ssl_handshake returned" |
| 10067 | |
| 10068 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 10069 | run_test "SSL async private: decrypt, cancel after start" \ |
| 10070 | "$P_SRV \ |
| 10071 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10072 | async_private_error=2" \ |
| 10073 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10074 | 1 \ |
| 10075 | -s "Async decrypt callback: using key slot " \ |
| 10076 | -S "Async resume" \ |
| 10077 | -s "Async cancel" |
| 10078 | |
| 10079 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 10080 | run_test "SSL async private: decrypt, error in resume" \ |
| 10081 | "$P_SRV \ |
| 10082 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10083 | async_private_error=3" \ |
| 10084 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10085 | 1 \ |
| 10086 | -s "Async decrypt callback: using key slot " \ |
| 10087 | -s "Async resume callback: decrypt done but injected error" \ |
| 10088 | -S "Async cancel" \ |
| 10089 | -s "! mbedtls_ssl_handshake returned" |
| 10090 | |
| 10091 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10092 | run_test "SSL async private: cancel after start then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10093 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10094 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10095 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10096 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 10097 | 0 \ |
| 10098 | -s "Async cancel" \ |
| 10099 | -s "! mbedtls_ssl_handshake returned" \ |
| 10100 | -s "Async resume" \ |
| 10101 | -s "Successful connection" |
| 10102 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10103 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10104 | run_test "SSL async private: error in resume then operate correctly" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10105 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10106 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 10107 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10108 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 10109 | 0 \ |
| 10110 | -s "! mbedtls_ssl_handshake returned" \ |
| 10111 | -s "Async resume" \ |
| 10112 | -s "Successful connection" |
| 10113 | |
| 10114 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10115 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 10116 | # Note: the function "detect_required_features()" is not able to detect more than |
| 10117 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 10118 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 10119 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10120 | 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] | 10121 | "$P_SRV \ |
| 10122 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10123 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10124 | key_file2=$DATA_FILES_PATH/server2.key crt_file2=$DATA_FILES_PATH/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10125 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 10126 | [ \$? -eq 1 ] && |
| 10127 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10128 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 10129 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10130 | -S "Async resume" \ |
| 10131 | -s "Async cancel" \ |
| 10132 | -s "! mbedtls_ssl_handshake returned" \ |
| 10133 | -s "Async sign callback: no key matches this certificate." \ |
| 10134 | -s "Successful connection" |
| 10135 | |
| 10136 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10137 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Valerio Setti | 3f2309f | 2023-02-23 13:47:30 +0100 | [diff] [blame] | 10138 | # Note: the function "detect_required_features()" is not able to detect more than |
| 10139 | # one "force_ciphersuite" per client/server and it only picks the 2nd one. |
| 10140 | # Therefore the 1st one is added explicitly here |
Valerio Setti | d1f991c | 2023-02-22 12:54:13 +0100 | [diff] [blame] | 10141 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 10142 | 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] | 10143 | "$P_SRV \ |
| 10144 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10145 | key_file=$DATA_FILES_PATH/server5.key crt_file=$DATA_FILES_PATH/server5.crt \ |
| 10146 | key_file2=$DATA_FILES_PATH/server2.key crt_file2=$DATA_FILES_PATH/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 10147 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 10148 | [ \$? -eq 1 ] && |
| 10149 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 10150 | 0 \ |
| 10151 | -s "Async resume" \ |
| 10152 | -s "! mbedtls_ssl_handshake returned" \ |
| 10153 | -s "Async sign callback: no key matches this certificate." \ |
| 10154 | -s "Successful connection" |
| 10155 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10156 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10157 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10158 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10159 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10160 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10161 | exchanges=2 renegotiation=1" \ |
| 10162 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10163 | 0 \ |
| 10164 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10165 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10166 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10167 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10168 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10169 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Ronald Cron | fd4c6af | 2023-03-11 10:46:01 +0100 | [diff] [blame] | 10170 | "$P_SRV force_version=tls12 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10171 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10172 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10173 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 10174 | 0 \ |
| 10175 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10176 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 10177 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10178 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10179 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10180 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10181 | "$P_SRV \ |
| 10182 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10183 | exchanges=2 renegotiation=1" \ |
| 10184 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 10185 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10186 | 0 \ |
| 10187 | -s "Async decrypt callback: using key slot " \ |
| 10188 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 10189 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 10190 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10191 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 10192 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 10193 | "$P_SRV \ |
| 10194 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 10195 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 10196 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 10197 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10198 | 0 \ |
| 10199 | -s "Async decrypt callback: using key slot " \ |
| 10200 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 10201 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10202 | # Tests for ECC extensions (rfc 4492) |
| 10203 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10204 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10205 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10206 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 10207 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10208 | "$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] | 10209 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 10210 | -C "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10211 | -C "client hello, adding supported_point_formats extension" \ |
| 10212 | -S "found supported elliptic curves extension" \ |
| 10213 | -S "found supported point formats extension" |
| 10214 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10215 | requires_hash_alg SHA_256 |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10216 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10217 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 10218 | "$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] | 10219 | "$P_CLI debug_level=3" \ |
| 10220 | 0 \ |
| 10221 | -C "found supported_point_formats extension" \ |
| 10222 | -S "server hello, supported_point_formats extension" |
| 10223 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10224 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10225 | run_test "Force an ECC ciphersuite in the client side" \ |
| 10226 | "$P_SRV debug_level=3" \ |
| 10227 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10228 | 0 \ |
Jerry Yu | 136320b | 2021-12-21 17:09:00 +0800 | [diff] [blame] | 10229 | -c "client hello, adding supported_groups extension" \ |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10230 | -c "client hello, adding supported_point_formats extension" \ |
| 10231 | -s "found supported elliptic curves extension" \ |
| 10232 | -s "found supported point formats extension" |
| 10233 | |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10234 | requires_hash_alg SHA_256 |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 10235 | run_test "Force an ECC ciphersuite in the server side" \ |
| 10236 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 10237 | "$P_CLI debug_level=3" \ |
| 10238 | 0 \ |
| 10239 | -c "found supported_point_formats extension" \ |
| 10240 | -s "server hello, supported_point_formats extension" |
| 10241 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10242 | # Tests for DTLS HelloVerifyRequest |
| 10243 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10244 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10245 | run_test "DTLS cookie: enabled" \ |
| 10246 | "$P_SRV dtls=1 debug_level=2" \ |
| 10247 | "$P_CLI dtls=1 debug_level=2" \ |
| 10248 | 0 \ |
| 10249 | -s "cookie verification failed" \ |
| 10250 | -s "cookie verification passed" \ |
| 10251 | -S "cookie verification skipped" \ |
| 10252 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10253 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10254 | -S "SSL - The requested feature is not available" |
| 10255 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10256 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10257 | run_test "DTLS cookie: disabled" \ |
| 10258 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 10259 | "$P_CLI dtls=1 debug_level=2" \ |
| 10260 | 0 \ |
| 10261 | -S "cookie verification failed" \ |
| 10262 | -S "cookie verification passed" \ |
| 10263 | -s "cookie verification skipped" \ |
| 10264 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10265 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10266 | -S "SSL - The requested feature is not available" |
| 10267 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10268 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10269 | run_test "DTLS cookie: default (failing)" \ |
| 10270 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 10271 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 10272 | 1 \ |
| 10273 | -s "cookie verification failed" \ |
| 10274 | -S "cookie verification passed" \ |
| 10275 | -S "cookie verification skipped" \ |
| 10276 | -C "received hello verify request" \ |
| 10277 | -S "hello verification requested" \ |
| 10278 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10279 | |
| 10280 | requires_ipv6 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10281 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10282 | run_test "DTLS cookie: enabled, IPv6" \ |
| 10283 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 10284 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 10285 | 0 \ |
| 10286 | -s "cookie verification failed" \ |
| 10287 | -s "cookie verification passed" \ |
| 10288 | -S "cookie verification skipped" \ |
| 10289 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10290 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 10291 | -S "SSL - The requested feature is not available" |
| 10292 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10293 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 10294 | run_test "DTLS cookie: enabled, nbio" \ |
| 10295 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 10296 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10297 | 0 \ |
| 10298 | -s "cookie verification failed" \ |
| 10299 | -s "cookie verification passed" \ |
| 10300 | -S "cookie verification skipped" \ |
| 10301 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 10302 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 10303 | -S "SSL - The requested feature is not available" |
| 10304 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10305 | # Tests for client reconnecting from the same port with DTLS |
| 10306 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10307 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10308 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10309 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10310 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 10311 | "$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] | 10312 | 0 \ |
| 10313 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10314 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10315 | -S "Client initiated reconnection from same port" |
| 10316 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10317 | not_with_valgrind # spurious resend |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10318 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10319 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 10320 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 10321 | "$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] | 10322 | 0 \ |
| 10323 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10324 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10325 | -s "Client initiated reconnection from same port" |
| 10326 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10327 | 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] | 10328 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10329 | 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] | 10330 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 10331 | "$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] | 10332 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10333 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 10334 | -s "Client initiated reconnection from same port" |
| 10335 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10336 | 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] | 10337 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 10338 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 10339 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 10340 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 10341 | 0 \ |
| 10342 | -S "The operation timed out" \ |
| 10343 | -s "Client initiated reconnection from same port" |
| 10344 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10345 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10346 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 10347 | "$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] | 10348 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 10349 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 10350 | -s "The operation timed out" \ |
| 10351 | -S "Client initiated reconnection from same port" |
| 10352 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10353 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 10354 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 10355 | -p "$P_PXY inject_clihlo=1" \ |
| 10356 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 10357 | "$P_CLI dtls=1 exchanges=2" \ |
| 10358 | 0 \ |
| 10359 | -s "possible client reconnect from the same port" \ |
| 10360 | -S "Client initiated reconnection from same port" |
| 10361 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10362 | # Tests for various cases of client authentication with DTLS |
| 10363 | # (focused on handshake flows and message parsing) |
| 10364 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10365 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10366 | run_test "DTLS client auth: required" \ |
| 10367 | "$P_SRV dtls=1 auth_mode=required" \ |
| 10368 | "$P_CLI dtls=1" \ |
| 10369 | 0 \ |
| 10370 | -s "Verifying peer X.509 certificate... ok" |
| 10371 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10372 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10373 | run_test "DTLS client auth: optional, client has no cert" \ |
| 10374 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 10375 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 10376 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10377 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10378 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10379 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10380 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10381 | "$P_SRV dtls=1 auth_mode=none" \ |
| 10382 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 10383 | 0 \ |
| 10384 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 10385 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 10386 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 10387 | run_test "DTLS wrong PSK: badmac alert" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 10388 | "$P_SRV dtls=1 psk=73776f726466697368 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
Gilles Peskine | abb1c22 | 2024-05-13 21:06:26 +0200 | [diff] [blame] | 10389 | "$P_CLI dtls=1 psk=73776f726466697374" \ |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 10390 | 1 \ |
| 10391 | -s "SSL - Verification of the message MAC failed" \ |
| 10392 | -c "SSL - A fatal alert message was received from our peer" |
| 10393 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10394 | # Tests for receiving fragmented handshake messages with DTLS |
| 10395 | |
| 10396 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10397 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10398 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 10399 | "$G_SRV -u --mtu 2048 -a" \ |
| 10400 | "$P_CLI dtls=1 debug_level=2" \ |
| 10401 | 0 \ |
| 10402 | -C "found fragmented DTLS handshake message" \ |
| 10403 | -C "error" |
| 10404 | |
| 10405 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10406 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10407 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 10408 | "$G_SRV -u --mtu 512" \ |
| 10409 | "$P_CLI dtls=1 debug_level=2" \ |
| 10410 | 0 \ |
| 10411 | -c "found fragmented DTLS handshake message" \ |
| 10412 | -C "error" |
| 10413 | |
| 10414 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10415 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10416 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 10417 | "$G_SRV -u --mtu 128" \ |
| 10418 | "$P_CLI dtls=1 debug_level=2" \ |
| 10419 | 0 \ |
| 10420 | -c "found fragmented DTLS handshake message" \ |
| 10421 | -C "error" |
| 10422 | |
| 10423 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10424 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 10425 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 10426 | "$G_SRV -u --mtu 128" \ |
| 10427 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10428 | 0 \ |
| 10429 | -c "found fragmented DTLS handshake message" \ |
| 10430 | -C "error" |
| 10431 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10432 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10433 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10434 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10435 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 10436 | "$G_SRV -u --mtu 256" \ |
| 10437 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 10438 | 0 \ |
| 10439 | -c "found fragmented DTLS handshake message" \ |
| 10440 | -c "client hello, adding renegotiation extension" \ |
| 10441 | -c "found renegotiation extension" \ |
| 10442 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10443 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10444 | -C "error" \ |
| 10445 | -s "Extra-header:" |
| 10446 | |
| 10447 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10448 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10449 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10450 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 10451 | "$G_SRV -u --mtu 256" \ |
| 10452 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 10453 | 0 \ |
| 10454 | -c "found fragmented DTLS handshake message" \ |
| 10455 | -c "client hello, adding renegotiation extension" \ |
| 10456 | -c "found renegotiation extension" \ |
| 10457 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 10458 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 10459 | -C "error" \ |
| 10460 | -s "Extra-header:" |
| 10461 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10462 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10463 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 10464 | "$O_SRV -dtls -mtu 2048" \ |
| 10465 | "$P_CLI dtls=1 debug_level=2" \ |
| 10466 | 0 \ |
| 10467 | -C "found fragmented DTLS handshake message" \ |
| 10468 | -C "error" |
| 10469 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10470 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10471 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
Valerio Setti | 6ba247c | 2023-03-14 17:13:43 +0100 | [diff] [blame] | 10472 | "$O_SRV -dtls -mtu 256" \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10473 | "$P_CLI dtls=1 debug_level=2" \ |
| 10474 | 0 \ |
| 10475 | -c "found fragmented DTLS handshake message" \ |
| 10476 | -C "error" |
| 10477 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10478 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10479 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 10480 | "$O_SRV -dtls -mtu 256" \ |
| 10481 | "$P_CLI dtls=1 debug_level=2" \ |
| 10482 | 0 \ |
| 10483 | -c "found fragmented DTLS handshake message" \ |
| 10484 | -C "error" |
| 10485 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10486 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 10487 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 10488 | "$O_SRV -dtls -mtu 256" \ |
| 10489 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 10490 | 0 \ |
| 10491 | -c "found fragmented DTLS handshake message" \ |
| 10492 | -C "error" |
| 10493 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10494 | # Tests for sending fragmented handshake messages with DTLS |
| 10495 | # |
| 10496 | # Use client auth when we need the client to send large messages, |
| 10497 | # and use large cert chains on both sides too (the long chains we have all use |
| 10498 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 10499 | # Sizes reached (UDP payload): |
| 10500 | # - 2037B for server certificate |
| 10501 | # - 1542B for client certificate |
| 10502 | # - 1013B for newsessionticket |
| 10503 | # - all others below 512B |
| 10504 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 10505 | |
| 10506 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10507 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10508 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10509 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10511 | run_test "DTLS fragmenting: none (for reference)" \ |
| 10512 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10513 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10514 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10515 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10516 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10517 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10518 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10519 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10520 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10521 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10522 | 0 \ |
| 10523 | -S "found fragmented DTLS handshake message" \ |
| 10524 | -C "found fragmented DTLS handshake message" \ |
| 10525 | -C "error" |
| 10526 | |
| 10527 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10528 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10529 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10530 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10531 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10532 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10533 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10534 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10535 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10536 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10537 | max_frag_len=1024" \ |
| 10538 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10539 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10540 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10541 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10542 | max_frag_len=2048" \ |
| 10543 | 0 \ |
| 10544 | -S "found fragmented DTLS handshake message" \ |
| 10545 | -c "found fragmented DTLS handshake message" \ |
| 10546 | -C "error" |
| 10547 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10548 | # With the MFL extension, the server has no way of forcing |
| 10549 | # the client to not exceed a certain MTU; hence, the following |
| 10550 | # test can't be replicated with an MTU proxy such as the one |
| 10551 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10552 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10553 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10554 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10555 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10556 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10557 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10558 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10559 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10560 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10561 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10562 | max_frag_len=512" \ |
| 10563 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10564 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10565 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10566 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 10567 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10568 | 0 \ |
| 10569 | -S "found fragmented DTLS handshake message" \ |
| 10570 | -c "found fragmented DTLS handshake message" \ |
| 10571 | -C "error" |
| 10572 | |
| 10573 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10574 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10575 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10576 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10577 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10578 | 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] | 10579 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10580 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10581 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10582 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10583 | max_frag_len=2048" \ |
| 10584 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10585 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10586 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10587 | hs_timeout=2500-60000 \ |
| 10588 | max_frag_len=1024" \ |
| 10589 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10590 | -S "found fragmented DTLS handshake message" \ |
| 10591 | -c "found fragmented DTLS handshake message" \ |
| 10592 | -C "error" |
| 10593 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10594 | # While not required by the standard defining the MFL extension |
| 10595 | # (according to which it only applies to records, not to datagrams), |
| 10596 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10597 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10598 | # to the peer. |
| 10599 | # The next test checks that no datagrams significantly larger than the |
| 10600 | # negotiated MFL are sent. |
| 10601 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10602 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10603 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10604 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10605 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10606 | 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] | 10607 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10608 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10609 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10610 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10611 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10612 | max_frag_len=2048" \ |
| 10613 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10614 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10615 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10616 | hs_timeout=2500-60000 \ |
| 10617 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10618 | 0 \ |
| 10619 | -S "found fragmented DTLS handshake message" \ |
| 10620 | -c "found fragmented DTLS handshake message" \ |
| 10621 | -C "error" |
| 10622 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10623 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10624 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10625 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10626 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10627 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10628 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10629 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10630 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10631 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10632 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10633 | max_frag_len=2048" \ |
| 10634 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10635 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10636 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10637 | hs_timeout=2500-60000 \ |
| 10638 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 10639 | 0 \ |
| 10640 | -s "found fragmented DTLS handshake message" \ |
| 10641 | -c "found fragmented DTLS handshake message" \ |
| 10642 | -C "error" |
| 10643 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10644 | # While not required by the standard defining the MFL extension |
| 10645 | # (according to which it only applies to records, not to datagrams), |
| 10646 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 10647 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 10648 | # to the peer. |
| 10649 | # The next test checks that no datagrams significantly larger than the |
| 10650 | # negotiated MFL are sent. |
| 10651 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10652 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10653 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10654 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10655 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10656 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 10657 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10658 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10659 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10660 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10661 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10662 | max_frag_len=2048" \ |
| 10663 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10664 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10665 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10666 | hs_timeout=2500-60000 \ |
| 10667 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 10668 | 0 \ |
| 10669 | -s "found fragmented DTLS handshake message" \ |
| 10670 | -c "found fragmented DTLS handshake message" \ |
| 10671 | -C "error" |
| 10672 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10673 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10674 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10675 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10677 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 10678 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10679 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10680 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10681 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10682 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10683 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10684 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10685 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10686 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10687 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10688 | 0 \ |
| 10689 | -S "found fragmented DTLS handshake message" \ |
| 10690 | -C "found fragmented DTLS handshake message" \ |
| 10691 | -C "error" |
| 10692 | |
| 10693 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10694 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10695 | requires_max_content_len 4096 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10696 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10697 | run_test "DTLS fragmenting: client (MTU)" \ |
| 10698 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10699 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10700 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10701 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 10702 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10703 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10704 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10705 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10706 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10707 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10708 | 0 \ |
| 10709 | -s "found fragmented DTLS handshake message" \ |
| 10710 | -C "found fragmented DTLS handshake message" \ |
| 10711 | -C "error" |
| 10712 | |
| 10713 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10714 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10715 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10716 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10717 | run_test "DTLS fragmenting: server (MTU)" \ |
| 10718 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10719 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10720 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10721 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10722 | mtu=512" \ |
| 10723 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10724 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10725 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10726 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10727 | mtu=2048" \ |
| 10728 | 0 \ |
| 10729 | -S "found fragmented DTLS handshake message" \ |
| 10730 | -c "found fragmented DTLS handshake message" \ |
| 10731 | -C "error" |
| 10732 | |
| 10733 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10734 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10735 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10736 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10737 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10738 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10739 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10740 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10741 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10742 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 10743 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10744 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10745 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10746 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10747 | hs_timeout=2500-60000 \ |
| 10748 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 10749 | 0 \ |
| 10750 | -s "found fragmented DTLS handshake message" \ |
| 10751 | -c "found fragmented DTLS handshake message" \ |
| 10752 | -C "error" |
| 10753 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10754 | # 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] | 10755 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10756 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10757 | requires_hash_alg SHA_256 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10758 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10759 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 10760 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10761 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10762 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10763 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10764 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 10765 | mtu=512" \ |
| 10766 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10767 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10768 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10769 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10770 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10771 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 10772 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 10773 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 10774 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10775 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 10776 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10777 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10778 | # 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] | 10779 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 10780 | # retransmissions, but in some cases (like both the server and client using |
| 10781 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 10782 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 10783 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10784 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10785 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10786 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10787 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10788 | -p "$P_PXY mtu=508" \ |
| 10789 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10790 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10791 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10792 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10793 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10794 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10795 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10796 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10797 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 10798 | 0 \ |
| 10799 | -s "found fragmented DTLS handshake message" \ |
| 10800 | -c "found fragmented DTLS handshake message" \ |
| 10801 | -C "error" |
| 10802 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10803 | # 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] | 10804 | only_with_valgrind |
| 10805 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10806 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10807 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 10808 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10809 | -p "$P_PXY mtu=508" \ |
| 10810 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10811 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10812 | key_file=$DATA_FILES_PATH/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10813 | hs_timeout=250-10000" \ |
| 10814 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10815 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10816 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10817 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 10818 | hs_timeout=250-10000" \ |
| 10819 | 0 \ |
| 10820 | -s "found fragmented DTLS handshake message" \ |
| 10821 | -c "found fragmented DTLS handshake message" \ |
| 10822 | -C "error" |
| 10823 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10824 | # 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] | 10825 | # OTOH the client might resend if the server is to slow to reset after sending |
| 10826 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10827 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10828 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10829 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10830 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10831 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10832 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10833 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10834 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10835 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10836 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10837 | hs_timeout=10000-60000 \ |
| 10838 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10839 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10840 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10841 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10842 | hs_timeout=10000-60000 \ |
| 10843 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10844 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10845 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10846 | -s "found fragmented DTLS handshake message" \ |
| 10847 | -c "found fragmented DTLS handshake message" \ |
| 10848 | -C "error" |
| 10849 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10850 | # 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] | 10851 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 10852 | # OTOH the client might resend if the server is to slow to reset after sending |
| 10853 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10854 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10855 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10856 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10857 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10858 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10859 | -p "$P_PXY mtu=512" \ |
| 10860 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10861 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10862 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10863 | hs_timeout=10000-60000 \ |
| 10864 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10865 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10866 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10867 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10868 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10869 | hs_timeout=10000-60000 \ |
| 10870 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10871 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10872 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 10873 | -s "found fragmented DTLS handshake message" \ |
| 10874 | -c "found fragmented DTLS handshake message" \ |
| 10875 | -C "error" |
| 10876 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10877 | not_with_valgrind # spurious autoreduction due to timeout |
| 10878 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10879 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10880 | requires_max_content_len 2048 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 10881 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10882 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10883 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10884 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10885 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10886 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10887 | hs_timeout=10000-60000 \ |
| 10888 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10889 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10890 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10891 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10892 | hs_timeout=10000-60000 \ |
| 10893 | mtu=1024 nbio=2" \ |
| 10894 | 0 \ |
| 10895 | -S "autoreduction" \ |
| 10896 | -s "found fragmented DTLS handshake message" \ |
| 10897 | -c "found fragmented DTLS handshake message" \ |
| 10898 | -C "error" |
| 10899 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10900 | # 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] | 10901 | not_with_valgrind # spurious autoreduction due to timeout |
| 10902 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10903 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10904 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10905 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 10906 | -p "$P_PXY mtu=512" \ |
| 10907 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10908 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10909 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10910 | hs_timeout=10000-60000 \ |
| 10911 | mtu=512 nbio=2" \ |
| 10912 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10913 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10914 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10915 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 10916 | hs_timeout=10000-60000 \ |
| 10917 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10918 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10919 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10920 | -s "found fragmented DTLS handshake message" \ |
| 10921 | -c "found fragmented DTLS handshake message" \ |
| 10922 | -C "error" |
| 10923 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 10924 | # 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] | 10925 | # This ensures things still work after session_reset(). |
| 10926 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10927 | # Since we don't support reading fragmented ClientHello yet, |
| 10928 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 10929 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10930 | # An autoreduction on the client-side might happen if the server is |
| 10931 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 10932 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10933 | # resumed listening, which would result in a spurious autoreduction. |
| 10934 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10935 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10936 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10937 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10938 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 10939 | -p "$P_PXY mtu=1450" \ |
| 10940 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10941 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10942 | key_file=$DATA_FILES_PATH/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10943 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10944 | mtu=1450" \ |
| 10945 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10946 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10947 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10948 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 10949 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Jerry Yu | a15af37 | 2022-12-05 15:55:24 +0800 | [diff] [blame] | 10950 | 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] | 10951 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10952 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 10953 | -s "found fragmented DTLS handshake message" \ |
| 10954 | -c "found fragmented DTLS handshake message" \ |
| 10955 | -C "error" |
| 10956 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10957 | # An autoreduction on the client-side might happen if the server is |
| 10958 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10959 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10960 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10961 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10962 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10963 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10964 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10965 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 10966 | -p "$P_PXY mtu=512" \ |
| 10967 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10968 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10969 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10970 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10971 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10972 | mtu=512" \ |
| 10973 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10974 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 10975 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10976 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Ronald Cron | 60f7666 | 2023-11-28 17:52:42 +0100 | [diff] [blame] | 10977 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 10978 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10979 | mtu=512" \ |
| 10980 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10981 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10982 | -s "found fragmented DTLS handshake message" \ |
| 10983 | -c "found fragmented DTLS handshake message" \ |
| 10984 | -C "error" |
| 10985 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 10986 | # An autoreduction on the client-side might happen if the server is |
| 10987 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 10988 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10989 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 10990 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 10991 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10992 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10993 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10994 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 10995 | -p "$P_PXY mtu=512" \ |
| 10996 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 10997 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 10998 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 10999 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11000 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11001 | mtu=512" \ |
| 11002 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11003 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11004 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11005 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11006 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11007 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11008 | mtu=512" \ |
| 11009 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11010 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11011 | -s "found fragmented DTLS handshake message" \ |
| 11012 | -c "found fragmented DTLS handshake message" \ |
| 11013 | -C "error" |
| 11014 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11015 | # An autoreduction on the client-side might happen if the server is |
| 11016 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11017 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11018 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11019 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11020 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11021 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11022 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11023 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11024 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11025 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11026 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11027 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11028 | exchanges=2 renegotiation=1 \ |
| 11029 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11030 | hs_timeout=10000-60000 \ |
| 11031 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11032 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11033 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11034 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11035 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11036 | hs_timeout=10000-60000 \ |
| 11037 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11038 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11039 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11040 | -s "found fragmented DTLS handshake message" \ |
| 11041 | -c "found fragmented DTLS handshake message" \ |
| 11042 | -C "error" |
| 11043 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11044 | # An autoreduction on the client-side might happen if the server is |
| 11045 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11046 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11047 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11048 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11049 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11050 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11051 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11052 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11053 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11054 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11055 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11056 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11057 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11058 | exchanges=2 renegotiation=1 \ |
| 11059 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11060 | hs_timeout=10000-60000 \ |
| 11061 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11062 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11063 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11064 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11065 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11066 | hs_timeout=10000-60000 \ |
| 11067 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11068 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11069 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11070 | -s "found fragmented DTLS handshake message" \ |
| 11071 | -c "found fragmented DTLS handshake message" \ |
| 11072 | -C "error" |
| 11073 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11074 | # An autoreduction on the client-side might happen if the server is |
| 11075 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 11076 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11077 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11078 | requires_config_enabled MBEDTLS_RSA_C |
Andrzej Kurek | 934e9cd | 2022-09-05 14:44:46 -0400 | [diff] [blame] | 11079 | requires_hash_alg SHA_256 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11080 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11081 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11082 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11083 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11084 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11085 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11086 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11087 | exchanges=2 renegotiation=1 \ |
| 11088 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11089 | hs_timeout=10000-60000 \ |
| 11090 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11091 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11092 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11093 | key_file=$DATA_FILES_PATH/server8.key \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11094 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 11095 | hs_timeout=10000-60000 \ |
| 11096 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11097 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 11098 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 11099 | -s "found fragmented DTLS handshake message" \ |
| 11100 | -c "found fragmented DTLS handshake message" \ |
| 11101 | -C "error" |
| 11102 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11103 | # 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] | 11104 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11105 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11106 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11107 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11108 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 11109 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11110 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11111 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11112 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11113 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11114 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11115 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11116 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11117 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11118 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 11119 | 0 \ |
| 11120 | -s "found fragmented DTLS handshake message" \ |
| 11121 | -c "found fragmented DTLS handshake message" \ |
| 11122 | -C "error" |
| 11123 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 11124 | # 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] | 11125 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11126 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11127 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11128 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11129 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 11130 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 11131 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11132 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11133 | key_file=$DATA_FILES_PATH/server7.key \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11134 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 11135 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11136 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11137 | key_file=$DATA_FILES_PATH/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 11138 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 11139 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 11140 | 0 \ |
| 11141 | -s "found fragmented DTLS handshake message" \ |
| 11142 | -c "found fragmented DTLS handshake message" \ |
| 11143 | -C "error" |
| 11144 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11145 | # interop tests for DTLS fragmentating with reliable connection |
| 11146 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11147 | # here and below we just want to test that the we fragment in a way that |
| 11148 | # pleases other implementations, so we don't need the peer to fragment |
| 11149 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11150 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 11151 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11152 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11153 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 11154 | "$G_SRV -u" \ |
| 11155 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11156 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11157 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11158 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11159 | 0 \ |
| 11160 | -c "fragmenting handshake message" \ |
| 11161 | -C "error" |
| 11162 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 11163 | # We use --insecure for the GnuTLS client because it expects |
| 11164 | # the hostname / IP it connects to to be the name used in the |
| 11165 | # certificate obtained from the server. Here, however, it |
| 11166 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 11167 | # as the server name in the certificate. This will make the |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 11168 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 11169 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11170 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11171 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 11172 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 11173 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11174 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11175 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Valerio Setti | 3b2c028 | 2023-03-08 10:22:29 +0100 | [diff] [blame] | 11176 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11177 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11178 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11179 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 11180 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11181 | 0 \ |
| 11182 | -s "fragmenting handshake message" |
| 11183 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11184 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11185 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11186 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11187 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 11188 | "$O_SRV -dtls1_2 -verify 10" \ |
| 11189 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11190 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11191 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11192 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11193 | 0 \ |
| 11194 | -c "fragmenting handshake message" \ |
| 11195 | -C "error" |
| 11196 | |
| 11197 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11198 | requires_config_enabled MBEDTLS_RSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11199 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11200 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 11201 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11202 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11203 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11204 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 11205 | "$O_CLI -dtls1_2" \ |
| 11206 | 0 \ |
| 11207 | -s "fragmenting handshake message" |
| 11208 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11209 | # interop tests for DTLS fragmentating with unreliable connection |
| 11210 | # |
| 11211 | # again we just want to test that the we fragment in a way that |
| 11212 | # pleases other implementations, so we don't need the peer to fragment |
| 11213 | requires_gnutls_next |
| 11214 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11215 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 11216 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11217 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11218 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 11219 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11220 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11221 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11222 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11223 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11224 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11225 | 0 \ |
| 11226 | -c "fragmenting handshake message" \ |
| 11227 | -C "error" |
| 11228 | |
| 11229 | requires_gnutls_next |
| 11230 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11231 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11232 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11233 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11234 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 11235 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11236 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11237 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11238 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11239 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 11240 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11241 | 0 \ |
| 11242 | -s "fragmenting handshake message" |
| 11243 | |
Zhangsen Wang | 9138512 | 2022-07-12 01:48:17 +0000 | [diff] [blame] | 11244 | ## The test below requires 1.1.1a or higher version of openssl, otherwise |
| 11245 | ## 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] | 11246 | requires_openssl_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11247 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11248 | requires_config_enabled MBEDTLS_RSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11249 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11250 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11251 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 11252 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 11253 | "$O_NEXT_SRV -dtls1_2 -verify 10" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11254 | "$P_CLI dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11255 | crt_file=$DATA_FILES_PATH/server8_int-ca2.crt \ |
| 11256 | key_file=$DATA_FILES_PATH/server8.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11257 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 11258 | 0 \ |
| 11259 | -c "fragmenting handshake message" \ |
| 11260 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11261 | |
Zhangsen Wang | d5e8a48 | 2022-07-29 07:53:36 +0000 | [diff] [blame] | 11262 | ## the test below will time out with certain seed. |
Zhangsen Wang | baeffbb | 2022-07-29 06:34:47 +0000 | [diff] [blame] | 11263 | ## The cause is an openssl bug (https://github.com/openssl/openssl/issues/18887) |
| 11264 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11265 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 11266 | requires_config_enabled MBEDTLS_RSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11267 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 11268 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11269 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 11270 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 11271 | "$P_SRV dtls=1 debug_level=2 \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 11272 | crt_file=$DATA_FILES_PATH/server7_int-ca.crt \ |
| 11273 | key_file=$DATA_FILES_PATH/server7.key \ |
Xiaofei Bai | 8b5c382 | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 11274 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 11275 | "$O_CLI -dtls1_2" \ |
| 11276 | 0 \ |
| 11277 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 11278 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11279 | # Tests for DTLS-SRTP (RFC 5764) |
| 11280 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11281 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11282 | run_test "DTLS-SRTP all profiles supported" \ |
| 11283 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11284 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11285 | 0 \ |
| 11286 | -s "found use_srtp extension" \ |
| 11287 | -s "found srtp profile" \ |
| 11288 | -s "selected srtp profile" \ |
| 11289 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11290 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11291 | -c "client hello, adding use_srtp extension" \ |
| 11292 | -c "found use_srtp extension" \ |
| 11293 | -c "found srtp profile" \ |
| 11294 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11295 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11296 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11297 | -C "error" |
| 11298 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11299 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11300 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11301 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11302 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 11303 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11304 | "$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] | 11305 | 0 \ |
| 11306 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11307 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 11308 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11309 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11310 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11311 | -c "client hello, adding use_srtp extension" \ |
| 11312 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11313 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11314 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11315 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11316 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11317 | -C "error" |
| 11318 | |
| 11319 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11320 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11321 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11322 | "$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] | 11323 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11324 | 0 \ |
| 11325 | -s "found use_srtp extension" \ |
| 11326 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11327 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11328 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11329 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11330 | -c "client hello, adding use_srtp extension" \ |
| 11331 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11332 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11333 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11334 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11335 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11336 | -C "error" |
| 11337 | |
| 11338 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11339 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11340 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 11341 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11342 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11343 | 0 \ |
| 11344 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11345 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11346 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11347 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11348 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11349 | -c "client hello, adding use_srtp extension" \ |
| 11350 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11351 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11352 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11353 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11354 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11355 | -C "error" |
| 11356 | |
| 11357 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11358 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11359 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 11360 | "$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] | 11361 | "$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] | 11362 | 0 \ |
| 11363 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11364 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11365 | -S "selected srtp profile" \ |
| 11366 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11367 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11368 | -c "client hello, adding use_srtp extension" \ |
| 11369 | -C "found use_srtp extension" \ |
| 11370 | -C "found srtp profile" \ |
| 11371 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11372 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11373 | -C "error" |
| 11374 | |
| 11375 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11376 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11377 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 11378 | "$P_SRV dtls=1 debug_level=3" \ |
| 11379 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11380 | 0 \ |
| 11381 | -s "found use_srtp extension" \ |
| 11382 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11383 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11384 | -c "client hello, adding use_srtp extension" \ |
| 11385 | -C "found use_srtp extension" \ |
| 11386 | -C "found srtp profile" \ |
| 11387 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11388 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11389 | -C "error" |
| 11390 | |
| 11391 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11392 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11393 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 11394 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 11395 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11396 | 0 \ |
| 11397 | -s "found use_srtp extension" \ |
| 11398 | -s "found srtp profile" \ |
| 11399 | -s "selected srtp profile" \ |
| 11400 | -s "server hello, adding use_srtp extension" \ |
| 11401 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11402 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11403 | -c "client hello, adding use_srtp extension" \ |
| 11404 | -c "found use_srtp extension" \ |
| 11405 | -c "found srtp profile" \ |
| 11406 | -c "selected srtp profile" \ |
| 11407 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11408 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11409 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11410 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 11411 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11412 | -C "error" |
| 11413 | |
| 11414 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11415 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11416 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 11417 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11418 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11419 | 0 \ |
| 11420 | -s "found use_srtp extension" \ |
| 11421 | -s "found srtp profile" \ |
| 11422 | -s "selected srtp profile" \ |
| 11423 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11424 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 11425 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11426 | -S "dumping 'using mki' (8 bytes)" \ |
| 11427 | -c "client hello, adding use_srtp extension" \ |
| 11428 | -c "found use_srtp extension" \ |
| 11429 | -c "found srtp profile" \ |
| 11430 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11431 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 11432 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 11433 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 11434 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11435 | -C "dumping 'received mki' (8 bytes)" \ |
| 11436 | -C "error" |
| 11437 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11438 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11439 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11440 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 11441 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11442 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11443 | 0 \ |
| 11444 | -s "found use_srtp extension" \ |
| 11445 | -s "found srtp profile" \ |
| 11446 | -s "selected srtp profile" \ |
| 11447 | -s "server hello, adding use_srtp extension" \ |
| 11448 | -s "DTLS-SRTP key material is"\ |
| 11449 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11450 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 11451 | |
| 11452 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11453 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11454 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 11455 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11456 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11457 | 0 \ |
| 11458 | -s "found use_srtp extension" \ |
| 11459 | -s "found srtp profile" \ |
| 11460 | -s "selected srtp profile" \ |
| 11461 | -s "server hello, adding use_srtp extension" \ |
| 11462 | -s "DTLS-SRTP key material is"\ |
| 11463 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11464 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11465 | |
| 11466 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11467 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11468 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 11469 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11470 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11471 | 0 \ |
| 11472 | -s "found use_srtp extension" \ |
| 11473 | -s "found srtp profile" \ |
| 11474 | -s "selected srtp profile" \ |
| 11475 | -s "server hello, adding use_srtp extension" \ |
| 11476 | -s "DTLS-SRTP key material is"\ |
| 11477 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11478 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11479 | |
| 11480 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11481 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11482 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 11483 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11484 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11485 | 0 \ |
| 11486 | -s "found use_srtp extension" \ |
| 11487 | -s "found srtp profile" \ |
| 11488 | -s "selected srtp profile" \ |
| 11489 | -s "server hello, adding use_srtp extension" \ |
| 11490 | -s "DTLS-SRTP key material is"\ |
| 11491 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11492 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11493 | |
| 11494 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11496 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 11497 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11498 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11499 | 0 \ |
| 11500 | -s "found use_srtp extension" \ |
| 11501 | -s "found srtp profile" \ |
| 11502 | -s "selected srtp profile" \ |
| 11503 | -s "server hello, adding use_srtp extension" \ |
| 11504 | -s "DTLS-SRTP key material is"\ |
| 11505 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 11506 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 11507 | |
| 11508 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11509 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11510 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 11511 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11512 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11513 | 0 \ |
| 11514 | -s "found use_srtp extension" \ |
| 11515 | -s "found srtp profile" \ |
| 11516 | -S "selected srtp profile" \ |
| 11517 | -S "server hello, adding use_srtp extension" \ |
| 11518 | -S "DTLS-SRTP key material is"\ |
| 11519 | -C "SRTP Extension negotiated, profile" |
| 11520 | |
| 11521 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11522 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11523 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 11524 | "$P_SRV dtls=1 debug_level=3" \ |
| 11525 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11526 | 0 \ |
| 11527 | -s "found use_srtp extension" \ |
| 11528 | -S "server hello, adding use_srtp extension" \ |
| 11529 | -S "DTLS-SRTP key material is"\ |
| 11530 | -C "SRTP Extension negotiated, profile" |
| 11531 | |
| 11532 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11533 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11534 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 11535 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11536 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11537 | 0 \ |
| 11538 | -c "client hello, adding use_srtp extension" \ |
| 11539 | -c "found use_srtp extension" \ |
| 11540 | -c "found srtp profile" \ |
| 11541 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 11542 | -c "DTLS-SRTP key material is"\ |
| 11543 | -C "error" |
| 11544 | |
| 11545 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11547 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 11548 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11549 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11550 | 0 \ |
| 11551 | -c "client hello, adding use_srtp extension" \ |
| 11552 | -c "found use_srtp extension" \ |
| 11553 | -c "found srtp profile" \ |
| 11554 | -c "selected srtp profile" \ |
| 11555 | -c "DTLS-SRTP key material is"\ |
| 11556 | -C "error" |
| 11557 | |
| 11558 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11559 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11560 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 11561 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11562 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11563 | 0 \ |
| 11564 | -c "client hello, adding use_srtp extension" \ |
| 11565 | -c "found use_srtp extension" \ |
| 11566 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11567 | -c "selected srtp profile" \ |
| 11568 | -c "DTLS-SRTP key material is"\ |
| 11569 | -C "error" |
| 11570 | |
| 11571 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11572 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11573 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 11574 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11575 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11576 | 0 \ |
| 11577 | -c "client hello, adding use_srtp extension" \ |
| 11578 | -c "found use_srtp extension" \ |
| 11579 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11580 | -c "selected srtp profile" \ |
| 11581 | -c "DTLS-SRTP key material is"\ |
| 11582 | -C "error" |
| 11583 | |
| 11584 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11585 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11586 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 11587 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11588 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11589 | 0 \ |
| 11590 | -c "client hello, adding use_srtp extension" \ |
| 11591 | -c "found use_srtp extension" \ |
| 11592 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11593 | -c "selected srtp profile" \ |
| 11594 | -c "DTLS-SRTP key material is"\ |
| 11595 | -C "error" |
| 11596 | |
| 11597 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11598 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11599 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 11600 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11601 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 11602 | 0 \ |
| 11603 | -c "client hello, adding use_srtp extension" \ |
| 11604 | -C "found use_srtp extension" \ |
| 11605 | -C "found srtp profile" \ |
| 11606 | -C "selected srtp profile" \ |
| 11607 | -C "DTLS-SRTP key material is"\ |
| 11608 | -C "error" |
| 11609 | |
| 11610 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11611 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11612 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 11613 | "$O_SRV -dtls" \ |
| 11614 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11615 | 0 \ |
| 11616 | -c "client hello, adding use_srtp extension" \ |
| 11617 | -C "found use_srtp extension" \ |
| 11618 | -C "found srtp profile" \ |
| 11619 | -C "selected srtp profile" \ |
| 11620 | -C "DTLS-SRTP key material is"\ |
| 11621 | -C "error" |
| 11622 | |
| 11623 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11624 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 11625 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 11626 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 11627 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11628 | 0 \ |
| 11629 | -c "client hello, adding use_srtp extension" \ |
| 11630 | -c "found use_srtp extension" \ |
| 11631 | -c "found srtp profile" \ |
| 11632 | -c "selected srtp profile" \ |
| 11633 | -c "DTLS-SRTP key material is"\ |
| 11634 | -c "DTLS-SRTP no mki value negotiated"\ |
| 11635 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11636 | -C "dumping 'received mki' (8 bytes)" \ |
| 11637 | -C "error" |
| 11638 | |
| 11639 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11640 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11641 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11642 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11643 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11644 | "$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] | 11645 | 0 \ |
| 11646 | -s "found use_srtp extension" \ |
| 11647 | -s "found srtp profile" \ |
| 11648 | -s "selected srtp profile" \ |
| 11649 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11650 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11651 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 11652 | |
| 11653 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11654 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11655 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11656 | 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] | 11657 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11658 | "$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] | 11659 | 0 \ |
| 11660 | -s "found use_srtp extension" \ |
| 11661 | -s "found srtp profile" \ |
| 11662 | -s "selected srtp profile" \ |
| 11663 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11664 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11665 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 11666 | |
| 11667 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11668 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11669 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11670 | 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] | 11671 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 11672 | "$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] | 11673 | 0 \ |
| 11674 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11675 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11676 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11677 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11678 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11679 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11680 | |
| 11681 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11682 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11683 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11684 | 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] | 11685 | "$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] | 11686 | "$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] | 11687 | 0 \ |
| 11688 | -s "found use_srtp extension" \ |
| 11689 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11690 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11691 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11692 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11693 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 11694 | |
| 11695 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11696 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11697 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11698 | 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] | 11699 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11700 | "$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] | 11701 | 0 \ |
| 11702 | -s "found use_srtp extension" \ |
| 11703 | -s "found srtp profile" \ |
| 11704 | -s "selected srtp profile" \ |
| 11705 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11706 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11707 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 11708 | |
| 11709 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11710 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11711 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11712 | 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] | 11713 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 11714 | "$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] | 11715 | 0 \ |
| 11716 | -s "found use_srtp extension" \ |
| 11717 | -s "found srtp profile" \ |
| 11718 | -S "selected srtp profile" \ |
| 11719 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11720 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11721 | -C "SRTP profile:" |
| 11722 | |
| 11723 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11724 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11725 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11726 | 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] | 11727 | "$P_SRV dtls=1 debug_level=3" \ |
| 11728 | "$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] | 11729 | 0 \ |
| 11730 | -s "found use_srtp extension" \ |
| 11731 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11732 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11733 | -C "SRTP profile:" |
| 11734 | |
| 11735 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11736 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11737 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11738 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 11739 | "$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" \ |
| 11740 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11741 | 0 \ |
| 11742 | -c "client hello, adding use_srtp extension" \ |
| 11743 | -c "found use_srtp extension" \ |
| 11744 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11745 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11746 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11747 | -C "error" |
| 11748 | |
| 11749 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11750 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11751 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11752 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 11753 | "$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" \ |
| 11754 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11755 | 0 \ |
| 11756 | -c "client hello, adding use_srtp extension" \ |
| 11757 | -c "found use_srtp extension" \ |
| 11758 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11759 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11760 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11761 | -C "error" |
| 11762 | |
| 11763 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11764 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11765 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11766 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 11767 | "$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" \ |
| 11768 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11769 | 0 \ |
| 11770 | -c "client hello, adding use_srtp extension" \ |
| 11771 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11772 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11773 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11774 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11775 | -C "error" |
| 11776 | |
| 11777 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11778 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11779 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11780 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 11781 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11782 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11783 | 0 \ |
| 11784 | -c "client hello, adding use_srtp extension" \ |
| 11785 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11786 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11787 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11788 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11789 | -C "error" |
| 11790 | |
| 11791 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11792 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11793 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11794 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 11795 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 11796 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 11797 | 0 \ |
| 11798 | -c "client hello, adding use_srtp extension" \ |
| 11799 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11800 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11801 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11802 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11803 | -C "error" |
| 11804 | |
| 11805 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11806 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11807 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11808 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 11809 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 11810 | "$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] | 11811 | 0 \ |
| 11812 | -c "client hello, adding use_srtp extension" \ |
| 11813 | -C "found use_srtp extension" \ |
| 11814 | -C "found srtp profile" \ |
| 11815 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11816 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11817 | -C "error" |
| 11818 | |
| 11819 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11820 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11821 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11822 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 11823 | "$G_SRV -u" \ |
| 11824 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 11825 | 0 \ |
| 11826 | -c "client hello, adding use_srtp extension" \ |
| 11827 | -C "found use_srtp extension" \ |
| 11828 | -C "found srtp profile" \ |
| 11829 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11830 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11831 | -C "error" |
| 11832 | |
| 11833 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 11834 | requires_gnutls |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11835 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11836 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 11837 | "$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" \ |
| 11838 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 11839 | 0 \ |
| 11840 | -c "client hello, adding use_srtp extension" \ |
| 11841 | -c "found use_srtp extension" \ |
| 11842 | -c "found srtp profile" \ |
| 11843 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 11844 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 11845 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 11846 | -c "dumping 'sending mki' (8 bytes)" \ |
| 11847 | -c "dumping 'received mki' (8 bytes)" \ |
| 11848 | -C "error" |
| 11849 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 11850 | # Tests for specific things with "unreliable" UDP connection |
| 11851 | |
| 11852 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11853 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 11854 | run_test "DTLS proxy: reference" \ |
| 11855 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 11856 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 11857 | "$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] | 11858 | 0 \ |
| 11859 | -C "replayed record" \ |
| 11860 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 11861 | -C "Buffer record from epoch" \ |
| 11862 | -S "Buffer record from epoch" \ |
| 11863 | -C "ssl_buffer_message" \ |
| 11864 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 11865 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11866 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 11867 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11868 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 11869 | -c "HTTP/1.0 200 OK" |
| 11870 | |
| 11871 | not_with_valgrind # spurious resend due to timeout |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11872 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11873 | run_test "DTLS proxy: duplicate every packet" \ |
| 11874 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 11875 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 11876 | "$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] | 11877 | 0 \ |
| 11878 | -c "replayed record" \ |
| 11879 | -s "replayed record" \ |
| 11880 | -c "record from another epoch" \ |
| 11881 | -s "record from another epoch" \ |
| 11882 | -S "resend" \ |
| 11883 | -s "Extra-header:" \ |
| 11884 | -c "HTTP/1.0 200 OK" |
| 11885 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11886 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 11887 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 11888 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11889 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 11890 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 11891 | 0 \ |
| 11892 | -c "replayed record" \ |
| 11893 | -S "replayed record" \ |
| 11894 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11895 | -s "record from another epoch" \ |
| 11896 | -c "resend" \ |
| 11897 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11898 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11899 | -c "HTTP/1.0 200 OK" |
| 11900 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11901 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11902 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 11903 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11904 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 11905 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 11906 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11907 | -c "next record in same datagram" \ |
| 11908 | -s "next record in same datagram" |
| 11909 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11910 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11911 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 11912 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11913 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 11914 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11915 | 0 \ |
| 11916 | -c "next record in same datagram" \ |
| 11917 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11918 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11919 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 11920 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 11921 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11922 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 11923 | "$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] | 11924 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 11925 | -c "discarding invalid record (mac)" \ |
| 11926 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11927 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11928 | -c "HTTP/1.0 200 OK" \ |
| 11929 | -S "too many records with bad MAC" \ |
| 11930 | -S "Verification of the message MAC failed" |
| 11931 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11932 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11933 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 11934 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11935 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 11936 | "$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] | 11937 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 11938 | -C "discarding invalid record (mac)" \ |
| 11939 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11940 | -S "Extra-header:" \ |
| 11941 | -C "HTTP/1.0 200 OK" \ |
| 11942 | -s "too many records with bad MAC" \ |
| 11943 | -s "Verification of the message MAC failed" |
| 11944 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11945 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11946 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 11947 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11948 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 11949 | "$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] | 11950 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 11951 | -c "discarding invalid record (mac)" \ |
| 11952 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11953 | -s "Extra-header:" \ |
| 11954 | -c "HTTP/1.0 200 OK" \ |
| 11955 | -S "too many records with bad MAC" \ |
| 11956 | -S "Verification of the message MAC failed" |
| 11957 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11958 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11959 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 11960 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 11961 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 11962 | "$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] | 11963 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 11964 | -c "discarding invalid record (mac)" \ |
| 11965 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 11966 | -s "Extra-header:" \ |
| 11967 | -c "HTTP/1.0 200 OK" \ |
| 11968 | -s "too many records with bad MAC" \ |
| 11969 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11970 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11971 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11972 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 11973 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 11974 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 11975 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11976 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 11977 | -c "record from another epoch" \ |
| 11978 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 11979 | -s "Extra-header:" \ |
| 11980 | -c "HTTP/1.0 200 OK" |
| 11981 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 11982 | # Tests for reordering support with DTLS |
| 11983 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 11984 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 11985 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11986 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 11987 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 11988 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 11989 | hs_timeout=2500-60000" \ |
| 11990 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 11991 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 11992 | 0 \ |
| 11993 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11994 | -c "Next handshake message has been buffered - load"\ |
| 11995 | -S "Buffering HS message" \ |
| 11996 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11997 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 11998 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 11999 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12000 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 12001 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12002 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12003 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12004 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 12005 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12006 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12007 | hs_timeout=2500-60000" \ |
| 12008 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12009 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12010 | 0 \ |
| 12011 | -c "Buffering HS message" \ |
| 12012 | -c "found fragmented DTLS handshake message"\ |
| 12013 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 12014 | -c "Next handshake message has been buffered - load"\ |
| 12015 | -S "Buffering HS message" \ |
| 12016 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12017 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 12018 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12019 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 12020 | -S "Remember CCS message" |
| 12021 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12022 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 12023 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 12024 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 12025 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12026 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12027 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12028 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12029 | 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] | 12030 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12031 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12032 | hs_timeout=2500-60000" \ |
| 12033 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12034 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12035 | 0 \ |
| 12036 | -c "Buffering HS message" \ |
| 12037 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12038 | -C "attempt to make space by freeing buffered messages" \ |
| 12039 | -S "Buffering HS message" \ |
| 12040 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12041 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12042 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12043 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12044 | -S "Remember CCS message" |
| 12045 | |
| 12046 | # The size constraints ensure that the delayed certificate message can't |
| 12047 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 12048 | # when dropping it first. |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12049 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12050 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 12051 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12052 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12053 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 12054 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12055 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12056 | hs_timeout=2500-60000" \ |
| 12057 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12058 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12059 | 0 \ |
| 12060 | -c "Buffering HS message" \ |
| 12061 | -c "attempt to make space by freeing buffered future messages" \ |
| 12062 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12063 | -S "Buffering HS message" \ |
| 12064 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12065 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12066 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12067 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 12068 | -S "Remember CCS message" |
| 12069 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12070 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12071 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12072 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 12073 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12074 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 12075 | hs_timeout=2500-60000" \ |
| 12076 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12077 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12078 | 0 \ |
| 12079 | -C "Buffering HS message" \ |
| 12080 | -C "Next handshake message has been buffered - load"\ |
| 12081 | -s "Buffering HS message" \ |
| 12082 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12083 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12084 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12085 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12086 | -S "Remember CCS message" |
| 12087 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12088 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12089 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12090 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12091 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 12092 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12093 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12094 | hs_timeout=2500-60000" \ |
| 12095 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12096 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12097 | 0 \ |
| 12098 | -C "Buffering HS message" \ |
| 12099 | -C "Next handshake message has been buffered - load"\ |
| 12100 | -S "Buffering HS message" \ |
| 12101 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12102 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12103 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12104 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12105 | -S "Remember CCS message" |
| 12106 | |
Gilles Peskine | 6f160ca | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 12107 | requires_certificate_authentication |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12108 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12109 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 12110 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12111 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12112 | hs_timeout=2500-60000" \ |
| 12113 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12114 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12115 | 0 \ |
| 12116 | -C "Buffering HS message" \ |
| 12117 | -C "Next handshake message has been buffered - load"\ |
| 12118 | -S "Buffering HS message" \ |
| 12119 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12120 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12121 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 12122 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12123 | -s "Remember CCS message" |
| 12124 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12125 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12126 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12127 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12128 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 12129 | hs_timeout=2500-60000" \ |
| 12130 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 12131 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 12132 | 0 \ |
| 12133 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 12134 | -s "Found buffered record from current epoch - load" \ |
| 12135 | -c "Buffer record from epoch 1" \ |
| 12136 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12137 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12138 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 12139 | # from the server are delayed, so that the encrypted Finished message |
| 12140 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 12141 | # in afterwards, the encrypted Finished message must be freed in order |
| 12142 | # to make space for the NewSessionTicket to be reassembled. |
| 12143 | # This works only in very particular circumstances: |
| 12144 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 12145 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 12146 | # the encrypted Finished message. |
| 12147 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 12148 | # needs to be fragmented. |
| 12149 | # - All messages sent by the server must be small enough to be either sent |
| 12150 | # without fragmentation or be reassembled within the bounds of |
| 12151 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 12152 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 12153 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 12154 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12155 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 12156 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12157 | "$P_SRV mtu=140 response_size=90 dgram_packing=0 psk=73776f726466697368 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 12158 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=73776f726466697368 psk_identity=foo" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 12159 | 0 \ |
| 12160 | -s "Buffer record from epoch 1" \ |
| 12161 | -s "Found buffered record from current epoch - load" \ |
| 12162 | -c "Buffer record from epoch 1" \ |
| 12163 | -C "Found buffered record from current epoch - load" \ |
| 12164 | -c "Enough space available after freeing future epoch record" |
| 12165 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 12166 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 12167 | |
| 12168 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 12169 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 12170 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12171 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12172 | psk=73776f726466697368" \ |
| 12173 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=73776f726466697368 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12174 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12175 | 0 \ |
| 12176 | -s "Extra-header:" \ |
| 12177 | -c "HTTP/1.0 200 OK" |
| 12178 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12179 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12180 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 12181 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12182 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 12183 | "$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] | 12184 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 12185 | 0 \ |
| 12186 | -s "Extra-header:" \ |
| 12187 | -c "HTTP/1.0 200 OK" |
| 12188 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12189 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12190 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12191 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 12192 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12193 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 12194 | "$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] | 12195 | 0 \ |
| 12196 | -s "Extra-header:" \ |
| 12197 | -c "HTTP/1.0 200 OK" |
| 12198 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12199 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12201 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 12202 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12203 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 12204 | "$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] | 12205 | 0 \ |
| 12206 | -s "Extra-header:" \ |
| 12207 | -c "HTTP/1.0 200 OK" |
| 12208 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12209 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12210 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12211 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12212 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 12213 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12214 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 12215 | "$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] | 12216 | 0 \ |
| 12217 | -s "Extra-header:" \ |
| 12218 | -c "HTTP/1.0 200 OK" |
| 12219 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12220 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12221 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12222 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 12223 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 12224 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12225 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 12226 | "$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] | 12227 | 0 \ |
| 12228 | -s "Extra-header:" \ |
| 12229 | -c "HTTP/1.0 200 OK" |
| 12230 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12231 | client_needs_more_time 2 |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12232 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Norbert Fabritius | c93fc86 | 2023-04-12 09:50:30 +0200 | [diff] [blame] | 12233 | requires_config_enabled MBEDTLS_SSL_SESSION_TICKETS |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12234 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 12235 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12236 | "$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] | 12237 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12238 | "$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] | 12239 | 0 \ |
| 12240 | -s "Extra-header:" \ |
| 12241 | -c "HTTP/1.0 200 OK" |
| 12242 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12243 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 12244 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 12245 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 12246 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12247 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12248 | psk=73776f726466697368 debug_level=3" \ |
| 12249 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=73776f726466697368 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 12250 | 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] | 12251 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12252 | 0 \ |
| 12253 | -s "a session has been resumed" \ |
| 12254 | -c "a session has been resumed" \ |
| 12255 | -s "Extra-header:" \ |
| 12256 | -c "HTTP/1.0 200 OK" |
| 12257 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12258 | client_needs_more_time 4 |
Gilles Peskine | 2fe796f | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 12259 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 12260 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 12261 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12262 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12263 | psk=73776f726466697368 debug_level=3 nbio=2" \ |
| 12264 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=73776f726466697368 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 12265 | 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] | 12266 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 12267 | 0 \ |
| 12268 | -s "a session has been resumed" \ |
| 12269 | -c "a session has been resumed" \ |
| 12270 | -s "Extra-header:" \ |
| 12271 | -c "HTTP/1.0 200 OK" |
| 12272 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12273 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12274 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12275 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 12276 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12277 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12278 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 12279 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=73776f726466697368 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 12280 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 12281 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12282 | 0 \ |
| 12283 | -c "=> renegotiate" \ |
| 12284 | -s "=> renegotiate" \ |
| 12285 | -s "Extra-header:" \ |
| 12286 | -c "HTTP/1.0 200 OK" |
| 12287 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12288 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12289 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12290 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 12291 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12292 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12293 | psk=73776f726466697368 renegotiation=1 debug_level=2" \ |
| 12294 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=73776f726466697368 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 12295 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12296 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12297 | 0 \ |
| 12298 | -c "=> renegotiate" \ |
| 12299 | -s "=> renegotiate" \ |
| 12300 | -s "Extra-header:" \ |
| 12301 | -c "HTTP/1.0 200 OK" |
| 12302 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12303 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12304 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12305 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 12306 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12307 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12308 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12309 | debug_level=2" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12310 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=73776f726466697368 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 12311 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12312 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12313 | 0 \ |
| 12314 | -c "=> renegotiate" \ |
| 12315 | -s "=> renegotiate" \ |
| 12316 | -s "Extra-header:" \ |
| 12317 | -c "HTTP/1.0 200 OK" |
| 12318 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12319 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 12320 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12321 | 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] | 12322 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12323 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12324 | psk=73776f726466697368 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12325 | debug_level=2 nbio=2" \ |
Gilles Peskine | 02cd716 | 2024-04-29 16:09:52 +0200 | [diff] [blame] | 12326 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=73776f726466697368 \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 12327 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 12328 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 12329 | 0 \ |
| 12330 | -c "=> renegotiate" \ |
| 12331 | -s "=> renegotiate" \ |
| 12332 | -s "Extra-header:" \ |
| 12333 | -c "HTTP/1.0 200 OK" |
| 12334 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12335 | ## The three tests below require 1.1.1a or higher version of openssl, otherwise |
| 12336 | ## it might trigger a bug due to openssl (https://github.com/openssl/openssl/issues/6902) |
| 12337 | ## Besides, openssl should use dtls1_2 or dtls, otherwise it will cause "SSL alert number 70" error |
| 12338 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12339 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12340 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12341 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12342 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 12343 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Valerio Setti | 2f8eb62 | 2023-03-16 13:04:44 +0100 | [diff] [blame] | 12344 | "$O_NEXT_SRV -dtls1_2 -mtu 2048" \ |
| 12345 | "$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] | 12346 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 12347 | -c "HTTP/1.0 200 OK" |
| 12348 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12349 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12350 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12351 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12352 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12353 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 12354 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12355 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12356 | "$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] | 12357 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12358 | -c "HTTP/1.0 200 OK" |
| 12359 | |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12360 | requires_openssl_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12361 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12362 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12363 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12364 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 12365 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
Zhangsen Wang | 87a9c86 | 2022-06-28 06:10:35 +0000 | [diff] [blame] | 12366 | "$O_NEXT_SRV -dtls1_2 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12367 | "$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] | 12368 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12369 | -c "HTTP/1.0 200 OK" |
| 12370 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 12371 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12372 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12373 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12374 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12375 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 12376 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 12377 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12378 | "$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] | 12379 | 0 \ |
| 12380 | -s "Extra-header:" \ |
| 12381 | -c "Extra-header:" |
| 12382 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12383 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12384 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12385 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 12387 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 12388 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12389 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12390 | "$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] | 12391 | 0 \ |
| 12392 | -s "Extra-header:" \ |
| 12393 | -c "Extra-header:" |
| 12394 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12395 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 12396 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 12397 | not_with_valgrind # risk of non-mbedtls peer timing out |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12398 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 12399 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 12400 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 12401 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 12402 | "$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] | 12403 | 0 \ |
| 12404 | -s "Extra-header:" \ |
| 12405 | -c "Extra-header:" |
| 12406 | |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 12407 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12408 | run_test "export keys functionality" \ |
| 12409 | "$P_SRV eap_tls=1 debug_level=3" \ |
Ronald Cron | f95d169 | 2023-03-14 17:19:42 +0100 | [diff] [blame] | 12410 | "$P_CLI force_version=tls12 eap_tls=1 debug_level=3" \ |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12411 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 12412 | -c "EAP-TLS key material is:"\ |
| 12413 | -s "EAP-TLS key material is:"\ |
| 12414 | -c "EAP-TLS IV is:" \ |
| 12415 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 12416 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 12417 | # openssl feature tests: check if tls1.3 exists. |
| 12418 | requires_openssl_tls1_3 |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12419 | run_test "TLS 1.3: Test openssl tls1_3 feature" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 12420 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 12421 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 12422 | 0 \ |
| 12423 | -c "TLS 1.3" \ |
| 12424 | -s "TLS 1.3" |
| 12425 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 12426 | # 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] | 12427 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 12428 | requires_gnutls_next_no_ticket |
| 12429 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12430 | run_test "TLS 1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 12431 | "$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] | 12432 | "$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] | 12433 | 0 \ |
| 12434 | -s "Version: TLS1.3" \ |
| 12435 | -c "Version: TLS1.3" |
| 12436 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 12437 | # TLS1.3 test cases |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12438 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12439 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12440 | requires_ciphersuite_enabled TLS1-3-CHACHA20-POLY1305-SHA256 |
Valerio Setti | cf29c5d | 2023-09-01 09:03:41 +0200 | [diff] [blame] | 12441 | requires_any_configs_enabled "PSA_WANT_ECC_MONTGOMERY_255" |
| 12442 | requires_any_configs_enabled "PSA_WANT_ECC_SECP_R1_256" |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12443 | run_test "TLS 1.3: Default" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12444 | "$P_SRV allow_sha1=0 debug_level=3 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key force_version=tls13" \ |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12445 | "$P_CLI allow_sha1=0" \ |
| 12446 | 0 \ |
| 12447 | -s "Protocol is TLSv1.3" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12448 | -s "Ciphersuite is TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12449 | -s "ECDH/FFDH group: " \ |
Ronald Cron | b18c67a | 2023-02-16 16:57:16 +0100 | [diff] [blame] | 12450 | -s "selected signature algorithm ecdsa_secp256r1_sha256" |
| 12451 | |
Ronald Cron | 587cfe6 | 2024-02-08 08:56:09 +0100 | [diff] [blame] | 12452 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12453 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12454 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 12455 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 12456 | run_test "Establish TLS 1.2 then TLS 1.3 session" \ |
| 12457 | "$P_SRV" \ |
| 12458 | "( $P_CLI force_version=tls12; \ |
| 12459 | $P_CLI force_version=tls13 )" \ |
| 12460 | 0 \ |
| 12461 | -s "Protocol is TLSv1.2" \ |
| 12462 | -s "Protocol is TLSv1.3" \ |
| 12463 | |
Ronald Cron | 90abb22 | 2024-02-08 09:02:49 +0100 | [diff] [blame] | 12464 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 12465 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 12466 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 12467 | requires_any_configs_enabled $TLS1_2_KEY_EXCHANGES_WITH_CERT |
| 12468 | run_test "Establish TLS 1.3 then TLS 1.2 session" \ |
| 12469 | "$P_SRV" \ |
| 12470 | "( $P_CLI force_version=tls13; \ |
| 12471 | $P_CLI force_version=tls12 )" \ |
| 12472 | 0 \ |
| 12473 | -s "Protocol is TLSv1.3" \ |
| 12474 | -s "Protocol is TLSv1.2" \ |
| 12475 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12476 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12477 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12478 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12479 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12480 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12481 | run_test "TLS 1.3: minimal feature sets - openssl" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12482 | "$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] | 12483 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12484 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12485 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12486 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12487 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12488 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12489 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12490 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12491 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12492 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12493 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12494 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12495 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12496 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12497 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12498 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12499 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12500 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12501 | -c "=> parse certificate verify" \ |
| 12502 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12503 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12504 | -c "<= parse finished message" \ |
Gilles Peskine | c63a1e0 | 2022-01-13 01:10:24 +0100 | [diff] [blame] | 12505 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12506 | -c "HTTP/1.0 200 ok" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 12507 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 12508 | requires_gnutls_tls1_3 |
Jerry Yu | 937ac67 | 2021-10-28 17:39:28 +0800 | [diff] [blame] | 12509 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 12510 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12511 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12512 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12513 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | c502dff | 2021-12-03 10:04:08 +0800 | [diff] [blame] | 12514 | run_test "TLS 1.3: minimal feature sets - gnutls" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 12515 | "$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] | 12516 | "$P_CLI debug_level=3" \ |
Jerry Yu | e1b1e2d | 2021-10-29 17:46:32 +0800 | [diff] [blame] | 12517 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12518 | -s "SERVER HELLO was queued" \ |
| 12519 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12520 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12521 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12522 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12523 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12524 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12525 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12526 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12527 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12528 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12529 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12530 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12531 | -c "DHE group name: " \ |
Xiaofei Bai | 746f948 | 2021-11-12 08:53:56 +0000 | [diff] [blame] | 12532 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12533 | -c "<= parse encrypted extensions" \ |
Jerry Yu | 834886d | 2021-10-30 13:26:15 +0800 | [diff] [blame] | 12534 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12535 | -c "=> parse certificate verify" \ |
| 12536 | -c "<= parse certificate verify" \ |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12537 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12538 | -c "<= parse finished message" \ |
Gilles Peskine | 860429f | 2022-02-12 00:44:48 +0100 | [diff] [blame] | 12539 | -c "Protocol is TLSv1.3" \ |
Jerry Yu | 6d38c19 | 2021-11-15 14:01:04 +0800 | [diff] [blame] | 12540 | -c "HTTP/1.0 200 OK" |
XiaokangQian | d0aa3e9 | 2021-11-10 06:17:40 +0000 | [diff] [blame] | 12541 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12542 | requires_openssl_tls1_3_with_compatible_ephemeral |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12543 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12544 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12545 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12546 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12547 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12548 | run_test "TLS 1.3: alpn - openssl" \ |
| 12549 | "$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] | 12550 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12551 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12552 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12553 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12554 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12555 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12556 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12557 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12558 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12559 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12560 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12561 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12562 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12563 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12564 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12565 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12566 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12567 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12568 | -c "=> parse certificate verify" \ |
| 12569 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12570 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12571 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12572 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12573 | -c "HTTP/1.0 200 ok" \ |
| 12574 | -c "Application Layer Protocol is h2" |
| 12575 | |
| 12576 | requires_gnutls_tls1_3 |
| 12577 | requires_gnutls_next_no_ticket |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12578 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12579 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12580 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12581 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12582 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12583 | run_test "TLS 1.3: alpn - gnutls" \ |
| 12584 | "$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] | 12585 | "$P_CLI debug_level=3 alpn=h2" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12586 | 0 \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12587 | -s "SERVER HELLO was queued" \ |
| 12588 | -c "client state: MBEDTLS_SSL_HELLO_REQUEST" \ |
| 12589 | -c "client state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 12590 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 12591 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 12592 | -c "client state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 12593 | -c "client state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 12594 | -c "client state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 12595 | -c "client state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 12596 | -c "client state: MBEDTLS_SSL_FLUSH_BUFFERS" \ |
| 12597 | -c "client state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12598 | -c "<= ssl_tls13_process_server_hello" \ |
Ronald Cron | 4bb6773 | 2023-02-16 15:51:18 +0100 | [diff] [blame] | 12599 | -c "server hello, chosen ciphersuite: ( 1303 ) - TLS1-3-CHACHA20-POLY1305-SHA256" \ |
Przemek Stekiel | 1f5c2ba | 2023-06-15 17:04:44 +0200 | [diff] [blame] | 12600 | -c "DHE group name: " \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12601 | -c "=> ssl_tls13_process_server_hello" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12602 | -c "<= parse encrypted extensions" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12603 | -c "Certificate verification flags clear" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 12604 | -c "=> parse certificate verify" \ |
| 12605 | -c "<= parse certificate verify" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12606 | -c "mbedtls_ssl_tls13_process_certificate_verify() returned 0" \ |
| 12607 | -c "<= parse finished message" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 12608 | -c "Protocol is TLSv1.3" \ |
lhuang04 | 86cacac | 2022-01-21 07:34:27 -0800 | [diff] [blame] | 12609 | -c "HTTP/1.0 200 OK" \ |
| 12610 | -c "Application Layer Protocol is h2" |
| 12611 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12612 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12613 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12614 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12615 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12616 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12617 | run_test "TLS 1.3: server alpn - openssl" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12618 | "$P_SRV debug_level=3 tickets=0 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key alpn=h2" \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12619 | "$O_NEXT_CLI -msg -tls1_3 -no_middlebox -alpn h2" \ |
| 12620 | 0 \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12621 | -s "found alpn extension" \ |
| 12622 | -s "server side, adding alpn extension" \ |
| 12623 | -s "Protocol is TLSv1.3" \ |
| 12624 | -s "HTTP/1.0 200 OK" \ |
| 12625 | -s "Application Layer Protocol is h2" |
| 12626 | |
| 12627 | requires_gnutls_tls1_3 |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12628 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | 95d5f54 | 2022-06-24 02:29:26 +0000 | [diff] [blame] | 12629 | requires_config_enabled MBEDTLS_SSL_SRV_C |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12630 | requires_config_enabled MBEDTLS_SSL_ALPN |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12631 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12632 | run_test "TLS 1.3: server alpn - gnutls" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12633 | "$P_SRV debug_level=3 tickets=0 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key alpn=h2" \ |
XiaokangQian | c740345 | 2022-06-23 03:24:12 +0000 | [diff] [blame] | 12634 | "$G_NEXT_CLI localhost -d 4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V --alpn h2" \ |
| 12635 | 0 \ |
XiaokangQian | acb3992 | 2022-06-17 10:18:48 +0000 | [diff] [blame] | 12636 | -s "found alpn extension" \ |
| 12637 | -s "server side, adding alpn extension" \ |
| 12638 | -s "Protocol is TLSv1.3" \ |
| 12639 | -s "HTTP/1.0 200 OK" \ |
| 12640 | -s "Application Layer Protocol is h2" |
| 12641 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12642 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12643 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12644 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12645 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12646 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12647 | run_test "TLS 1.3: Client authentication, no client certificate - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12648 | "$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] | 12649 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12650 | 0 \ |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12651 | -c "got a certificate request" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12652 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12653 | -s "TLS 1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12654 | -c "HTTP/1.0 200 ok" \ |
| 12655 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12656 | |
| 12657 | requires_gnutls_tls1_3 |
| 12658 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12659 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12660 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12661 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12662 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12663 | run_test "TLS 1.3: Client authentication, no client certificate - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12664 | "$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] | 12665 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12666 | 0 \ |
| 12667 | -c "got a certificate request" \ |
| 12668 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE"\ |
| 12669 | -s "Version: TLS1.3" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12670 | -c "HTTP/1.0 200 OK" \ |
| 12671 | -c "Protocol is TLSv1.3" |
| 12672 | |
Jerry Yu | aa6214a | 2022-01-30 19:53:28 +0800 | [diff] [blame] | 12673 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12674 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12675 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12676 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12677 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12678 | run_test "TLS 1.3: Client authentication, no server middlebox compat - openssl" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12679 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12680 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cli2.crt key_file=$DATA_FILES_PATH/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 12681 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12682 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12683 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12684 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12685 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12686 | |
| 12687 | requires_gnutls_tls1_3 |
| 12688 | requires_gnutls_next_no_ticket |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12689 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12690 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12691 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12692 | run_test "TLS 1.3: Client authentication, no server middlebox compat - gnutls" \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12693 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12694 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/cli2.crt \ |
| 12695 | key_file=$DATA_FILES_PATH/cli2.key" \ |
Jerry Yu | c19884f | 2022-01-29 10:44:44 +0800 | [diff] [blame] | 12696 | 0 \ |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12697 | -c "got a certificate request" \ |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12698 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12699 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12700 | -c "Protocol is TLSv1.3" |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12701 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12702 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 200b47b | 2022-01-28 14:26:30 +0800 | [diff] [blame] | 12703 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12704 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12705 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12706 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12707 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12708 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12709 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12710 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12711 | 0 \ |
| 12712 | -c "got a certificate request" \ |
| 12713 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12714 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12715 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12716 | |
| 12717 | requires_gnutls_tls1_3 |
| 12718 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12719 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12720 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12721 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12722 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12723 | run_test "TLS 1.3: Client authentication, ecdsa_secp256r1_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12724 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12725 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12726 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12727 | 0 \ |
| 12728 | -c "got a certificate request" \ |
| 12729 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12730 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12731 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12732 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12733 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12734 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12735 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12736 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12737 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12738 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12739 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12740 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12741 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12742 | 0 \ |
| 12743 | -c "got a certificate request" \ |
| 12744 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12745 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12746 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12747 | |
| 12748 | requires_gnutls_tls1_3 |
| 12749 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12750 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12751 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12752 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12753 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12754 | run_test "TLS 1.3: Client authentication, ecdsa_secp384r1_sha384 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12755 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12756 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 12757 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12758 | 0 \ |
| 12759 | -c "got a certificate request" \ |
| 12760 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12761 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12762 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12763 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12764 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12765 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12766 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12767 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12768 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12769 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12770 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12771 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12772 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12773 | 0 \ |
| 12774 | -c "got a certificate request" \ |
| 12775 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12776 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12777 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12778 | |
| 12779 | requires_gnutls_tls1_3 |
| 12780 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12781 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12782 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12783 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12784 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12785 | run_test "TLS 1.3: Client authentication, ecdsa_secp521r1_sha512 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12786 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12787 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12788 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key" \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12789 | 0 \ |
| 12790 | -c "got a certificate request" \ |
| 12791 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12792 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12793 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12794 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12795 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12796 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12797 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12798 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12799 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12800 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12801 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - openssl" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12802 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12803 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12804 | key_file=$DATA_FILES_PATH/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12805 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12806 | -c "got a certificate request" \ |
| 12807 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12808 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12809 | -c "Protocol is TLSv1.3" |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12810 | |
| 12811 | requires_gnutls_tls1_3 |
| 12812 | requires_gnutls_next_no_ticket |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12813 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12814 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12815 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12816 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12817 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12818 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha256 - gnutls" \ |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12819 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12820 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12821 | key_file=$DATA_FILES_PATH/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12822 | 0 \ |
Jerry Yu | 6c3d821 | 2022-02-18 15:23:23 +0800 | [diff] [blame] | 12823 | -c "got a certificate request" \ |
| 12824 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
Jerry Yu | 562a0fd | 2022-02-18 15:35:11 +0800 | [diff] [blame] | 12825 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Jerry Yu | 919130c | 2022-02-23 10:40:19 +0800 | [diff] [blame] | 12826 | -c "Protocol is TLSv1.3" |
Jerry Yu | 960bc28 | 2022-01-26 11:12:34 +0800 | [diff] [blame] | 12827 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12828 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12829 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12830 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12831 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12832 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12833 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12834 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - openssl" \ |
| 12835 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12836 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12837 | key_file=$DATA_FILES_PATH/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12838 | 0 \ |
| 12839 | -c "got a certificate request" \ |
| 12840 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12841 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12842 | -c "Protocol is TLSv1.3" |
| 12843 | |
| 12844 | requires_gnutls_tls1_3 |
| 12845 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12846 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12847 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12848 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12849 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12850 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12851 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha384 - gnutls" \ |
| 12852 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12853 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12854 | key_file=$DATA_FILES_PATH/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384" \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12855 | 0 \ |
| 12856 | -c "got a certificate request" \ |
| 12857 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12858 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12859 | -c "Protocol is TLSv1.3" |
| 12860 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12861 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12862 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12863 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12864 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12865 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12866 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12867 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - openssl" \ |
| 12868 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12869 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 12870 | key_file=$DATA_FILES_PATH/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12871 | 0 \ |
| 12872 | -c "got a certificate request" \ |
| 12873 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12874 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12875 | -c "Protocol is TLSv1.3" |
| 12876 | |
| 12877 | requires_gnutls_tls1_3 |
| 12878 | requires_gnutls_next_no_ticket |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12879 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12880 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12881 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12882 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12883 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12884 | run_test "TLS 1.3: Client authentication, rsa_pss_rsae_sha512 - gnutls" \ |
| 12885 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12886 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 12887 | key_file=$DATA_FILES_PATH/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512" \ |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12888 | 0 \ |
| 12889 | -c "got a certificate request" \ |
| 12890 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12891 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12892 | -c "Protocol is TLSv1.3" |
| 12893 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12894 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 3a58b46 | 2022-02-22 16:42:29 +0800 | [diff] [blame] | 12895 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12896 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12897 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12898 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12899 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | ccb005e | 2022-02-22 17:38:34 +0800 | [diff] [blame] | 12900 | 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] | 12901 | "$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] | 12902 | -sigalgs ecdsa_secp256r1_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12903 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12904 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512" \ |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12905 | 1 \ |
| 12906 | -c "got a certificate request" \ |
| 12907 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12908 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12909 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12910 | |
| 12911 | requires_gnutls_tls1_3 |
| 12912 | requires_gnutls_next_no_ticket |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12913 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12914 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12915 | requires_config_enabled MBEDTLS_RSA_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12916 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12917 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 819f297 | 2022-02-22 10:14:24 +0800 | [diff] [blame] | 12918 | run_test "TLS 1.3: Client authentication, client alg not in server list - gnutls" \ |
| 12919 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12920 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 12921 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512" \ |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12922 | 1 \ |
| 12923 | -c "got a certificate request" \ |
| 12924 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12925 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 12926 | -c "no suitable signature algorithm" |
Jerry Yu | 2124d05 | 2022-02-18 21:07:18 +0800 | [diff] [blame] | 12927 | |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12928 | # Test using an opaque private key for client authentication |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12929 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12930 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12931 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12932 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12933 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12934 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - openssl" \ |
| 12935 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 -no_middlebox" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12936 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cli2.crt key_file=$DATA_FILES_PATH/cli2.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12937 | 0 \ |
| 12938 | -c "got a certificate request" \ |
| 12939 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12940 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12941 | -c "Protocol is TLSv1.3" |
| 12942 | |
| 12943 | requires_gnutls_tls1_3 |
| 12944 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12945 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12946 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 12947 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 12948 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12949 | run_test "TLS 1.3: Client authentication - opaque key, no server middlebox compat - gnutls" \ |
| 12950 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12951 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/cli2.crt \ |
| 12952 | key_file=$DATA_FILES_PATH/cli2.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12953 | 0 \ |
| 12954 | -c "got a certificate request" \ |
| 12955 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12956 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12957 | -c "Protocol is TLSv1.3" |
| 12958 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12959 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12960 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12961 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12962 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12963 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12964 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12965 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - openssl" \ |
| 12966 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12967 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12968 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12969 | 0 \ |
| 12970 | -c "got a certificate request" \ |
| 12971 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12972 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12973 | -c "Protocol is TLSv1.3" |
| 12974 | |
| 12975 | requires_gnutls_tls1_3 |
| 12976 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12977 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12978 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12979 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12980 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12981 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12982 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp256r1_sha256 - gnutls" \ |
| 12983 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 12984 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp256r1.crt \ |
| 12985 | key_file=$DATA_FILES_PATH/ecdsa_secp256r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12986 | 0 \ |
| 12987 | -c "got a certificate request" \ |
| 12988 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 12989 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 12990 | -c "Protocol is TLSv1.3" |
| 12991 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 12992 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12993 | requires_config_enabled MBEDTLS_DEBUG_C |
| 12994 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12995 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 12996 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 12997 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 12998 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - openssl" \ |
| 12999 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13000 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 13001 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13002 | 0 \ |
| 13003 | -c "got a certificate request" \ |
| 13004 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13005 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13006 | -c "Protocol is TLSv1.3" |
| 13007 | |
| 13008 | requires_gnutls_tls1_3 |
| 13009 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13010 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13011 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13012 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13013 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13014 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13015 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp384r1_sha384 - gnutls" \ |
| 13016 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13017 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp384r1.crt \ |
| 13018 | key_file=$DATA_FILES_PATH/ecdsa_secp384r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13019 | 0 \ |
| 13020 | -c "got a certificate request" \ |
| 13021 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13022 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13023 | -c "Protocol is TLSv1.3" |
| 13024 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13025 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13026 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13027 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13028 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13029 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13030 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13031 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - openssl" \ |
| 13032 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13033 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13034 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13035 | 0 \ |
| 13036 | -c "got a certificate request" \ |
| 13037 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13038 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13039 | -c "Protocol is TLSv1.3" |
| 13040 | |
| 13041 | requires_gnutls_tls1_3 |
| 13042 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13043 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13044 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13045 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13046 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13047 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13048 | run_test "TLS 1.3: Client authentication - opaque key, ecdsa_secp521r1_sha512 - gnutls" \ |
| 13049 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13050 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13051 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13052 | 0 \ |
| 13053 | -c "got a certificate request" \ |
| 13054 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13055 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13056 | -c "Protocol is TLSv1.3" |
| 13057 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13058 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13059 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13060 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13061 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13062 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13063 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13064 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13065 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - openssl" \ |
| 13066 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13067 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13068 | key_file=$DATA_FILES_PATH/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13069 | 0 \ |
| 13070 | -c "got a certificate request" \ |
| 13071 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13072 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13073 | -c "Protocol is TLSv1.3" |
| 13074 | |
| 13075 | requires_gnutls_tls1_3 |
| 13076 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13077 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13078 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13079 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13080 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13081 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13082 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13083 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha256 - gnutls" \ |
| 13084 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13085 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13086 | key_file=$DATA_FILES_PATH/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256 key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13087 | 0 \ |
| 13088 | -c "got a certificate request" \ |
| 13089 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13090 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13091 | -c "Protocol is TLSv1.3" |
| 13092 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13093 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13094 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13095 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13096 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13097 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13098 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13099 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13100 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - openssl" \ |
| 13101 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13102 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13103 | key_file=$DATA_FILES_PATH/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13104 | 0 \ |
| 13105 | -c "got a certificate request" \ |
| 13106 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13107 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13108 | -c "Protocol is TLSv1.3" |
| 13109 | |
| 13110 | requires_gnutls_tls1_3 |
| 13111 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13112 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13113 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13114 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13115 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13116 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13117 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13118 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha384 - gnutls" \ |
| 13119 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13120 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13121 | key_file=$DATA_FILES_PATH/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha384 key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13122 | 0 \ |
| 13123 | -c "got a certificate request" \ |
| 13124 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13125 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13126 | -c "Protocol is TLSv1.3" |
| 13127 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13128 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13129 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13130 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13131 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13132 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13133 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13134 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13135 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - openssl" \ |
| 13136 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13137 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/cert_sha256.crt \ |
| 13138 | key_file=$DATA_FILES_PATH/server1.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13139 | 0 \ |
| 13140 | -c "got a certificate request" \ |
| 13141 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13142 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13143 | -c "Protocol is TLSv1.3" |
| 13144 | |
| 13145 | requires_gnutls_tls1_3 |
| 13146 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13147 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13148 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13149 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13150 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13151 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13152 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13153 | run_test "TLS 1.3: Client authentication - opaque key, rsa_pss_rsae_sha512 - gnutls" \ |
| 13154 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13155 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/server2-sha256.crt \ |
| 13156 | key_file=$DATA_FILES_PATH/server2.key sig_algs=ecdsa_secp256r1_sha256,rsa_pss_rsae_sha512 key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13157 | 0 \ |
| 13158 | -c "got a certificate request" \ |
| 13159 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13160 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
| 13161 | -c "Protocol is TLSv1.3" |
| 13162 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13163 | requires_openssl_tls1_3_with_compatible_ephemeral |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13164 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13165 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13166 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13167 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13168 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13169 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13170 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - openssl" \ |
| 13171 | "$O_NEXT_SRV -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache -Verify 10 |
| 13172 | -sigalgs ecdsa_secp256r1_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13173 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13174 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13175 | 1 \ |
| 13176 | -c "got a certificate request" \ |
| 13177 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13178 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13179 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13180 | |
| 13181 | requires_gnutls_tls1_3 |
| 13182 | requires_gnutls_next_no_ticket |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13183 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13184 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13185 | requires_config_enabled MBEDTLS_RSA_C |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13186 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13187 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13188 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13189 | run_test "TLS 1.3: Client authentication - opaque key, client alg not in server list - gnutls" \ |
| 13190 | "$G_NEXT_SRV --debug=4 --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:+CIPHER-ALL:-SIGN-ALL:+SIGN-ECDSA-SECP256R1-SHA256:%NO_TICKETS" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13191 | "$P_CLI debug_level=3 crt_file=$DATA_FILES_PATH/ecdsa_secp521r1.crt \ |
| 13192 | key_file=$DATA_FILES_PATH/ecdsa_secp521r1.key sig_algs=ecdsa_secp256r1_sha256,ecdsa_secp521r1_sha512 key_opaque=1" \ |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13193 | 1 \ |
| 13194 | -c "got a certificate request" \ |
| 13195 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE" \ |
| 13196 | -c "client state: MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY" \ |
Xiaokang Qian | ea3d933 | 2022-12-07 06:19:49 +0000 | [diff] [blame] | 13197 | -c "no suitable signature algorithm" |
Neil Armstrong | 7f6f672 | 2022-04-15 10:09:11 +0200 | [diff] [blame] | 13198 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13199 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13200 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13201 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13202 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13203 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13204 | 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] | 13205 | "$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] | 13206 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13207 | 0 \ |
| 13208 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13209 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13210 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13211 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13212 | -c "HTTP/1.0 200 ok" |
| 13213 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13214 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13215 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13216 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13217 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13218 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13219 | 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] | 13220 | "$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] | 13221 | "$P_CLI debug_level=4" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 13222 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13223 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13224 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13225 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13226 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 6db08dd | 2022-01-18 06:36:23 +0000 | [diff] [blame] | 13227 | -c "HTTP/1.0 200 ok" |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13228 | |
| 13229 | requires_gnutls_tls1_3 |
| 13230 | requires_gnutls_next_no_ticket |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13231 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13232 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13233 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13234 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13235 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13236 | 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] | 13237 | "$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] | 13238 | "$P_CLI debug_level=4" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13239 | 0 \ |
| 13240 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13241 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13242 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13243 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13244 | -c "HTTP/1.0 200 OK" |
| 13245 | |
| 13246 | requires_gnutls_tls1_3 |
| 13247 | requires_gnutls_next_no_ticket |
XiaokangQian | 7bae3b6 | 2022-01-26 06:31:39 +0000 | [diff] [blame] | 13248 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13249 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13250 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13251 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13252 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | df5f868 | 2022-04-05 16:01:03 +0200 | [diff] [blame] | 13253 | 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] | 13254 | "$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] | 13255 | "$P_CLI debug_level=4" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 13256 | 0 \ |
Jerry Yu | 8c5559d | 2021-11-22 21:15:41 +0800 | [diff] [blame] | 13257 | -c "received HelloRetryRequest message" \ |
XiaokangQian | a909061 | 2022-01-27 03:48:27 +0000 | [diff] [blame] | 13258 | -c "<= ssl_tls13_process_server_hello ( HelloRetryRequest )" \ |
Ronald Cron | 27c85e7 | 2022-03-08 11:37:55 +0100 | [diff] [blame] | 13259 | -c "client state: MBEDTLS_SSL_CLIENT_HELLO" \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13260 | -c "Protocol is TLSv1.3" \ |
XiaokangQian | 355e09a | 2022-01-20 11:14:50 +0000 | [diff] [blame] | 13261 | -c "HTTP/1.0 200 OK" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13262 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13263 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13264 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 13265 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13266 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 13267 | run_test "TLS 1.3: Server side check - openssl" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13268 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13269 | "$O_NEXT_CLI -msg -debug -tls1_3 -no_middlebox" \ |
Jerry Yu | 4d8567f | 2022-04-17 10:57:57 +0800 | [diff] [blame] | 13270 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 13271 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13272 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13273 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13274 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 13275 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13276 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13277 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
Jerry Yu | 155493d | 2022-04-25 13:30:18 +0800 | [diff] [blame] | 13278 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13279 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13280 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13281 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13282 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13283 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13284 | run_test "TLS 1.3: Server side check - openssl with client authentication" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13285 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13286 | "$O_NEXT_CLI -msg -debug -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key -tls1_3 -no_middlebox" \ |
XiaokangQian | 9a4e1dd | 2022-05-26 00:58:11 +0000 | [diff] [blame] | 13287 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13288 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13289 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13290 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13291 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13292 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 13293 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13294 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13295 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13296 | -s "=> parse client hello" \ |
| 13297 | -s "<= parse client hello" |
| 13298 | |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13299 | requires_gnutls_tls1_3 |
| 13300 | requires_gnutls_next_no_ticket |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13301 | requires_config_enabled MBEDTLS_DEBUG_C |
XiaokangQian | e8ff350 | 2022-04-22 02:34:40 +0000 | [diff] [blame] | 13302 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13303 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 318dc76 | 2022-04-20 09:43:51 +0000 | [diff] [blame] | 13304 | run_test "TLS 1.3: Server side check - gnutls" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13305 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
XiaokangQian | 3f84d5d | 2022-04-19 06:36:17 +0000 | [diff] [blame] | 13306 | "$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] | 13307 | 0 \ |
Jerry Yu | abf20c7 | 2022-04-14 18:36:14 +0800 | [diff] [blame] | 13308 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13309 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13310 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13311 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c8bdbf7 | 2022-04-23 12:37:35 +0800 | [diff] [blame] | 13312 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13313 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
Jerry Yu | 6622049 | 2022-04-23 13:53:36 +0800 | [diff] [blame] | 13314 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 13315 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 13316 | -c "HTTP/1.0 200 OK" |
XiaokangQian | 5e4528c | 2022-02-17 07:51:12 +0000 | [diff] [blame] | 13317 | |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13318 | requires_gnutls_tls1_3 |
| 13319 | requires_gnutls_next_no_ticket |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13320 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13321 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13322 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13323 | run_test "TLS 1.3: Server side check - gnutls with client authentication" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13324 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13325 | "$G_NEXT_CLI localhost -d 4 --x509certfile $DATA_FILES_PATH/server5.crt --x509keyfile $DATA_FILES_PATH/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] | 13326 | 0 \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13327 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13328 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13329 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13330 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13331 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | c450566 | 2022-05-10 20:39:21 +0800 | [diff] [blame] | 13332 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13333 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13334 | -s "=> write certificate request" \ |
XiaokangQian | 2f150e1 | 2022-04-29 02:01:19 +0000 | [diff] [blame] | 13335 | -s "=> parse client hello" \ |
| 13336 | -s "<= parse client hello" |
| 13337 | |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13338 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13339 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Jerry Yu | 955ddd7 | 2022-04-22 22:27:33 +0800 | [diff] [blame] | 13340 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13341 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13342 | run_test "TLS 1.3: Server side check - mbedtls" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13343 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13344 | "$P_CLI debug_level=4" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 13345 | 0 \ |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13346 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13347 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13348 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13349 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
Jerry Yu | cef55db | 2022-04-23 11:02:05 +0800 | [diff] [blame] | 13350 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13351 | -s "tls13 server state: MBEDTLS_SSL_CERTIFICATE_VERIFY" \ |
| 13352 | -s "tls13 server state: MBEDTLS_SSL_SERVER_FINISHED" \ |
| 13353 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_FINISHED" \ |
| 13354 | -s "tls13 server state: MBEDTLS_SSL_HANDSHAKE_WRAPUP" \ |
| 13355 | -c "HTTP/1.0 200 OK" |
Jerry Yu | 8b9fd37 | 2022-04-14 20:55:12 +0800 | [diff] [blame] | 13356 | |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13357 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13358 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13359 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13360 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | a987e1d | 2022-05-07 01:25:58 +0000 | [diff] [blame] | 13361 | run_test "TLS 1.3: Server side check - mbedtls with client authentication" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13362 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
| 13363 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key" \ |
XiaokangQian | c3017f6 | 2022-05-13 05:55:41 +0000 | [diff] [blame] | 13364 | 0 \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13365 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13366 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13367 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13368 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
Jerry Yu | a7abc5e | 2022-05-11 13:32:03 +0800 | [diff] [blame] | 13369 | -s "=> write certificate request" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13370 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
XiaokangQian | 45c2220 | 2022-05-06 06:54:09 +0000 | [diff] [blame] | 13371 | -s "=> parse client hello" \ |
| 13372 | -s "<= parse client hello" |
| 13373 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13374 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13375 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13376 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13377 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13378 | run_test "TLS 1.3: Server side check - mbedtls with client empty certificate" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13379 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13380 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13381 | 1 \ |
| 13382 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13383 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13384 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13385 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13386 | -s "=> write certificate request" \ |
| 13387 | -s "SSL - No client certification received from the client, but required by the authentication mode" \ |
| 13388 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13389 | -s "=> parse client hello" \ |
| 13390 | -s "<= parse client hello" |
| 13391 | |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13392 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13393 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13394 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13395 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13396 | run_test "TLS 1.3: Server side check - mbedtls with optional client authentication" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13397 | "$P_SRV debug_level=4 auth_mode=optional crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13398 | "$P_CLI debug_level=4 crt_file=none key_file=none" \ |
XiaokangQian | aca9048 | 2022-05-19 07:19:31 +0000 | [diff] [blame] | 13399 | 0 \ |
| 13400 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13401 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13402 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13403 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13404 | -s "=> write certificate request" \ |
| 13405 | -c "client state: MBEDTLS_SSL_CERTIFICATE_REQUEST" \ |
| 13406 | -s "=> parse client hello" \ |
| 13407 | -s "<= parse client hello" |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13408 | |
| 13409 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13410 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 13411 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13412 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13413 | requires_config_enabled PSA_WANT_ALG_ECDH |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13414 | run_test "TLS 1.3: server: HRR check - mbedtls" \ |
Przemek Stekiel | 45255e4 | 2023-06-29 13:56:36 +0200 | [diff] [blame] | 13415 | "$P_SRV debug_level=4 groups=secp384r1" \ |
| 13416 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Jerry Yu | 36becb1 | 2022-05-12 16:57:20 +0800 | [diff] [blame] | 13417 | 0 \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13418 | -s "tls13 server state: MBEDTLS_SSL_CLIENT_HELLO" \ |
| 13419 | -s "tls13 server state: MBEDTLS_SSL_SERVER_HELLO" \ |
| 13420 | -s "tls13 server state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13421 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
| 13422 | -c "client state: MBEDTLS_SSL_ENCRYPTED_EXTENSIONS" \ |
| 13423 | -s "selected_group: secp384r1" \ |
Jerry Yu | ede50ea | 2022-05-05 11:21:20 +0800 | [diff] [blame] | 13424 | -s "=> write hello retry request" \ |
| 13425 | -s "<= write hello retry request" |
| 13426 | |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13427 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13428 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13429 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13430 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13431 | run_test "TLS 1.3: Server side check, no server certificate available" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13432 | "$P_SRV debug_level=4 crt_file=none key_file=none" \ |
Ronald Cron | 65f9029 | 2023-03-13 17:38:12 +0100 | [diff] [blame] | 13433 | "$P_CLI debug_level=4" \ |
Jerry Yu | b89125b | 2022-05-13 15:45:49 +0800 | [diff] [blame] | 13434 | 1 \ |
| 13435 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CERTIFICATE" \ |
| 13436 | -s "No certificate available." |
| 13437 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13438 | requires_openssl_tls1_3_with_compatible_ephemeral |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13439 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13440 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13441 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13442 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13443 | run_test "TLS 1.3: Server side check - openssl with sni" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13444 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13445 | sni=localhost,$DATA_FILES_PATH/server5.crt,$DATA_FILES_PATH/server5.key,$DATA_FILES_PATH/test-ca_cat12.crt,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
| 13446 | "$O_NEXT_CLI -msg -debug -servername localhost -CAfile $DATA_FILES_PATH/test-ca_cat12.crt -cert $DATA_FILES_PATH/server5.crt -key $DATA_FILES_PATH/server5.key -tls1_3" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13447 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13448 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13449 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13450 | |
XiaokangQian | ac41edf | 2022-05-31 13:22:13 +0000 | [diff] [blame] | 13451 | requires_gnutls_tls1_3 |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13452 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13453 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13454 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13455 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13456 | run_test "TLS 1.3: Server side check - gnutls with sni" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13457 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13458 | sni=localhost,$DATA_FILES_PATH/server5.crt,$DATA_FILES_PATH/server5.key,$DATA_FILES_PATH/test-ca_cat12.crt,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
| 13459 | "$G_NEXT_CLI localhost -d 4 --sni-hostname=localhost --x509certfile $DATA_FILES_PATH/server5.crt --x509keyfile $DATA_FILES_PATH/server5.key --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS -V" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13460 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13461 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13462 | -s "HTTP/1.0 200 OK" |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13463 | |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 13464 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13465 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13466 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13467 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13468 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
XiaokangQian | 2ccd97b | 2022-05-31 08:30:17 +0000 | [diff] [blame] | 13469 | run_test "TLS 1.3: Server side check - mbedtls with sni" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13470 | "$P_SRV debug_level=4 auth_mode=required crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0 \ |
| 13471 | sni=localhost,$DATA_FILES_PATH/server2.crt,$DATA_FILES_PATH/server2.key,-,-,-,polarssl.example,$DATA_FILES_PATH/server1-nospace.crt,$DATA_FILES_PATH/server1.key,-,-,-" \ |
| 13472 | "$P_CLI debug_level=4 server_name=localhost crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key" \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13473 | 0 \ |
XiaokangQian | f2a9420 | 2022-05-20 06:44:24 +0000 | [diff] [blame] | 13474 | -s "parse ServerName extension" \ |
XiaokangQian | 129aeb9 | 2022-06-02 09:29:18 +0000 | [diff] [blame] | 13475 | -s "HTTP/1.0 200 OK" |
XiaokangQian | 40a3523 | 2022-05-07 09:02:40 +0000 | [diff] [blame] | 13476 | |
Gilles Peskine | 2baaf60 | 2022-01-07 15:46:12 +0100 | [diff] [blame] | 13477 | for i in opt-testcases/*.sh |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 13478 | do |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 13479 | TEST_SUITE_NAME=${i##*/} |
| 13480 | TEST_SUITE_NAME=${TEST_SUITE_NAME%.*} |
| 13481 | . "$i" |
Jerry Yu | cdcb683 | 2021-11-29 16:50:13 +0800 | [diff] [blame] | 13482 | done |
Gilles Peskine | 5eb2b02 | 2022-01-07 15:47:02 +0100 | [diff] [blame] | 13483 | unset TEST_SUITE_NAME |
Jerry Yu | 305bfc3 | 2021-11-24 16:04:47 +0800 | [diff] [blame] | 13484 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13485 | # Test 1.3 compatibility mode |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13486 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13487 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13488 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13489 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13490 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13491 | 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] | 13492 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13493 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13494 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13495 | -s "Protocol is TLSv1.3" \ |
| 13496 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13497 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13498 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13499 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13500 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13501 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13502 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13503 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13504 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13505 | run_test "TLS 1.3 m->m both with middlebox compat support" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13506 | "$P_SRV debug_level=4 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13507 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13508 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13509 | -s "Protocol is TLSv1.3" \ |
| 13510 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13511 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13512 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13513 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13514 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13515 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13516 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13517 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13518 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13519 | 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] | 13520 | "$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] | 13521 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13522 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13523 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13524 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13525 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13526 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13527 | requires_openssl_tls1_3_with_compatible_ephemeral |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13528 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
Ronald Cron | 7c0185f | 2021-11-30 09:16:24 +0100 | [diff] [blame] | 13529 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13530 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13531 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13532 | 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] | 13533 | "$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] | 13534 | "$P_CLI debug_level=4" \ |
Ronald Cron | fdb0e3f | 2021-12-09 10:39:19 +0100 | [diff] [blame] | 13535 | 1 \ |
| 13536 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13537 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13538 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13539 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13540 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13541 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13542 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13543 | run_test "TLS 1.3 m->O both with middlebox compat support" \ |
| 13544 | "$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] | 13545 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13546 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13547 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13548 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13549 | |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13550 | requires_gnutls_tls1_3 |
| 13551 | requires_gnutls_next_no_ticket |
| 13552 | requires_gnutls_next_disable_tls13_compat |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13553 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13554 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13555 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13556 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13557 | run_test "TLS 1.3 m->G both peers do not support middlebox compatibility" \ |
| 13558 | "$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] | 13559 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13560 | 0 \ |
Ronald Cron | a1b8f6e | 2022-03-18 14:04:12 +0100 | [diff] [blame] | 13561 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13562 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13563 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13564 | |
| 13565 | requires_gnutls_tls1_3 |
| 13566 | requires_gnutls_next_no_ticket |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13567 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13568 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13569 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13570 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13571 | run_test "TLS 1.3 m->G server with middlebox compat support, not client" \ |
| 13572 | "$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] | 13573 | "$P_CLI debug_level=4" \ |
Ronald Cron | a55c5a1 | 2021-11-30 09:32:47 +0100 | [diff] [blame] | 13574 | 1 \ |
| 13575 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13576 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13577 | requires_gnutls_tls1_3 |
| 13578 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13579 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13580 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13581 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13582 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13583 | run_test "TLS 1.3 m->G both with middlebox compat support" \ |
| 13584 | "$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] | 13585 | "$P_CLI debug_level=4" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13586 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13587 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13588 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13589 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13590 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13591 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13592 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13593 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13594 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13595 | run_test "TLS 1.3 O->m both peers do not support middlebox compatibility" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13596 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13597 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13598 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13599 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13600 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13601 | -C "14 03 03 00 01" |
| 13602 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13603 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13604 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13605 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13606 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13607 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13608 | run_test "TLS 1.3 O->m server with middlebox compat support, not client" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13609 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13610 | "$O_NEXT_CLI -msg -debug -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13611 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13612 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13613 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" |
| 13614 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13615 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13616 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13617 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13618 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13619 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13620 | run_test "TLS 1.3 O->m both with middlebox compat support" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13621 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13622 | "$O_NEXT_CLI -msg -debug" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13623 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13624 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13625 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13626 | -c "14 03 03 00 01" |
| 13627 | |
| 13628 | requires_gnutls_tls1_3 |
| 13629 | requires_gnutls_next_no_ticket |
| 13630 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13631 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13632 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13633 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13634 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13635 | run_test "TLS 1.3 G->m both peers do not support middlebox compatibility" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13636 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13637 | "$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] | 13638 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13639 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13640 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13641 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13642 | |
| 13643 | requires_gnutls_tls1_3 |
| 13644 | requires_gnutls_next_no_ticket |
| 13645 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13646 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13647 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13648 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13649 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13650 | run_test "TLS 1.3 G->m server with middlebox compat support, not client" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13651 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13652 | "$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] | 13653 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13654 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13655 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13656 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13657 | -c "discarding change cipher spec in TLS1.3" |
| 13658 | |
| 13659 | requires_gnutls_tls1_3 |
| 13660 | requires_gnutls_next_no_ticket |
| 13661 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13662 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13663 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13664 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13665 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13666 | run_test "TLS 1.3 G->m both with middlebox compat support" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13667 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13668 | "$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] | 13669 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13670 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13671 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO" \ |
| 13672 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13673 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13674 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13675 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13676 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13677 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13678 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13679 | 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] | 13680 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13681 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13682 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13683 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13684 | -c "Protocol is TLSv1.3" \ |
| 13685 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13686 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13687 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13688 | |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13689 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13690 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13691 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13692 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13693 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13694 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13695 | 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] | 13696 | "$P_SRV debug_level=4 groups=secp384r1 tickets=0" \ |
| 13697 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13698 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13699 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13700 | -c "Protocol is TLSv1.3" \ |
| 13701 | -s "tls13 server state: MBEDTLS_SSL_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13702 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13703 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13704 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13705 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13706 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13707 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13708 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13709 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13710 | run_test "TLS 1.3 m->O HRR both peers do not support middlebox compatibility" \ |
| 13711 | "$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] | 13712 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13713 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13714 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13715 | -c "received HelloRetryRequest message" \ |
| 13716 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13717 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13718 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13719 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13720 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13721 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13722 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13723 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13724 | run_test "TLS 1.3 m->O HRR server with middlebox compat support, not client" \ |
| 13725 | "$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] | 13726 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13727 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13728 | -c "received HelloRetryRequest message" \ |
| 13729 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13730 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13731 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13732 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13733 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13734 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13735 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13736 | run_test "TLS 1.3 m->O HRR both with middlebox compat support" \ |
| 13737 | "$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] | 13738 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13739 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13740 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13741 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13742 | |
| 13743 | requires_gnutls_tls1_3 |
| 13744 | requires_gnutls_next_no_ticket |
| 13745 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13746 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13747 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13748 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13749 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13750 | run_test "TLS 1.3 m->G HRR both peers do not support middlebox compatibility" \ |
| 13751 | "$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] | 13752 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13753 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13754 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13755 | -c "received HelloRetryRequest message" \ |
| 13756 | -C "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" \ |
| 13757 | -C "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13758 | |
| 13759 | requires_gnutls_tls1_3 |
| 13760 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13761 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13762 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13763 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13764 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13765 | run_test "TLS 1.3 m->G HRR server with middlebox compat support, not client" \ |
| 13766 | "$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] | 13767 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13768 | 1 \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13769 | -c "received HelloRetryRequest message" \ |
| 13770 | -c "ChangeCipherSpec invalid in TLS 1.3 without compatibility mode" |
| 13771 | |
| 13772 | requires_gnutls_tls1_3 |
| 13773 | requires_gnutls_next_no_ticket |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13774 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13775 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13776 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13777 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13778 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13779 | run_test "TLS 1.3 m->G HRR both with middlebox compat support" \ |
| 13780 | "$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] | 13781 | "$P_CLI debug_level=4 groups=secp256r1,secp384r1" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13782 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13783 | -c "Protocol is TLSv1.3" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13784 | -c "Ignore ChangeCipherSpec in TLS 1.3 compatibility mode" |
| 13785 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13786 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13787 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13788 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13789 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13790 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13791 | run_test "TLS 1.3 O->m HRR both peers do not support middlebox compatibility" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13792 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13793 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13794 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13795 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13796 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13797 | -C "14 03 03 00 01" |
| 13798 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13799 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13800 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13801 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13802 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13803 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13804 | run_test "TLS 1.3 O->m HRR server with middlebox compat support, not client" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13805 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13806 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384 -no_middlebox" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13807 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13808 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13809 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13810 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13811 | requires_openssl_tls1_3_with_compatible_ephemeral |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13812 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13813 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13814 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13815 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13816 | run_test "TLS 1.3 O->m HRR both with middlebox compat support" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13817 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13818 | "$O_NEXT_CLI -msg -debug -groups P-256:P-384" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13819 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13820 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13821 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13822 | -c "14 03 03 00 01" |
| 13823 | |
| 13824 | requires_gnutls_tls1_3 |
| 13825 | requires_gnutls_next_no_ticket |
| 13826 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13827 | requires_config_disabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 13828 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13829 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 928cbd3 | 2022-10-04 16:14:26 +0200 | [diff] [blame] | 13830 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13831 | run_test "TLS 1.3 G->m HRR both peers do not support middlebox compatibility" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13832 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13833 | "$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] | 13834 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13835 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13836 | -S "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13837 | -C "SSL 3.3 ChangeCipherSpec packet received" |
| 13838 | |
| 13839 | requires_gnutls_tls1_3 |
| 13840 | requires_gnutls_next_no_ticket |
| 13841 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13842 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13843 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13844 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13845 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13846 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13847 | run_test "TLS 1.3 G->m HRR server with middlebox compat support, not client" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13848 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13849 | "$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] | 13850 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13851 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13852 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13853 | -c "SSL 3.3 ChangeCipherSpec packet received" \ |
| 13854 | -c "discarding change cipher spec in TLS1.3" |
| 13855 | |
| 13856 | requires_gnutls_tls1_3 |
| 13857 | requires_gnutls_next_no_ticket |
| 13858 | requires_gnutls_next_disable_tls13_compat |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13859 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13860 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Przemek Stekiel | c31a798 | 2023-06-27 10:53:33 +0200 | [diff] [blame] | 13861 | requires_config_enabled PSA_WANT_ALG_ECDH |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13862 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13863 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13864 | run_test "TLS 1.3 G->m HRR both with middlebox compat support" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13865 | "$P_SRV debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key groups=secp384r1 tickets=0" \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13866 | "$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] | 13867 | 0 \ |
Gabor Mezei | 9e4b7bd | 2022-06-28 16:22:14 +0200 | [diff] [blame] | 13868 | -s "Protocol is TLSv1.3" \ |
Gabor Mezei | f7044ea | 2022-06-28 16:01:49 +0200 | [diff] [blame] | 13869 | -s "tls13 server state: MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST" \ |
Gabor Mezei | 7e2dbaf | 2022-05-24 16:05:29 +0200 | [diff] [blame] | 13870 | -c "SSL 3.3 ChangeCipherSpec packet received" |
| 13871 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13872 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13873 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13874 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13875 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13876 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13877 | run_test "TLS 1.3: Check signature algorithm order, m->O" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13878 | "$O_NEXT_SRV_NO_CERT -cert $DATA_FILES_PATH/server2-sha256.crt -key $DATA_FILES_PATH/server2.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13879 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 13880 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13881 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13882 | 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] | 13883 | 0 \ |
| 13884 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13885 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13886 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13887 | |
| 13888 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13889 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13890 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13891 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13892 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13893 | run_test "TLS 1.3: Check signature algorithm order, m->G" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13894 | "$G_NEXT_SRV_NO_CERT --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13895 | -d 4 |
| 13896 | --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 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13897 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13898 | 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] | 13899 | 0 \ |
| 13900 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13901 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13902 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13903 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13904 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13905 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13906 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13907 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13908 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13909 | run_test "TLS 1.3: Check signature algorithm order, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13910 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13911 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13912 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13913 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13914 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 13915 | 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] | 13916 | 0 \ |
| 13917 | -c "Protocol is TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13918 | -c "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
| 13919 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13920 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" \ |
| 13921 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 13922 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13923 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13924 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13925 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13926 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13927 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13928 | run_test "TLS 1.3: Check signature algorithm order, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13929 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13930 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13931 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13932 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13933 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 13934 | -cert $DATA_FILES_PATH/server2-sha256.crt -key $DATA_FILES_PATH/server2.key \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13935 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp256r1_sha256" \ |
| 13936 | 0 \ |
| 13937 | -c "TLSv1.3" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13938 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13939 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 13940 | |
| 13941 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13942 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13943 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13944 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13945 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13946 | run_test "TLS 1.3: Check signature algorithm order, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 13947 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13948 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13949 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13950 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13951 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 13952 | --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13953 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-RSA-PSS-RSAE-SHA384" \ |
| 13954 | 0 \ |
| 13955 | -c "Negotiated version: 3.4" \ |
| 13956 | -c "HTTP/1.0 200 [Oo][Kk]" \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 13957 | -s "CertificateVerify signature with rsa_pss_rsae_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13958 | -s "ssl_tls13_pick_key_cert:selected signature algorithm rsa_pss_rsae_sha512" |
| 13959 | |
| 13960 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13961 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13962 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13963 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13964 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13965 | 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] | 13966 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13967 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13968 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13969 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13970 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 13971 | --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13972 | --priority=NORMAL:-SIGN-ALL:+SIGN-RSA-SHA512:+SIGN-RSA-PSS-RSAE-SHA512:+SIGN-ECDSA-SECP521R1-SHA512" \ |
| 13973 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 13974 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13975 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 13976 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13977 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13978 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13979 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13980 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13981 | 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] | 13982 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13983 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 13984 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13985 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13986 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
| 13987 | -cert $DATA_FILES_PATH/server2-sha256.crt -key $DATA_FILES_PATH/server2.key \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13988 | -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:ecdsa_secp521r1_sha512" \ |
| 13989 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 13990 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13991 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13992 | requires_config_enabled MBEDTLS_DEBUG_C |
| 13993 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 13994 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 13995 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 13996 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 13997 | 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] | 13998 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 13999 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14000 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14001 | sig_algs=rsa_pkcs1_sha512,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14002 | "$P_CLI allow_sha1=0 debug_level=4 crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14003 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,ecdsa_secp521r1_sha512" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14004 | 1 \ |
Ronald Cron | 67ea254 | 2022-09-15 17:34:42 +0200 | [diff] [blame] | 14005 | -S "ssl_tls13_pick_key_cert:check signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14006 | |
| 14007 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14008 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14009 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14010 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14011 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14012 | run_test "TLS 1.3: Check server no suitable certificate, G->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14013 | "$P_SRV debug_level=4 |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14014 | crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14015 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14016 | "$G_NEXT_CLI_NO_CERT localhost -d 4 --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14017 | --priority=NORMAL:-SIGN-ALL:+SIGN-ECDSA-SECP521R1-SHA512:+SIGN-ECDSA-SECP256R1-SHA256" \ |
| 14018 | 1 \ |
| 14019 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14020 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14021 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14022 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14023 | requires_config_enabled MBEDTLS_SSL_SRV_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14024 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14025 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14026 | run_test "TLS 1.3: Check server no suitable certificate, O->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14027 | "$P_SRV debug_level=4 |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14028 | crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14029 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14030 | "$O_NEXT_CLI_NO_CERT -msg -CAfile $DATA_FILES_PATH/test-ca_cat12.crt \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14031 | -sigalgs ecdsa_secp521r1_sha512:ecdsa_secp256r1_sha256" \ |
| 14032 | 1 \ |
| 14033 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14034 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14035 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14036 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14037 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14038 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14039 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14040 | run_test "TLS 1.3: Check server no suitable certificate, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14041 | "$P_SRV debug_level=4 |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14042 | crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14043 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp256r1_sha256 " \ |
| 14044 | "$P_CLI allow_sha1=0 debug_level=4 \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14045 | sig_algs=ecdsa_secp521r1_sha512,ecdsa_secp256r1_sha256" \ |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14046 | 1 \ |
| 14047 | -s "ssl_tls13_pick_key_cert:no suitable certificate found" |
| 14048 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14049 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14050 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14051 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14052 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14053 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14054 | run_test "TLS 1.3: Check client no signature algorithm, m->O" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14055 | "$O_NEXT_SRV_NO_CERT -cert $DATA_FILES_PATH/server2-sha256.crt -key $DATA_FILES_PATH/server2.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14056 | -msg -tls1_3 -num_tickets 0 -no_resume_ephemeral -no_cache |
| 14057 | -Verify 10 -sigalgs rsa_pkcs1_sha512:rsa_pss_rsae_sha512:rsa_pss_rsae_sha384:ecdsa_secp521r1_sha512" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14058 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14059 | 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] | 14060 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14061 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14062 | |
| 14063 | requires_gnutls_tls1_3 |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14064 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14065 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14066 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14067 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14068 | run_test "TLS 1.3: Check client no signature algorithm, m->G" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14069 | "$G_NEXT_SRV_NO_CERT --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14070 | -d 4 |
| 14071 | --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 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14072 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14073 | 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] | 14074 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14075 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14076 | |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14077 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14078 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14079 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Ronald Cron | 70ed417 | 2022-10-20 15:48:19 +0200 | [diff] [blame] | 14080 | requires_all_configs_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE \ |
| 14081 | MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14082 | run_test "TLS 1.3: Check client no signature algorithm, m->m" \ |
Ronald Cron | 50ae84e | 2023-03-14 08:59:56 +0100 | [diff] [blame] | 14083 | "$P_SRV debug_level=4 auth_mode=required |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14084 | crt_file2=$DATA_FILES_PATH/server2-sha256.crt key_file2=$DATA_FILES_PATH/server2.key |
| 14085 | crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14086 | sig_algs=rsa_pkcs1_sha512,rsa_pss_rsae_sha512,rsa_pss_rsae_sha384,ecdsa_secp521r1_sha512" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14087 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server5.crt key_file=$DATA_FILES_PATH/server5.key \ |
Jerry Yu | 7ac0d49 | 2022-07-01 19:29:30 +0800 | [diff] [blame] | 14088 | 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] | 14089 | 1 \ |
Ronald Cron | 067a1e7 | 2022-09-16 13:44:49 +0200 | [diff] [blame] | 14090 | -c "no suitable signature algorithm" |
Jerry Yu | aae28f1 | 2022-06-29 16:21:32 +0800 | [diff] [blame] | 14091 | |
Przemek Stekiel | 8bfe897 | 2023-06-26 12:59:45 +0200 | [diff] [blame] | 14092 | requires_openssl_tls1_3_with_compatible_ephemeral |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 14093 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 14094 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14095 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 14096 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->O" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14097 | "$O_NEXT_SRV_NO_CERT -cert $DATA_FILES_PATH/server2-sha256.crt -key $DATA_FILES_PATH/server2.key |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 14098 | -msg -tls1_2 |
| 14099 | -Verify 10 " \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14100 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 14101 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 14102 | min_version=tls12 max_version=tls13 " \ |
| 14103 | 0 \ |
| 14104 | -c "Protocol is TLSv1.2" \ |
| 14105 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14106 | |
| 14107 | |
| 14108 | requires_gnutls_tls1_3 |
| 14109 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 14110 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14111 | requires_config_enabled MBEDTLS_SSL_CLI_C |
Jerry Yu | eec4f03 | 2022-07-23 11:31:51 +0800 | [diff] [blame] | 14112 | run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->G" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14113 | "$G_NEXT_SRV_NO_CERT --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 14114 | -d 4 |
| 14115 | --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14116 | "$P_CLI debug_level=4 crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/server2.key |
Jerry Yu | 6455b68 | 2022-06-27 14:18:29 +0800 | [diff] [blame] | 14117 | sig_algs=rsa_pss_rsae_sha512,rsa_pkcs1_sha512 |
| 14118 | min_version=tls12 max_version=tls13 " \ |
| 14119 | 0 \ |
| 14120 | -c "Protocol is TLSv1.2" \ |
| 14121 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 14122 | |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14123 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14124 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14125 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14126 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14127 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14128 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14129 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14130 | requires_gnutls_tls1_3 |
| 14131 | requires_gnutls_next_no_ticket |
| 14132 | requires_gnutls_next_disable_tls13_compat |
| 14133 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe3072,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14134 | "$P_SRV crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/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" \ |
| 14135 | "$G_NEXT_CLI_NO_CERT --debug=4 --single-key-share --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE3072:+VERS-TLS1.3:%NO_TICKETS" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14136 | 0 \ |
| 14137 | -s "Protocol is TLSv1.3" \ |
| 14138 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14139 | -s "received signature algorithm: 0x804" \ |
| 14140 | -s "got named group: ffdhe3072(0101)" \ |
| 14141 | -s "Certificate verification was skipped" \ |
| 14142 | -C "received HelloRetryRequest message" |
| 14143 | |
| 14144 | |
| 14145 | requires_gnutls_tls1_3 |
| 14146 | requires_gnutls_next_no_ticket |
| 14147 | requires_gnutls_next_disable_tls13_compat |
| 14148 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14149 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14150 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14151 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14152 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14153 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14154 | requires_config_enabled PSA_WANT_DH_RFC7919_3072 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14155 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe3072,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14156 | "$G_NEXT_SRV_NO_CERT --http --disable-client-cert --debug=4 --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE3072:+VERS-TLS1.3:%NO_TICKETS" \ |
| 14157 | "$P_CLI ca_file=$DATA_FILES_PATH/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] | 14158 | 0 \ |
| 14159 | -c "HTTP/1.0 200 OK" \ |
| 14160 | -c "Protocol is TLSv1.3" \ |
| 14161 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14162 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14163 | -c "NamedGroup: ffdhe3072 ( 101 )" \ |
| 14164 | -c "Verifying peer X.509 certificate... ok" \ |
| 14165 | -C "received HelloRetryRequest message" |
| 14166 | |
| 14167 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14168 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14169 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14170 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14171 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14172 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14173 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14174 | requires_gnutls_tls1_3 |
| 14175 | requires_gnutls_next_no_ticket |
| 14176 | requires_gnutls_next_disable_tls13_compat |
| 14177 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe4096,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14178 | "$P_SRV crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/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" \ |
| 14179 | "$G_NEXT_CLI_NO_CERT --debug=4 --single-key-share --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE4096:+VERS-TLS1.3:%NO_TICKETS" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14180 | 0 \ |
| 14181 | -s "Protocol is TLSv1.3" \ |
| 14182 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14183 | -s "received signature algorithm: 0x804" \ |
| 14184 | -s "got named group: ffdhe4096(0102)" \ |
| 14185 | -s "Certificate verification was skipped" \ |
| 14186 | -C "received HelloRetryRequest message" |
| 14187 | |
| 14188 | |
| 14189 | requires_gnutls_tls1_3 |
| 14190 | requires_gnutls_next_no_ticket |
| 14191 | requires_gnutls_next_disable_tls13_compat |
| 14192 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14193 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14194 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14195 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14196 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14197 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14198 | requires_config_enabled PSA_WANT_DH_RFC7919_4096 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14199 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe4096,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14200 | "$G_NEXT_SRV_NO_CERT --http --disable-client-cert --debug=4 --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE4096:+VERS-TLS1.3:%NO_TICKETS" \ |
| 14201 | "$P_CLI ca_file=$DATA_FILES_PATH/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] | 14202 | 0 \ |
| 14203 | -c "HTTP/1.0 200 OK" \ |
| 14204 | -c "Protocol is TLSv1.3" \ |
| 14205 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14206 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14207 | -c "NamedGroup: ffdhe4096 ( 102 )" \ |
| 14208 | -c "Verifying peer X.509 certificate... ok" \ |
| 14209 | -C "received HelloRetryRequest message" |
| 14210 | |
| 14211 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14212 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14213 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14214 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14215 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14216 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14217 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14218 | requires_gnutls_tls1_3 |
| 14219 | requires_gnutls_next_no_ticket |
| 14220 | requires_gnutls_next_disable_tls13_compat |
| 14221 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe6144,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14222 | "$P_SRV crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/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" \ |
| 14223 | "$G_NEXT_CLI_NO_CERT --debug=4 --single-key-share --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE6144:+VERS-TLS1.3:%NO_TICKETS" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14224 | 0 \ |
| 14225 | -s "Protocol is TLSv1.3" \ |
| 14226 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14227 | -s "received signature algorithm: 0x804" \ |
| 14228 | -s "got named group: ffdhe6144(0103)" \ |
| 14229 | -s "Certificate verification was skipped" \ |
| 14230 | -C "received HelloRetryRequest message" |
| 14231 | |
| 14232 | requires_gnutls_tls1_3 |
| 14233 | requires_gnutls_next_no_ticket |
| 14234 | requires_gnutls_next_disable_tls13_compat |
| 14235 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14236 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14237 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14238 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14239 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14240 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14241 | requires_config_enabled PSA_WANT_DH_RFC7919_6144 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14242 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe6144,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14243 | "$G_NEXT_SRV_NO_CERT --http --disable-client-cert --debug=4 --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE6144:+VERS-TLS1.3:%NO_TICKETS" \ |
| 14244 | "$P_CLI ca_file=$DATA_FILES_PATH/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] | 14245 | 0 \ |
| 14246 | -c "HTTP/1.0 200 OK" \ |
| 14247 | -c "Protocol is TLSv1.3" \ |
| 14248 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14249 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14250 | -c "NamedGroup: ffdhe6144 ( 103 )" \ |
| 14251 | -c "Verifying peer X.509 certificate... ok" \ |
| 14252 | -C "received HelloRetryRequest message" |
| 14253 | |
| 14254 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14255 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14256 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14257 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14258 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14259 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14260 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14261 | requires_gnutls_tls1_3 |
| 14262 | requires_gnutls_next_no_ticket |
| 14263 | requires_gnutls_next_disable_tls13_compat |
| 14264 | client_needs_more_time 4 |
| 14265 | run_test "TLS 1.3 G->m: AES_128_GCM_SHA256,ffdhe8192,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14266 | "$P_SRV crt_file=$DATA_FILES_PATH/server2-sha256.crt key_file=$DATA_FILES_PATH/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" \ |
| 14267 | "$G_NEXT_CLI_NO_CERT --debug=4 --single-key-share --x509cafile $DATA_FILES_PATH/test-ca_cat12.crt --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE8192:+VERS-TLS1.3:%NO_TICKETS" \ |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14268 | 0 \ |
| 14269 | -s "Protocol is TLSv1.3" \ |
| 14270 | -s "server hello, chosen ciphersuite: TLS1-3-AES-128-GCM-SHA256 ( id=4865 )" \ |
| 14271 | -s "received signature algorithm: 0x804" \ |
| 14272 | -s "got named group: ffdhe8192(0104)" \ |
| 14273 | -s "Certificate verification was skipped" \ |
| 14274 | -C "received HelloRetryRequest message" |
| 14275 | |
| 14276 | requires_gnutls_tls1_3 |
| 14277 | requires_gnutls_next_no_ticket |
| 14278 | requires_gnutls_next_disable_tls13_compat |
| 14279 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14280 | requires_config_enabled MBEDTLS_DEBUG_C |
| 14281 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14282 | requires_config_enabled MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE |
| 14283 | requires_config_enabled MBEDTLS_X509_RSASSA_PSS_SUPPORT |
| 14284 | requires_config_enabled PSA_WANT_ALG_FFDH |
Valerio Setti | 05754d8 | 2024-01-18 09:47:00 +0100 | [diff] [blame] | 14285 | requires_config_enabled PSA_WANT_DH_RFC7919_8192 |
Przemek Stekiel | 3484db4 | 2023-06-28 13:31:38 +0200 | [diff] [blame] | 14286 | client_needs_more_time 4 |
| 14287 | run_test "TLS 1.3 m->G: AES_128_GCM_SHA256,ffdhe8192,rsa_pss_rsae_sha256" \ |
David Horstmann | 5ab92be | 2024-07-01 17:01:28 +0100 | [diff] [blame] | 14288 | "$G_NEXT_SRV_NO_CERT --http --disable-client-cert --debug=4 --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key --priority=NONE:+AES-128-GCM:+SHA256:+AEAD:+SIGN-RSA-PSS-RSAE-SHA256:+GROUP-FFDHE8192:+VERS-TLS1.3:%NO_TICKETS" \ |
| 14289 | "$P_CLI ca_file=$DATA_FILES_PATH/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] | 14290 | 0 \ |
| 14291 | -c "HTTP/1.0 200 OK" \ |
| 14292 | -c "Protocol is TLSv1.3" \ |
| 14293 | -c "server hello, chosen ciphersuite: ( 1301 ) - TLS1-3-AES-128-GCM-SHA256" \ |
| 14294 | -c "Certificate Verify: Signature algorithm ( 0804 )" \ |
| 14295 | -c "NamedGroup: ffdhe8192 ( 104 )" \ |
| 14296 | -c "Verifying peer X.509 certificate... ok" \ |
| 14297 | -C "received HelloRetryRequest message" |
| 14298 | |
Ronald Cron | 8a74f07 | 2023-06-14 17:59:29 +0200 | [diff] [blame] | 14299 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 |
| 14300 | requires_config_enabled MBEDTLS_SSL_SRV_C |
| 14301 | requires_config_enabled MBEDTLS_SSL_CLI_C |
| 14302 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 14303 | requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 14304 | run_test "TLS 1.3: no HRR in case of PSK key exchange mode" \ |
Gilles Peskine | abb1c22 | 2024-05-13 21:06:26 +0200 | [diff] [blame] | 14305 | "$P_SRV nbio=2 psk=73776f726466697368 psk_identity=0a0b0c tls13_kex_modes=psk groups=none" \ |
| 14306 | "$P_CLI nbio=2 debug_level=3 psk=73776f726466697368 psk_identity=0a0b0c tls13_kex_modes=all" \ |
Ronald Cron | 8a74f07 | 2023-06-14 17:59:29 +0200 | [diff] [blame] | 14307 | 0 \ |
| 14308 | -C "received HelloRetryRequest message" \ |
| 14309 | -c "Selected key exchange mode: psk$" \ |
| 14310 | -c "HTTP/1.0 200 OK" |
| 14311 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14312 | # Test heap memory usage after handshake |
Jerry Yu | ab08290 | 2021-12-23 18:02:22 +0800 | [diff] [blame] | 14313 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14314 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 14315 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 14316 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 14317 | requires_max_content_len 16384 |
Wenxing Hou | 848bccf | 2024-06-19 11:04:13 +0800 | [diff] [blame] | 14318 | run_tests_memory_after_handshake |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 14319 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14320 | if [ "$LIST_TESTS" -eq 0 ]; then |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 14321 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14322 | # Final report |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14323 | |
Tomás González | 24552ff | 2023-08-17 15:10:03 +0100 | [diff] [blame] | 14324 | echo "------------------------------------------------------------------------" |
| 14325 | |
| 14326 | if [ $FAILS = 0 ]; then |
| 14327 | printf "PASSED" |
| 14328 | else |
| 14329 | printf "FAILED" |
| 14330 | fi |
| 14331 | PASSES=$(( $TESTS - $FAILS )) |
| 14332 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
| 14333 | |
Gilles Peskine | c75048c | 2024-05-17 11:55:15 +0200 | [diff] [blame] | 14334 | if [ $((TESTS - SKIPS)) -lt $MIN_TESTS ]; then |
| 14335 | cat <<EOF |
| 14336 | Error: Expected to run at least $MIN_TESTS, but only ran $((TESTS - SKIPS)). |
| 14337 | Maybe a bad filter ('$FILTER') or a bad configuration? |
| 14338 | EOF |
| 14339 | if [ $FAILS -eq 0 ]; then |
| 14340 | FAILS=1 |
| 14341 | fi |
| 14342 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14343 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14344 | |
Tom Cosgrove | fc0e79e | 2023-01-13 12:13:41 +0000 | [diff] [blame] | 14345 | if [ $FAILS -gt 255 ]; then |
| 14346 | # Clamp at 255 as caller gets exit code & 0xFF |
| 14347 | # (so 256 would be 0, or success, etc) |
| 14348 | FAILS=255 |
| 14349 | fi |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 14350 | exit $FAILS |